The desired size of each partition. Only a single numeric
literal pins a size; a union of literals and number alike answer an
unsized array of unsized chunks. 0 is not a partition size and answers
never.
The readonly tuple type to partition.
type P1 = Tuple.Partition<2, [1, 2, 3, 4, 5]>; // readonly [readonly [1, 2], readonly [3, 4], readonly [5]]
type P2 = Tuple.Partition<3, [1, 2, 3, 4, 5, 6]>; // readonly [readonly [1, 2, 3], readonly [4, 5, 6]]
type P3 = Tuple.Partition<1, [1, 2]>; // readonly [readonly [1], readonly [2]]
type P4 = Tuple.Partition<5, [1, 2]>; // readonly [readonly [1, 2]]
type P5 = Tuple.Partition<number, [1, 2]>; // readonly (readonly (1 | 2)[])[]
Partitions a readonly tuple
Tinto sub-tuples of lengthN. The last sub-tuple may have fewer thanNelements if the length ofTis not divisible byN.