capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
1,136 lines (1,049 loc) • 607 kB
JavaScript
var capacitorScanbotSDKCapacitor = (function (exports, core) {
'use strict';
class PartiallyConstructible {
/** @internal */
_marker() { }
}
/** @internal */
function mapRTUUIResult(result, LClass) {
if (result.status === 'OK') {
return Object.assign(Object.assign({}, result), { data: new LClass(result.data) });
}
else {
return result;
}
}
/** @internal */
function mapPlainResult(jsObject) {
return jsObject.result;
}
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
}
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from core/schemas/JSONSerializationTypes.yaml
/**
Configuration used to serialize an object to json.
*/
class ToJsonConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<ToJsonConfiguration>`} */
constructor(source = {}) {
super();
/**
Serialize images in the object to json. If false, then fields that contain images are not serialized.
Default is true
*/
this.serializeImages = true;
/**
Image serialization mode.
Default is REFERENCE
*/
this.imageSerializationMode = 'REFERENCE';
if (source.serializeImages !== undefined) {
this.serializeImages = source.serializeImages;
}
if (source.imageSerializationMode !== undefined) {
this.imageSerializationMode = source.imageSerializationMode;
}
}
serialize(config = new ToJsonConfiguration()) {
return {
serializeImages: this.serializeImages,
imageSerializationMode: this.imageSerializationMode,
};
}
}
const ImageSerializationModeValues = ['REFERENCE', 'BUFFER'];
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from native/schemas/analytics/Analytics.yaml
/**
The feature that is being tracked.
*/
class AnalyticsFeature extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<AnalyticsFeature>`} */
constructor(source = {}) {
super();
}
serialize(config = new ToJsonConfiguration()) {
return {};
}
}
(function (AnalyticsFeature) {
/**
The document scanner feature.
Default is "rtuui_document_scanner"
*/
AnalyticsFeature.documentScanner = 'rtuui_document_scanner';
})(AnalyticsFeature || (AnalyticsFeature = {}));
/**
The category that is being tracked.
*/
class AnalyticsCategory extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<AnalyticsCategory>`} */
constructor(source = {}) {
super();
}
serialize(config = new ToJsonConfiguration()) {
return {};
}
}
(function (AnalyticsCategory) {
/**
The acknowledge category.
Default is "acknowledge"
*/
AnalyticsCategory.acknowledge = 'acknowledge';
})(AnalyticsCategory || (AnalyticsCategory = {}));
/**
The event that is being tracked.
*/
class AnalyticsEvent extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<AnalyticsEvent>`} */
constructor(source = {}) {
super();
/**
The value associated with the event.
*/
this.values = [];
if (source.feature !== undefined) {
this.feature = source.feature;
}
else {
throw new Error('feature must be present in constructor argument');
}
if (source.category !== undefined) {
this.category = source.category;
}
else {
throw new Error('category must be present in constructor argument');
}
if (source.name !== undefined) {
this.name = source.name;
}
else {
throw new Error('name must be present in constructor argument');
}
if (source.values !== undefined) {
this.values = source.values.map((it) => {
return it;
});
}
}
serialize(config = new ToJsonConfiguration()) {
return {
feature: this.feature,
category: this.category,
name: this.name,
values: this.values.map((it) => {
return it;
}),
};
}
}
/**
The name of the event.
*/
class AnalyticsEventName extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<AnalyticsEventName>`} */
constructor(source = {}) {
super();
}
serialize(config = new ToJsonConfiguration()) {
return {};
}
}
(function (AnalyticsEventName) {
/**
The image quality result event for imported page.
Default is "imported_image_quality_result"
*/
AnalyticsEventName.importedImageQualityResult = 'imported_image_quality_result';
/**
The image quality result event for scanned page.
Default is "scanned_image_quality_result"
*/
AnalyticsEventName.scannedImageQualityResult = 'scanned_image_quality_result';
/**
The proceed event.
Default is "proceed_with_image"
*/
AnalyticsEventName.proceedImage = 'proceed_with_image';
/**
The retake event.
Default is "retake_image"
*/
AnalyticsEventName.retakeImage = 'retake_image';
})(AnalyticsEventName || (AnalyticsEventName = {}));
/**
A predefined analytics event.
*/
class AnalyticsEventFactory extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<AnalyticsEventFactory>`} */
constructor(source = {}) {
super();
}
serialize(config = new ToJsonConfiguration()) {
return {};
}
}
(function (AnalyticsEventFactory) {
/**
A predefined analytics event.
*/
AnalyticsEventFactory.scannedImageQualityResult = new AnalyticsEvent({
feature: 'rtuui_document_scanner',
category: 'acknowledge',
name: 'scanned_image_quality_result',
});
/**
A predefined analytics event.
*/
AnalyticsEventFactory.importedImageQualityResult = new AnalyticsEvent({
feature: 'rtuui_document_scanner',
category: 'acknowledge',
name: 'imported_image_quality_result',
});
/**
A predefined analytics event.
*/
AnalyticsEventFactory.proceedWithImage = new AnalyticsEvent({
feature: 'rtuui_document_scanner',
category: 'acknowledge',
name: 'proceed_with_image',
});
/**
A predefined analytics event.
*/
AnalyticsEventFactory.retakeImage = new AnalyticsEvent({
feature: 'rtuui_document_scanner',
category: 'acknowledge',
name: 'retake_image',
});
})(AnalyticsEventFactory || (AnalyticsEventFactory = {}));
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from core/schemas/BarcodeConfigurationTypes.yaml
/** @internal */
exports.BarcodeFormatConfigurationBase = void 0;
(function (BarcodeFormatConfigurationBase) {
/** @internal */
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;
})(exports.BarcodeFormatConfigurationBase || (exports.BarcodeFormatConfigurationBase = {}));
/** @internal */
exports.BarcodeFormatOneDConfigurationBase = void 0;
(function (BarcodeFormatOneDConfigurationBase) {
/** @internal */
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;
})(exports.BarcodeFormatOneDConfigurationBase || (exports.BarcodeFormatOneDConfigurationBase = {}));
/**
Codabar barcode configuration. Add to scanner configuration to scan Codabar barcodes.
*/
class BarcodeFormatCodabarConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCodabarConfiguration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.maximumTextLength = 0;
/**
If true, return the start and end characters.
Default is false
*/
this.returnStartEnd = false;
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.
*/
class BarcodeFormatCode11Configuration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCode11Configuration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
If true, the check digits are stripped from the result.
Default is false
*/
this.stripCheckDigits = false;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.maximumTextLength = 0;
/**
If true, return CODE_11 barcodes only if they have a valid checksum.
Default is true
*/
this.checksum = true;
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.
*/
class BarcodeFormatCode39Configuration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCode39Configuration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
If true, the check digits are stripped from the result.
Default is false
*/
this.stripCheckDigits = false;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.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
*/
this.code32 = false;
/**
If true, scan CODE_39 barcodes.
Default is true
*/
this.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
*/
this.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
*/
this.pzn8 = true;
/**
If true, try to scan CODE_39 in extended mode.
Default is false
*/
this.tryCode39ExtendedMode = false;
/**
If true, return CODE_39 barcodes only if they have a valid check digit.
Default is false
*/
this.useCode39CheckDigit = false;
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.
*/
class BarcodeFormatCode93Configuration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCode93Configuration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
If true, the check digits are stripped from the result.
Default is false
*/
this.stripCheckDigits = false;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.maximumTextLength = 0;
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.
*/
class BarcodeFormatCode128Configuration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCode128Configuration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
GS1 message handling options.
Default is PARSE
*/
this.gs1Handling = 'PARSE';
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.maximumTextLength = 0;
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.
*/
class BarcodeFormatCode2Of5Configuration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatCode2Of5Configuration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
If true, the check digits are stripped from the result.
Default is false
*/
this.stripCheckDigits = false;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;
/**
Maximum text length. 0 implies no maximum. Applied only to linear barcode formats that allow variable length.
Default is 0
*/
this.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
*/
this.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
*/
this.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
*/
this.industrial2of5 = true;
/**
If true, return IATA_2_OF_5 barcodes only if they have a valid check digit.
Default is true
*/
this.useIATA2OF5Checksum = true;
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.
*/
class BarcodeFormatDataBarConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatDataBarConfiguration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
GS1 message handling options.
Default is PARSE
*/
this.gs1Handling = 'PARSE';
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.
*/
class BarcodeFormatDataBarExpandedConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatDataBarExpandedConfiguration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
GS1 message handling options.
Default is PARSE
*/
this.gs1Handling = 'PARSE';
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.
*/
class BarcodeFormatDataBarLimitedConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatDataBarLimitedConfiguration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
GS1 message handling options.
Default is PARSE
*/
this.gs1Handling = 'PARSE';
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.
*/
class BarcodeFormatItfConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeFormatItfConfiguration>`} */
constructor(source = {}) {
super();
this._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 ""
*/
this.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
*/
this.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
*/
this.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
*/
this.minimum1DQuietZoneSize = 6;
/**
Minimum text length. Applied only to linear barcode formats that allow variable length.
Default is 1
*/
this.minimumTextLength = 1;