ts-fortress
    Preparing search index...

    Type Alias UintRange<Start, End>

    UintRange: RelaxedExclude<Index<End>, Index<Start>>

    Creates a union of non-negative integer literals starting from Start (inclusive) up to End (exclusive).

    The bounds are limited to the unsigned 11-bit range: Start must be a Uint11 (0 to 2047) and End must be a Uint11 or 2048, so that a bound the union cannot represent fails with a readable constraint error instead of resolving to never. Ranges where Start >= End resolve to never.

    Type Parameters

    • Start extends Uint11

      The starting integer literal (inclusive).

    • End extends Uint11 | 2048

      The ending integer literal (exclusive).

    A union type Start | Start + 1 | ... | End - 1.

    type R1 = UintRange<3, 7>; // 3 | 4 | 5 | 6
    type R2 = UintRange<0, 4>; // 0 | 1 | 2 | 3
    type R3 = UintRange<5, 5>; // never