Skip to main content

TupleWithRestSchema<T, Rest>

TupleWithRestSchema<T, Rest> = Schema<[...{ [K in keyof T]: Infer<T[K]> }, ...Infer<Rest>[]]> & object

Tuple schema with rest elements.

Type Declaration​

type: "tuple"​

items: T​

restSchema: Rest​

note

To distinguish from TupleSchema at runtime, use the hasTupleRest type guard:

if (hasTupleRest(schema)) {
// This is a TupleWithRestSchema
}

Type Parameters​

T: T extends readonly GenericSchema[]​

The tuple items type

Rest: Rest extends GenericSchema​

The rest element schema type


Since​

2.0.0