Skip to content

AIDC Toolkit / GS1 / IdentifierCreator

Interface: IdentifierCreator

Defined in: src/identifier-creator.ts:13

Identifier creator. Creates an identifier based on its definition in section 3 of the GS1 General Specifications.

Keys are created based on a prefix defined in a prefix manager to which the identifier creator is bound.

Extends

Extended by

Properties

validate()

validate: (identifier, validation?) => void

Defined in: src/identifier-validator.ts:93

Validate an identifier and throw an error if validation fails.

Parameters

identifier

string

Identifier.

validation?

IdentifierValidation

Identifier validation parameters.

Returns

void

Inherited from

IdentifierValidator.validate

Accessors

prefixProvider

Get Signature

get prefixProvider(): PrefixProvider

Defined in: src/identifier-creator.ts:17

Get the prefix provider to which this identifier creator is bound.

Returns

PrefixProvider


prefix

Get Signature

get prefix(): string

Defined in: src/identifier-creator.ts:23

Get the prefix, equivalent to calling PrefixProvider.prefix | prefixProvider.prefix for a GTIN or PrefixProvider.gs1CompanyPrefix | prefixProvider.gs1CompanyPrefix for all other identifier types.

Returns

string


referenceLength

Get Signature

get referenceLength(): number

Defined in: src/identifier-creator.ts:28

Get the reference length.

Returns

number


identifierType

Get Signature

get identifierType(): IdentifierType

Defined in: src/identifier-validator.ts:60

Get the identifier type. Per the GS1 General Specifications, the identifier type determines the remaining properties.

Returns

IdentifierType

Inherited from

IdentifierValidator.identifierType


prefixType

Get Signature

get prefixType(): PrefixType

Defined in: src/identifier-validator.ts:66

Get the prefix type supported by the identifier type. For all identifier types except the GTIN, this is PrefixTypes.GS1CompanyPrefix. For the GTIN, the prefix type determines the length.

Returns

PrefixType

Inherited from

IdentifierValidator.prefixType


length

Get Signature

get length(): number

Defined in: src/identifier-validator.ts:72

Get the length. For numeric identifier types, the length is fixed; for alphanumeric identifier types, the length is the maximum.

Returns

number

Inherited from

IdentifierValidator.length


referenceCharacterSet

Get Signature

get referenceCharacterSet(): ContentCharacterSet

Defined in: src/identifier-validator.ts:77

Get the reference character set.

Returns

ContentCharacterSet

Inherited from

IdentifierValidator.referenceCharacterSet


referenceCreator

Get Signature

get referenceCreator(): CharacterSetCreator

Defined in: src/identifier-validator.ts:82

Get the reference creator.

Returns

CharacterSetCreator

Inherited from

IdentifierValidator.referenceCreator