Tuple type

A fixed-length array with a known type at each position.

Since TS 1.3 Spec ↗

Syntax

[A, B, ...Rest[]]

Examples

type Entry = [key: string, value: number];
const e: Entry = ['age', 36];
type Args = [first: string, ...rest: number[]];
const a: Args = ['x', 1, 2, 3];

Notes

Tuples constrain length and per-position types. They support optional elements (`[number, string?]`), rest elements, and labeled positions for readability. `as const` produces readonly tuples. Variadic tuple types enable generic argument forwarding.

See also