Skip to content

Tuple (Type)

type Tuple<T, N> = N extends N
? number extends N
? T[]
: _TupleOf<T, N, []>
: never;

Defined in: types/Tuple.ts:7

Helper type to represent a tuple of length N.

From: https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type/52490977#52490977

Type Parameter
T
N extends number