Interface IdentificationKeyValidator<V>

Identification key validator. Validates an identification key against its definition in section 3 of the GS1 General Specifications.

interface IdentificationKeyValidator<V> {
    get identificationKeyType(): IdentificationKeyType;
    get prefixType(): PrefixType;
    get length(): number;
    get referenceCharacterSet(): CharacterSet;
    get referenceValidator(): CharacterSetValidator;
    validate: ((identificationKey: string, validation?: V) => void);
}

Type Parameters

Hierarchy (view full)

Properties

validate: ((identificationKey: string, validation?: V) => void)

Validate an identification key and throw an exception if validation fails.

Type declaration

    • (identificationKey, validation?): void
    • Parameters

      • identificationKey: string

        Identification key.

      • Optionalvalidation: V

        Identification key validation parameters.

      Returns void

Accessors

  • get length(): number
  • Get the length. For numeric identification key types, the length is fixed; for alphanumeric identification key types, the length is the maximum.

    Returns number