idnumbers
    Preparing search index...

    Interface CountryDefinition<K, A, I>

    Everything the registry needs to know about one country: its primary key, the aliases that resolve to it, and the validator it registers.

    Every country module exports one as country (#122). Defining it is free of side effects; nothing is registered until it is passed to register() from idnumbers/core. The root idnumbers entry registers all of them.

    The type parameters keep the literal key, the literal aliases, and the parse result type (#123), from which the ParseResultMap type test checks the map.

    interface CountryDefinition<
        K extends string = string,
        A extends readonly string[] = readonly string[],
        I extends object = ParsedInfo,
    > {
        aliases: A;
        key: K;
        validator: CountryValidator<I>;
    }

    Type Parameters

    • K extends string = string
    • A extends readonly string[] = readonly string[]
    • I extends object = ParsedInfo
    Index
    aliases: A

    Keys that resolve to key, e.g. the alpha-2 code and legacy codes such as 'UK'.

    key: K

    Primary registry key: the ISO 3166-1 alpha-3 code, uppercase.

    validator: CountryValidator<I>

    The validator registered under key.