Skip to main content

UnionToTuple TypeAlias

Converts a union type to a tuple type.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

For more information about our API support guarantees, see here.

Signature

export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];

Type Parameters

ParameterConstraintDefaultDescription
Union
Aunknown[][]Implementation detail: do not specify.
FirstPopUnion<Union>Implementation detail: do not specify.