TypeScript Syntax and Type Operators
Rest tuple element — repeated element type
A tuple rest element permits a variable number of elements of the specified array type alongside fixed positions. Unlike an ordinary array, the tuple can preserve a required prefix or suffix. Non-generic rest placement has constraints; two ordinary rest elements cannot appear in one tuple. A rest element does not guarantee a particular variable length. Example output: "a,b". Tested in the strict TypeScript 5.8.3 / ES2022 baseline; the example is not a runtime type validator.
Formal Syntax & Structure
typescript syntaxtypescript
type Entry = [id: number, ...labels: string[]];Working Example
Example Snippettypescript
type Entry = [id: number, ...labels: string[]];const entry: Entry = [7, "a", "b"];console.log(entry.slice(1).join(","));