The readonly array or tuple type.
A union of negative number literals representing the indices if T is a tuple, otherwise number.
type TupleNegativeIndices = NegativeIndexOfTuple<[string, boolean, number]>; // -1 | -2 | -3
type ArrayNegativeIndices = NegativeIndexOfTuple<string[]>; // number
type EmptyTupleNegativeIndices = NegativeIndexOfTuple<[]>; // never
type ReadonlyArrayNegativeIndices = NegativeIndexOfTuple<readonly number[]>; // number
Extracts the negative index type from a readonly array or tuple type
T. Negative indices allow accessing elements from the end of the array (e.g.,-1for last element). IfTis a tuple (fixed length), it returns a union of its negative index literals (e.g.,-1 | -2 | -3). IfTis a regular array (variable length), it returnsnumber.