ArrayType<TType> Interface
Package: @esfx/struct-type
Represents the constructor for a TypedArray
Declaration
export interface ArrayType<TType extends Type>
Properties
[InitType]
Declaration
[InitType]: TypedArray<TType, number> | ArrayLike<InitType<TType>>;
Property Value
[RuntimeType]
Declaration
[RuntimeType]: TypedArray<TType, number>;
Property Value
BYTES_PER_ELEMENT
The number of bytes per each element of the array.
Declaration
readonly BYTES_PER_ELEMENT: number;
Property Value
fixedLength
Declaration
readonly fixedLength: number | undefined;
Property Value
prototype
Declaration
prototype: TypedArray<TType>;
Property Value
SIZE
Declaration
readonly SIZE: number | undefined;
Property Value
Methods
read(buffer, byteOffset, shared, byteOrder)
Reads an array of values value from the buffer. The resulting array value will be backed by its own buffer.
Declaration
read(buffer: ArrayBufferLike, byteOffset: number, shared?: boolean, byteOrder?: Endianness): TypedArray<TType>;
Parameters
- buffer
- ArrayBufferLike
The ArrayBuffer
or SharedArrayBuffer
from which to read the array.
- byteOrder
- Endianness
The endianness to use when reading the array. If unspecified, the native byte order will be used.
Returns
read(buffer, byteOffset, length, shared, byteOrder)
Reads an array of values value from the buffer. The resulting array value will be backed by its own buffer.
Declaration
read(buffer: ArrayBufferLike, byteOffset: number, length?: number, shared?: boolean, byteOrder?: Endianness): TypedArray<TType>;
Parameters
- buffer
- ArrayBufferLike
The ArrayBuffer
or SharedArrayBuffer
from which to read the array.
- byteOrder
- Endianness
The endianness to use when reading the array. If unspecified, the native byte order will be used.
Returns
toFixed(fixedLength)
Gets a fixed-length subtype for this array type.
Declaration
toFixed<TFixedLength extends number>(fixedLength: TFixedLength): FixedLengthArrayType<TType, TFixedLength>;
Type Parameters
- TFixedLength
Parameters
- fixedLength
- TFixedLength
Returns
write(buffer, byteOffset, value, byteOrder)
Writes an array of values to a buffer.
Declaration
write(buffer: ArrayBufferLike, byteOffset: number, value: TypedArray<TType>, byteOrder?: Endianness): void;
Parameters
- buffer
- ArrayBufferLike
The ArrayBuffer
or SharedArrayBuffer
into which to write the array.
- byteOrder
- Endianness
The endianness to use when writing the array. If unspecified, the native byte order will be used.
Returns