StructType<TDef> Interface

    Package: @esfx/struct-type

    Represents the constructor for a struct.

    Declaration
    export interface StructType<TDef extends StructDefinition> 

    Properties

    [InitType]

    Declaration
    [InitType]: Struct<TDef> | StructObjectInit<TDef> | StructArrayInit<TDef>;
    Property Value
    Struct<TDef> | StructObjectInit<TDef> | StructArrayInit<TDef>

    [RuntimeType]

    Declaration
    [RuntimeType]: Struct<TDef>;
    Property Value
    Struct<TDef>

    prototype

    Declaration
    prototype: Struct<any>;
    Property Value
    Struct<any>

    SIZE

    Gets the size of this struct, in bytes.

    Declaration
    readonly SIZE: number;
    Property Value
    number

    Methods

    read(buffer, byteOffset, byteOrder)

    Reads a structured value from the buffer. The resulting structured value will be backed by its own buffer.

    Declaration
    read(buffer: ArrayBufferLike, byteOffset: number, byteOrder?: Endianness): Struct<TDef>;
    Parameters
    buffer
    ArrayBufferLike

    The ArrayBuffer or SharedArrayBuffer from which to read the value.

    byteOffset
    number

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

    byteOrder
    Endianness

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

    Returns
    Struct<TDef>

    read(buffer, byteOffset, shared, byteOrder)

    Reads a structured value from the buffer. The resulting structured value will be backed by its own buffer.

    Declaration
    read(buffer: ArrayBufferLike, byteOffset: number, shared?: boolean, byteOrder?: Endianness): Struct<TDef>;
    Parameters
    buffer
    ArrayBufferLike

    The ArrayBuffer or SharedArrayBuffer from which to read the value.

    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 value. If unspecified, the native byte order will be used.

    Returns
    Struct<TDef>

    write(buffer, byteOffset, value, byteOrder)

    Writes a structured value to a buffer.

    Declaration
    write(buffer: ArrayBufferLike, byteOffset: number, value: Struct<TDef>, 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
    Struct<TDef>

    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