Thruput TypeScript protocol bindings
    Preparing search index...

    Type Alias FixedArray<T, N>

    FixedArray: ReadonlyArray<T> & { length: N }

    An array that must contain exactly N elements.

    The wire format reads and writes exactly N elements for values of this type; the codec throws on any other length. The array is readonly because the exact length is part of the type: push, pop, and splice would leave the runtime length disagreeing with it.

    N is a literal type, so a dynamically built array is inferred as T[] (length number) and is not assignable here. Use fixedArray to build one — it checks the length at runtime, so no cast is needed. An as const tuple of the right length is also assignable.

    Type Parameters

    • T
    • N extends number