Arrays
Lengths
Tuples
Like objects, tuples are structures whose values are nested definitions. Like TypeScript, ArkType supports prefix, optional, variadic, and postfix elements, with the same restrictions about combining them.
Prefix
Optional
Tuples can include any number of optional elements following its prefix elements.
Like in TypeScript, optional elements are mutually exclusive with postfix elements.
Variadic
Like in TypeScript, variadic elements allow zero or more consecutive values of a given type and may occur at most once in a tuple.
They are specified with a "..."
operator preceding an array element.
Postfix
Postfix elements are required elements following a variadic element.
They are mutually exclusive with optional elements.