We can declare a typed tuple in TypeScript, for example, with the type annotation [string, number]. This means an array of 2 elements where the first element ne
As of v3.2.2, there's no perfect way of making a readonly tuple type without converting it to an object that looks like an array, but is not.
The lead architect of TypeScript has said this on the topic of combining Readonly with tuple types.
Here is the best solution I've come up with:
type ReadonlyTuple = {
readonly [P in Exclude]: T[P]
} & Iterable