TupleToUnion<T> converts a tuple type T into a union type. This type is useful for scenarios where you need to work with the individual members of a tuple as a union.
TupleToUnion<T>
T
type A = TupleToUnion<[1, 2, 3]>; // 1 | 2 | 3type B = TupleToUnion<readonly ['a', 'b']>; // 'a' | 'b'type C = TupleToUnion<[]>; // never Copy
type A = TupleToUnion<[1, 2, 3]>; // 1 | 2 | 3type B = TupleToUnion<readonly ['a', 'b']>; // 'a' | 'b'type C = TupleToUnion<[]>; // never
TupleToUnion<T>converts a tuple typeTinto a union type. This type is useful for scenarios where you need to work with the individual members of a tuple as a union.