ts-type-forge
    Preparing search index...
    IndexInclusive: IndexOfTuple<[...MakeTuple<0, N>, 0]>

    Creates a union of non-negative integer literals from 0 up to (and including) N. Equivalent to 0 | 1 | ... | N. Requires N to be a non-negative integer literal.

    Type Parameters

    • N extends number

      The upper bound (inclusive). Must be a non-negative integer literal.

    A union type 0 | 1 | ... | N.

    type IdxInc3 = IndexInclusive<3>; // 0 | 1 | 2 | 3
    type IdxInc0 = IndexInclusive<0>; // 0