@jossmac/lil-libs
    Preparing search index...

    Type Alias TupleOf<T, N, R>

    TupleOf: R["length"] extends N ? R : TupleOf<T, N, [T, ...R]>

    Builds a fixed-length tuple of N elements of type T via recursive conditional types.

    Type Parameters

    • T

      Element type repeated in each slot.

    • N extends number

      Exact tuple length (must be a numeric literal type).

    • R extends unknown[] = []

      Internal accumulator used during recursion; callers should omit this.

    type Triple = TupleOf<number, 3>;
    // ^? [number, number, number]