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