Type Alias PushFront<TailT, HeadT>

PushFront: (head: HeadT, ...tail: TailT) => void extends (
    ...arr: infer ArrT,
) => void
    ? ArrT
    : never

Pushes a value to the front of a tuple type.

Type Parameters

  • TailT extends any[]

    The tail of the tuple.

  • HeadT

    The head to push to the front.

type Original = [number, string];
type Mutated = PushFront<Original, boolean>; // [boolean, number, string]