Type alias Cons<H, T>

Cons<H, T>: ((h, ...t) => void) extends ((...r) => void)
    ? R
    : never

Prepend tuple.

Type Parameters

  • H
  • T extends readonly any[]

Example

const const: Cons<1, [2, 3, 4]> = [1, 2, 3, 4]

Source