FixedLengthArrayType<TType, TFixedLength> Interface

    Package: @esfx/struct-type

    Represents the constructor for a fixed-length TypedArray

    Declaration
    export interface FixedLengthArrayType<TType extends Type, TFixedLength extends number = number> 

    Properties

    [InitType]

    Declaration
    [InitType]: TypedArray<TType, TFixedLength> | ArrayLike<InitType<TType>>;
    Property Value
    TypedArray<TType, TFixedLength> | ArrayLike<InitType<TType>>

    [RuntimeType]

    Declaration
    [RuntimeType]: TypedArray<TType, TFixedLength>;
    Property Value
    TypedArray<TType, TFixedLength>

    BYTES_PER_ELEMENT

    The number of bytes per each element of the array.

    Declaration
    readonly BYTES_PER_ELEMENT: number;
    Property Value
    number

    fixedLength

    the fixed length of the array.

    Declaration
    readonly fixedLength: TFixedLength;
    Property Value
    TFixedLength

    prototype

    Declaration
    prototype: TypedArray<TType, TFixedLength>;
    Property Value
    TypedArray<TType, TFixedLength>

    SIZE

    The number of bytes for the entire array.

    Declaration
    readonly SIZE: number;
    Property Value
    number

    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, TFixedLength>;
    Parameters
    buffer
    ArrayBufferLike

    The ArrayBuffer or SharedArrayBuffer from which to read the array.

    byteOffset
    number

    The byte offset into <xref:buffer> at which to start reading.

    shared
    boolean

    When true, the resulting value will be backed by a SharedArrayBuffer.

    byteOrder
    Endianness

    The endianness to use when reading the array. If unspecified, the native byte order will be used.

    Returns
    TypedArray<TType, TFixedLength>

    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, TFixedLength>;
    Parameters
    buffer
    ArrayBufferLike

    The ArrayBuffer or SharedArrayBuffer from which to read the array.

    byteOffset
    number

    The byte offset into <xref:buffer> at which to start reading.

    length
    number

    The number of array elements to read from the buffer.

    shared
    boolean

    When true, the resulting value will be backed by a SharedArrayBuffer.

    byteOrder
    Endianness

    The endianness to use when reading the array. If unspecified, the native byte order will be used.

    Returns
    TypedArray<TType, TFixedLength>

    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
    FixedLengthArrayType<TType, TFixedLength>

    write(buffer, byteOffset, value, byteOrder)

    Writes a structured value to a buffer.

    Declaration
    write(buffer: ArrayBufferLike, byteOffset: number, value: TypedArray<TType, TFixedLength>, byteOrder?: Endianness): void;
    Parameters
    buffer
    ArrayBufferLike

    The ArrayBuffer or SharedArrayBuffer into which to write the value.

    byteOffset
    number

    The byte offset into <xref:buffer> at which to start writing.

    value
    TypedArray<TType, TFixedLength>

    The value to write.

    byteOrder
    Endianness

    The endianness to use when writing the value. If unspecified, the native byte order will be used.

    Returns
    void

    Generated by DocFX