ts-type-forge
    Preparing search index...

    Type Alias ArrayOfLength<N, Elm>

    ArrayOfLength: MakeTuple<Elm, N>

    Creates a readonly tuple type of a specific length N with elements of type Elm. Alias for MakeTuple<Elm, N>.

    Type Parameters

    • N extends number

      The desired length of the tuple (must be a non-negative integer literal).

    • Elm

      The type of elements in the tuple.

    A readonly tuple type readonly [Elm, Elm, ..., Elm] of length N.

    type TupleOf3Strings = ArrayOfLength<3, string>; // readonly [string, string, string]
    type TupleOf0Numbers = ArrayOfLength<0, number>; // readonly []