idnumbers
    Preparing search index...

    Interface CountryModule<I>

    Shape of a country module that can be registered as a CountryValidator.

    Every country module carries the canonical IdMetadata (#121). I is the type parse() returns for a valid ID (#123). The checksum return type is intentionally wider than CountryValidator's, because existing modules return heterogeneous checksum shapes.

    interface CountryModule<I extends object = ParsedInfo> {
        checksum?: (id: string) => unknown;
        METADATA: IdMetadata;
        parse?: (id: string) => I | null;
        validate: (id: string) => boolean;
    }

    Type Parameters

    Index
    checksum?: (id: string) => unknown
    METADATA: IdMetadata
    parse?: (id: string) => I | null
    validate: (id: string) => boolean