Why this produces an error \"A rest element type must be an array type.\"?
type QWE = [boolean, ...T]
With TypeScript 4.0 variadic tuple types, adding an item I to a tuple type T gets much easier:
type Prepend = [I, ...T]
type Append = [...T, I]
type AddBetween = [...T, I, ...U]
type PrependTest = Prepend
// [boolean, string, number]
type AppendTest = Append
// [string, number, boolean]
type AddBetweenTest = AddBetween
// [string, boolean, number]
Playground sample code