UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

1,329 lines (1,196 loc) 89.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MsiPlesseyChecksumAlgorithmValues = exports.BarcodeFormatUspsIntelligentMailConfiguration = exports.BarcodeFormatUpcEanConfiguration = exports.BarcodeFormatTwoDConfigurationBase = exports.BarcodeFormatRoyalTntPostConfiguration = exports.BarcodeFormatRoyalMailConfiguration = exports.BarcodeFormatQrCodeConfiguration = exports.BarcodeFormatPharmaCodeTwoTrackConfiguration = exports.BarcodeFormatPharmaCodeConfiguration = exports.BarcodeFormatPdf417Configuration = exports.BarcodeFormatOneDConfigurationBase = exports.BarcodeFormatMsiPlesseyConfiguration = exports.BarcodeFormatMicroPdf417Configuration = exports.BarcodeFormatMaxiCodeConfiguration = exports.BarcodeFormatJapanPostConfiguration = exports.BarcodeFormatItfConfiguration = exports.BarcodeFormatGs1CompositeConfiguration = exports.BarcodeFormatFourStateConfigurationBase = exports.BarcodeFormatDataMatrixConfiguration = exports.BarcodeFormatDataBarLimitedConfiguration = exports.BarcodeFormatDataBarExpandedConfiguration = exports.BarcodeFormatDataBarConfiguration = exports.BarcodeFormatConfigurationBase = exports.BarcodeFormatCommonTwoDConfiguration = exports.BarcodeFormatCommonOneDConfiguration = exports.BarcodeFormatCommonFourStateConfiguration = exports.BarcodeFormatCommonConfiguration = exports.BarcodeFormatCode93Configuration = exports.BarcodeFormatCode39Configuration = exports.BarcodeFormatCode2Of5Configuration = exports.BarcodeFormatCode128Configuration = exports.BarcodeFormatCode11Configuration = exports.BarcodeFormatCodabarConfiguration = exports.BarcodeFormatAztecConfiguration = exports.BarcodeFormatAustraliaPostConfiguration = exports.AustraliaPostCustomerFormatValues = void 0; var _utils = require("../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from core/schemas/BarcodeConfigurationTypes.yaml /** Base class for all barcode configurations. */ /** @internal */ let BarcodeFormatConfigurationBase = exports.BarcodeFormatConfigurationBase = void 0; (function (_BarcodeFormatConfigurationBase) { function From(source) { const _type = source._type; switch (_type) { case 'BarcodeFormatCodabarConfiguration': return new BarcodeFormatCodabarConfiguration(source); case 'BarcodeFormatCode11Configuration': return new BarcodeFormatCode11Configuration(source); case 'BarcodeFormatCode39Configuration': return new BarcodeFormatCode39Configuration(source); case 'BarcodeFormatCode93Configuration': return new BarcodeFormatCode93Configuration(source); case 'BarcodeFormatCode128Configuration': return new BarcodeFormatCode128Configuration(source); case 'BarcodeFormatCode2Of5Configuration': return new BarcodeFormatCode2Of5Configuration(source); case 'BarcodeFormatDataBarConfiguration': return new BarcodeFormatDataBarConfiguration(source); case 'BarcodeFormatDataBarExpandedConfiguration': return new BarcodeFormatDataBarExpandedConfiguration(source); case 'BarcodeFormatDataBarLimitedConfiguration': return new BarcodeFormatDataBarLimitedConfiguration(source); case 'BarcodeFormatITFConfiguration': return new BarcodeFormatItfConfiguration(source); case 'BarcodeFormatMSIPlesseyConfiguration': return new BarcodeFormatMsiPlesseyConfiguration(source); case 'BarcodeFormatUpcEanConfiguration': return new BarcodeFormatUpcEanConfiguration(source); case 'BarcodeFormatPharmaCodeConfiguration': return new BarcodeFormatPharmaCodeConfiguration(source); case 'BarcodeFormatAztecConfiguration': return new BarcodeFormatAztecConfiguration(source); case 'BarcodeFormatQRCodeConfiguration': return new BarcodeFormatQrCodeConfiguration(source); case 'BarcodeFormatPDF417Configuration': return new BarcodeFormatPdf417Configuration(source); case 'BarcodeFormatMicroPDF417Configuration': return new BarcodeFormatMicroPdf417Configuration(source); case 'BarcodeFormatDataMatrixConfiguration': return new BarcodeFormatDataMatrixConfiguration(source); case 'BarcodeFormatMaxiCodeConfiguration': return new BarcodeFormatMaxiCodeConfiguration(source); case 'BarcodeFormatAustraliaPostConfiguration': return new BarcodeFormatAustraliaPostConfiguration(source); case 'BarcodeFormatJapanPostConfiguration': return new BarcodeFormatJapanPostConfiguration(source); case 'BarcodeFormatRoyalMailConfiguration': return new BarcodeFormatRoyalMailConfiguration(source); case 'BarcodeFormatRoyalTNTPostConfiguration': return new BarcodeFormatRoyalTntPostConfiguration(source); case 'BarcodeFormatUSPSIntelligentMailConfiguration': return new BarcodeFormatUspsIntelligentMailConfiguration(source); case 'BarcodeFormatPharmaCodeTwoTrackConfiguration': return new BarcodeFormatPharmaCodeTwoTrackConfiguration(source); case 'BarcodeFormatGS1CompositeConfiguration': return new BarcodeFormatGs1CompositeConfiguration(source); case 'BarcodeFormatCommonOneDConfiguration': return new BarcodeFormatCommonOneDConfiguration(source); case 'BarcodeFormatCommonTwoDConfiguration': return new BarcodeFormatCommonTwoDConfiguration(source); case 'BarcodeFormatCommonFourStateConfiguration': return new BarcodeFormatCommonFourStateConfiguration(source); case 'BarcodeFormatCommonConfiguration': return new BarcodeFormatCommonConfiguration(source); default: throw `Unknown child class name: ${_type}`; } } _BarcodeFormatConfigurationBase.From = From; })(BarcodeFormatConfigurationBase || (exports.BarcodeFormatConfigurationBase = BarcodeFormatConfigurationBase = {})); /** Base class for all linear (1D) barcode configurations. */ /** @internal */ let BarcodeFormatOneDConfigurationBase = exports.BarcodeFormatOneDConfigurationBase = void 0; (function (_BarcodeFormatOneDConfigurationBase) { function From(source) { const _type = source._type; switch (_type) { case 'BarcodeFormatCodabarConfiguration': return new BarcodeFormatCodabarConfiguration(source); case 'BarcodeFormatCode11Configuration': return new BarcodeFormatCode11Configuration(source); case 'BarcodeFormatCode39Configuration': return new BarcodeFormatCode39Configuration(source); case 'BarcodeFormatCode93Configuration': return new BarcodeFormatCode93Configuration(source); case 'BarcodeFormatCode128Configuration': return new BarcodeFormatCode128Configuration(source); case 'BarcodeFormatCode2Of5Configuration': return new BarcodeFormatCode2Of5Configuration(source); case 'BarcodeFormatDataBarConfiguration': return new BarcodeFormatDataBarConfiguration(source); case 'BarcodeFormatDataBarExpandedConfiguration': return new BarcodeFormatDataBarExpandedConfiguration(source); case 'BarcodeFormatDataBarLimitedConfiguration': return new BarcodeFormatDataBarLimitedConfiguration(source); case 'BarcodeFormatITFConfiguration': return new BarcodeFormatItfConfiguration(source); case 'BarcodeFormatMSIPlesseyConfiguration': return new BarcodeFormatMsiPlesseyConfiguration(source); case 'BarcodeFormatUpcEanConfiguration': return new BarcodeFormatUpcEanConfiguration(source); case 'BarcodeFormatPharmaCodeConfiguration': return new BarcodeFormatPharmaCodeConfiguration(source); default: throw `Unknown child class name: ${_type}`; } } _BarcodeFormatOneDConfigurationBase.From = From; })(BarcodeFormatOneDConfigurationBase || (exports.BarcodeFormatOneDConfigurationBase = BarcodeFormatOneDConfigurationBase = {})); /** Codabar barcode configuration. Add to scanner configuration to scan Codabar barcodes. */ class BarcodeFormatCodabarConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCodabarConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** If true, return the start and end characters. Default is false */ returnStartEnd = false; /** @param source {@displayType `DeepPartial<BarcodeFormatCodabarConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } if (source.returnStartEnd !== undefined) { this.returnStartEnd = source.returnStartEnd; } } } /** Code 11 barcode configuration. Add to scanner configuration to scan Code 11 barcodes. */ exports.BarcodeFormatCodabarConfiguration = BarcodeFormatCodabarConfiguration; class BarcodeFormatCode11Configuration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCode11Configuration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** If true, return CODE_11 barcodes only if they have a valid checksum. Default is true */ checksum = true; /** @param source {@displayType `DeepPartial<BarcodeFormatCode11Configuration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } if (source.checksum !== undefined) { this.checksum = source.checksum; } } } /** Code 39 barcode and derivatives configuration. Add to scanner configuration to scan Code 39, Code 32 (Italian Pharmacode), PZN7 and PZN8 (Pharmazentralnummer) barcodes. */ exports.BarcodeFormatCode11Configuration = BarcodeFormatCode11Configuration; class BarcodeFormatCode39Configuration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCode39Configuration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** If true, scan and return valid CODE_32 (Italian Pharmacode) barcodes. If false, CODE_32 barcodes are not decoded and are returned as CODE_39 instead. Default is false */ code32 = false; /** If true, scan CODE_39 barcodes. Default is true */ code39 = true; /** If true, scan PZN7 (legacy Pharmazentralnummer) barcodes. If false, PZN7 barcodes are not decoded and are returned as CODE_39 instead. Default is true */ pzn7 = true; /** If true, scan PZN8 (Pharmazentralnummer) barcodes. If false, PZN8 barcodes are not decoded and are returned as CODE_39 instead. Default is true */ pzn8 = true; /** If true, try to scan CODE_39 in extended mode. Default is false */ tryCode39ExtendedMode = false; /** If true, return CODE_39 barcodes only if they have a valid check digit. Default is false */ useCode39CheckDigit = false; /** @param source {@displayType `DeepPartial<BarcodeFormatCode39Configuration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } if (source.code32 !== undefined) { this.code32 = source.code32; } if (source.code39 !== undefined) { this.code39 = source.code39; } if (source.pzn7 !== undefined) { this.pzn7 = source.pzn7; } if (source.pzn8 !== undefined) { this.pzn8 = source.pzn8; } if (source.tryCode39ExtendedMode !== undefined) { this.tryCode39ExtendedMode = source.tryCode39ExtendedMode; } if (source.useCode39CheckDigit !== undefined) { this.useCode39CheckDigit = source.useCode39CheckDigit; } } } /** Code 93 barcode configuration. Add to scanner configuration to scan Code 93 barcodes. */ exports.BarcodeFormatCode39Configuration = BarcodeFormatCode39Configuration; class BarcodeFormatCode93Configuration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCode93Configuration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** @param source {@displayType `DeepPartial<BarcodeFormatCode93Configuration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } } } /** Code 128 barcode configuration. Add to scanner configuration to scan Code 128 barcodes. */ exports.BarcodeFormatCode93Configuration = BarcodeFormatCode93Configuration; class BarcodeFormatCode128Configuration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCode128Configuration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** GS1 message handling options. Default is PARSE */ gs1Handling = 'PARSE'; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** @param source {@displayType `DeepPartial<BarcodeFormatCode128Configuration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.gs1Handling !== undefined) { this.gs1Handling = source.gs1Handling; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } } } /** Configuration for all 2-of-5 barcode types (except Interleaved 2-of-5, which is handled by ItfConfig). Add to scanner configuration to scan Code 25, IATA 2-of-5 and Industrial 2-of-5 barcodes. Industrial 2-of-5 barcodes are a subset of Code 25 barcodes. Any valid Industrial 2-of-5 barcode is also a valid Code 25 barcode. */ exports.BarcodeFormatCode128Configuration = BarcodeFormatCode128Configuration; class BarcodeFormatCode2Of5Configuration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatCode2Of5Configuration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** If true, scan IATA 2-of-5 barcodes. If useIATA2OF5Checksum is true, only barcodes with a valid checksum are returned. Default is true */ iata2of5 = true; /** If true, scan and return Code 25 (Code 2-of-5) barcodes. If industrial2of5 is also true, then valid Industrial 2-of-5 barcodes will preferentially be returned as such, instead of Code 25. Default is false */ code25 = false; /** If true, scan and return valid Industrial 2-of-5 barcodes. If false, but code25 is true, Industrial 2-of-5 barcodes will be returned as Code 25 barcodes. Default is true */ industrial2of5 = true; /** If true, return IATA_2_OF_5 barcodes only if they have a valid check digit. Default is true */ useIATA2OF5Checksum = true; /** @param source {@displayType `DeepPartial<BarcodeFormatCode2Of5Configuration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } if (source.iata2of5 !== undefined) { this.iata2of5 = source.iata2of5; } if (source.code25 !== undefined) { this.code25 = source.code25; } if (source.industrial2of5 !== undefined) { this.industrial2of5 = source.industrial2of5; } if (source.useIATA2OF5Checksum !== undefined) { this.useIATA2OF5Checksum = source.useIATA2OF5Checksum; } } } /** GS1 DataBar barcode configuration. Add to scanner configuration to scan GS1 DataBar-14, GS1 DataBar-14 Truncated, GS1 DataBar-14 Stacked and GS1 DataBar-14 Stacked Omnidirectional barcodes. */ exports.BarcodeFormatCode2Of5Configuration = BarcodeFormatCode2Of5Configuration; class BarcodeFormatDataBarConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatDataBarConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** GS1 message handling options. Default is PARSE */ gs1Handling = 'PARSE'; /** @param source {@displayType `DeepPartial<BarcodeFormatDataBarConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.gs1Handling !== undefined) { this.gs1Handling = source.gs1Handling; } } } /** GS1 DataBar Expanded barcode configuration. Add to scanner configuration to scan GS1 DataBar Expanded and GS1 DataBar Expanded Stacked barcodes. */ exports.BarcodeFormatDataBarConfiguration = BarcodeFormatDataBarConfiguration; class BarcodeFormatDataBarExpandedConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatDataBarExpandedConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** GS1 message handling options. Default is PARSE */ gs1Handling = 'PARSE'; /** @param source {@displayType `DeepPartial<BarcodeFormatDataBarExpandedConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.gs1Handling !== undefined) { this.gs1Handling = source.gs1Handling; } } } /** GS1 DataBar Limited barcode configuration. Add to scanner configuration to scan GS1 DataBar Limited barcodes. */ exports.BarcodeFormatDataBarExpandedConfiguration = BarcodeFormatDataBarExpandedConfiguration; class BarcodeFormatDataBarLimitedConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatDataBarLimitedConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** GS1 message handling options. Default is PARSE */ gs1Handling = 'PARSE'; /** @param source {@displayType `DeepPartial<BarcodeFormatDataBarLimitedConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.gs1Handling !== undefined) { this.gs1Handling = source.gs1Handling; } } } /** ITF (Interleaved 2-of-5) barcode configuration. Add to scanner configuration to scan Interleaved 2-of-5 (ITF) barcodes. */ exports.BarcodeFormatDataBarLimitedConfiguration = BarcodeFormatDataBarLimitedConfiguration; class BarcodeFormatItfConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatITFConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** @param source {@displayType `DeepPartial<BarcodeFormatItfConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } } } /** Checksum algorithm for MSI_PLESSEY. - `MOD_10`: Modulo 10. - `MOD_11_IBM`: Modulo 11 IBM. - `MOD_11_NCR`: Modulo 11 NCR. - `MOD_10_10`: Modulo 1010. - `MOD_11_10_IBM`: Modulo 1110 IBM. - `MOD_11_10_NCR`: Modulo 1110 NCR. */ exports.BarcodeFormatItfConfiguration = BarcodeFormatItfConfiguration; const MsiPlesseyChecksumAlgorithmValues = exports.MsiPlesseyChecksumAlgorithmValues = ['MOD_10', 'MOD_11_IBM', 'MOD_11_NCR', 'MOD_10_10', 'MOD_11_10_IBM', 'MOD_11_10_NCR']; /** MSI Plessey barcode configuration. Add to scanner configuration to scan MSI Plessey barcodes. */ class BarcodeFormatMsiPlesseyConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatMSIPlesseyConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** Minimum text length. Applied only to linear barcode formats that allow variable length. Default is 1 */ minimumTextLength = 1; /** Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length. Default is 0 */ maximumTextLength = 0; /** List of MSI Plessey checksum algorithms to apply during scanning. A barcode is considered valid if it passes any of the checksum algorithms in the list. If the list is empty, no checksum validation is performed. */ checksumAlgorithms = ['MOD_10']; /** @param source {@displayType `DeepPartial<BarcodeFormatMsiPlesseyConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.minimumTextLength !== undefined) { this.minimumTextLength = source.minimumTextLength; } if (source.maximumTextLength !== undefined) { this.maximumTextLength = source.maximumTextLength; } if (source.checksumAlgorithms !== undefined) { this.checksumAlgorithms = source.checksumAlgorithms.map(it => { return it; }); } } } /** UPC/EAN barcode configuration. Add to scanner configuration to scan EAN-8, EAN-13, UPC-E and UPC-A barcodes. */ exports.BarcodeFormatMsiPlesseyConfiguration = BarcodeFormatMsiPlesseyConfiguration; class BarcodeFormatUpcEanConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatUpcEanConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** If true, the check digits are stripped from the result. Default is false */ stripCheckDigits = false; /** If true, scan and return valid EAN-8 barcodes. Default is true */ ean8 = true; /** If true, scan and return valid EAN-13 barcodes. Default is true */ ean13 = true; /** If true, scan and return valid UPC-A barcodes. If false, but ean13 is true, then UPC-A barcodes will be returned as EAN-13 barcodes. Default is true */ upca = true; /** If true, scan and return valid UPC-E barcodes. Default is true */ upce = true; /** Behavior when scanning UPC/EAN barcodes with EAN-2 or EAN-5 extensions. Default is ALLOW_ANY */ extensions = 'ALLOW_ANY'; /** @param source {@displayType `DeepPartial<BarcodeFormatUpcEanConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.stripCheckDigits !== undefined) { this.stripCheckDigits = source.stripCheckDigits; } if (source.ean8 !== undefined) { this.ean8 = source.ean8; } if (source.ean13 !== undefined) { this.ean13 = source.ean13; } if (source.upca !== undefined) { this.upca = source.upca; } if (source.upce !== undefined) { this.upce = source.upce; } if (source.extensions !== undefined) { this.extensions = source.extensions; } } } /** PharmaCode barcode configuration. Add to scanner configuration to scan linear (1D) Laetus Pharmacode barcodes. Two-track PharmaCode scanning is configured separately through the PharmaCodeTwoTrackConfig class. */ exports.BarcodeFormatUpcEanConfiguration = BarcodeFormatUpcEanConfiguration; class BarcodeFormatPharmaCodeConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatPharmaCodeConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** Minimum quiet zone size on the left and right sides of a 1D barcode, measured in number of modules. The quiet zone is only for 1D barcodes with weak start/stop patterns, i.e. Iata2Of5, Industrial2Of5, Code25, Itf, Codabar, MsiPlessey and Code11. Default is 6 */ minimum1DQuietZoneSize = 6; /** Minimum value for PharmaCode. Very low values are likely to produce more false positives. Default is 16 */ minimumValue = 16; /** If true, a result consisting of only narrow bars is accepted as valid. The specification does not recommend such barcodes. Default is false. Default is false */ allowNarrowBarsOnly = false; /** If true, a result consisting of only wide bars is accepted as valid. The specification does not recommend such barcodes. Default is false. Default is false */ allowWideBarsOnly = false; /** @param source {@displayType `DeepPartial<BarcodeFormatPharmaCodeConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScore = source.minimumSizeScore; } if (source.addAdditionalQuietZone !== undefined) { this.addAdditionalQuietZone = source.addAdditionalQuietZone; } if (source.minimum1DQuietZoneSize !== undefined) { this.minimum1DQuietZoneSize = source.minimum1DQuietZoneSize; } if (source.minimumValue !== undefined) { this.minimumValue = source.minimumValue; } if (source.allowNarrowBarsOnly !== undefined) { this.allowNarrowBarsOnly = source.allowNarrowBarsOnly; } if (source.allowWideBarsOnly !== undefined) { this.allowWideBarsOnly = source.allowWideBarsOnly; } } } /** Base class for all 2D barcode configurations. */ exports.BarcodeFormatPharmaCodeConfiguration = BarcodeFormatPharmaCodeConfiguration; /** @internal */ let BarcodeFormatTwoDConfigurationBase = exports.BarcodeFormatTwoDConfigurationBase = void 0; (function (_BarcodeFormatTwoDConfigurationBase) { function From(source) { const _type = source._type; switch (_type) { case 'BarcodeFormatAztecConfiguration': return new BarcodeFormatAztecConfiguration(source); case 'BarcodeFormatQRCodeConfiguration': return new BarcodeFormatQrCodeConfiguration(source); case 'BarcodeFormatPDF417Configuration': return new BarcodeFormatPdf417Configuration(source); case 'BarcodeFormatMicroPDF417Configuration': return new BarcodeFormatMicroPdf417Configuration(source); case 'BarcodeFormatDataMatrixConfiguration': return new BarcodeFormatDataMatrixConfiguration(source); case 'BarcodeFormatMaxiCodeConfiguration': return new BarcodeFormatMaxiCodeConfiguration(source); default: throw `Unknown child class name: ${_type}`; } } _BarcodeFormatTwoDConfigurationBase.From = From; })(BarcodeFormatTwoDConfigurationBase || (exports.BarcodeFormatTwoDConfigurationBase = BarcodeFormatTwoDConfigurationBase = {})); /** Aztec configuration. Add to scanner configuration to scan Aztec codes. */ class BarcodeFormatAztecConfiguration extends _utils.PartiallyConstructible { _type = 'BarcodeFormatAztecConfiguration'; /** Regular expression filter for barcode text. If the barcode text does not match the regular expression, it will not be scanned. The default is an empty string (setting is turned off). Default is "" */ regexFilter = ''; /** Minimum acceptable value of a result BarcodeItem's sizeScore (between 0 and 1). Barcodes with a sizeScore less than this value will not be scanned. When set to 0, barcodes are returned no matter what their size is. Default is 0 */ minimumSizeScore = 0.0; /** If true, we process the barcode scanning with an artificial quiet zone that we add to the input image. This flag should be used to scan sharp crops of a barcode in single-shot mode. Default is false */ addAdditionalQuietZone = false; /** GS1 message handling options. Default is PARSE */ gs1Handling = 'PARSE'; /** @param source {@displayType `DeepPartial<BarcodeFormatAztecConfiguration>`} */ constructor(source = {}) { super(); if (source.regexFilter !== undefined) { this.regexFilter = source.regexFilter; } if (source.minimumSizeScore !== undefined) { this.minimumSizeScor