PokéRogue
    Preparing search index...

    Type Alias IsNumericLiteral<T>

    IsNumericLiteral: IfNotAnyOrNever<
        T,
        {
            ifAny: false;
            ifNever: false;
            ifNot: _IsNumericLiteral<CollapseLiterals<UnwrapBrand<T>>>;
        },
    >

    Returns a boolean for whether the given type is a number or bigint literal type.

    Type Parameters

    • T
    import type {IsNumericLiteral} from 'type-fest';

    type A = IsNumericLiteral<0>;
    //=> true

    type B = IsNumericLiteral<number>;
    //=> false

    type C = IsNumericLiteral<100n>;
    //=> true

    type D = IsNumericLiteral<bigint>;
    //=> false

    type E = IsNumericLiteral<1 | 2 | 10n | 20n>;
    //=> true

    type F = IsNumericLiteral<number | bigint>;
    //=> false

    type G = IsNumericLiteral<1 | bigint>;
    //=> boolean