Tuple overview

Added in v1.4.0


Table of contents


Combinators

Tuple

A schema for n-tuples

Signature

export declare const Tuple: <T extends readonly Schema<any, any>[]>(...items: T) => TupleSchema<T>

Added in v1.0.0

Transformations

TupleSchema (class)

The TupleSchema transformer class, use instead Tuple function

Signature

export declare class TupleSchema<T> {
  constructor(private readonly items: T)
}

Added in v2.2.0

append (property)

Appends items to the end of the tuple

Signature

readonly append: <U extends readonly Schema<any, any>[]>(...items: U) => TupleSchema<readonly [...T, ...U]>

Added in v2.2.0

prepend (property)

Prepends items to the beginning of the tuple

Signature

readonly prepend: <U extends readonly Schema<any, any>[]>(...items: U) => TupleSchema<readonly [...U, ...T]>

Added in v2.2.0