ts-type-forge
    Preparing search index...

    Type Alias Max<N>

    Max: IsNever<N> extends true ? never : MaxCoarse<N, []>

    Calculates the maximum value within a union of non-negative integer literals N (which must extend Uint10).

    Type Parameters

    • N extends Uint10

      A union of non-negative integer literals up to 1023 (Uint10).

    The largest integer literal present in the union N.

    type U2 = 0 | 1 | 2;

    expectType<Max<U2>, 2>('=');

    expectType<Max<5>, 5>('=');

    expectType<Max<Uint10>, 1023>('=');