Type alias Enumerate<Length, Accumulator>

Enumerate<Length, Accumulator>: Accumulator["length"] extends Length ? Accumulator[number] : Enumerate<Length, readonly [...Accumulator, Accumulator["length"]]>

Recursive type to get a list of numbers of the given length.

Example

type From0To10 = Enumerate<11>;

Type Parameters

  • Length extends number

  • Accumulator extends ReadonlyArray<number> = readonly []