A readonly tuple where elements are themselves readonly arrays/tuples.
type F1 = Tuple.Flatten<[[1, 2], [3, 4]]>; // readonly [1, 2, 3, 4]
type F2 = Tuple.Flatten<[[1], readonly [2, 3]]>; // readonly [1, 2, 3]
type F3 = Tuple.Flatten<[[1], [2, [3]]]>; // readonly [1, 2, [3]] (only flattens one level)
type F4 = Tuple.Flatten<[readonly number[], readonly string[]]>; // readonly (number | string)[]
type F5 = Tuple.Flatten<readonly (readonly number[])[]>; // readonly number[]
Flattens a nested readonly tuple
Tby one level. General (non-tuple) arrays are supported both as the outer type and as elements; where the exact layout is not statically known, the result degrades to a general readonly array of the combined element types.