capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
121 lines • 5.32 kB
JavaScript
import { PartiallyConstructible } from '../../utils';
/**
Configuration of the scanning behavior.
*/
export class BarcodeRecognizerConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<BarcodeRecognizerConfiguration>`} */
constructor(source = {}) {
super();
/**
List of accepted barcode document formats.
*/
this.acceptedDocumentFormats = [];
/**
Filter for extended EAN and UPC barcodes.
Default is NO_FILTER
*/
this.barcodesExtensionFilter = 'NO_FILTER';
/**
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). This option overrides `barcodesExtensionFilter` option.
Default is ""
*/
this.barcodesRegexFilter = '';
/**
Optional minimum required text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only.
Default is 0
*/
this.minimumTextLength = 0;
/**
Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only.
Default is 0
*/
this.maximumTextLength = 0;
/**
Optional minimum required quiet zone on the barcode. Measured in modules (the smallest bar size on a barcode). The default is 10. NOTE - This feature works on ITF barcodes only.
Default is 10
*/
this.minimum1DBarcodesQuietZone = 10;
/**
If `true`, check digits for UPC, EAN and MSI Plessey codes are removed from the result. Has no effect if both single and double digit MSI Plessey checksums are enabled. The default is `false`.
Default is false
*/
this.stripCheckDigits = false;
/**
If `true`, the optional check digit for IATA_2_OF_5 codes is used in validation. The default is `true`.
Default is true
*/
this.useIATA2OF5Checksum = true;
/**
If `true`, the optional check digit for CODE_11 codes is used in validation. The default is `true`.
Default is true
*/
this.useCode11Checksum = true;
/**
List of accepted barcode symbologies.
*/
this.barcodeFormats = [];
/**
Checksum algorithm used for MSI Plessey barcodes. The default value is MOD_10.
Default is MOD_10
*/
this.msiPlesseyChecksumAlgorithm = 'MOD_10';
/**
The customer format used in AUSTRALIA_POST codes. The default value is ALPHA_NUMERIC.
Default is ALPHA_NUMERIC
*/
this.australiaPostCustomerFormat = 'ALPHA_NUMERIC';
/**
If `true`, enables a mode that slightly decreases scanning quality and energy consumption. Increases scanning speed. If `false`, the mode is disabled. The default is `false`. Android only.
Default is false
*/
this.lowPowerMode = false;
/**
The expected way of handling GS1_COMPOSITE barcodes.
Default is PARSE
*/
this.gs1Handling = 'PARSE';
if (source.acceptedDocumentFormats !== undefined) {
this.acceptedDocumentFormats = source.acceptedDocumentFormats.map(it => it);
}
if (source.barcodesExtensionFilter !== undefined) {
this.barcodesExtensionFilter = source.barcodesExtensionFilter;
}
if (source.barcodesRegexFilter !== undefined) {
this.barcodesRegexFilter = source.barcodesRegexFilter;
}
if (source.minimumTextLength !== undefined) {
this.minimumTextLength = source.minimumTextLength;
}
if (source.maximumTextLength !== undefined) {
this.maximumTextLength = source.maximumTextLength;
}
if (source.minimum1DBarcodesQuietZone !== undefined) {
this.minimum1DBarcodesQuietZone = source.minimum1DBarcodesQuietZone;
}
if (source.stripCheckDigits !== undefined) {
this.stripCheckDigits = source.stripCheckDigits;
}
if (source.useIATA2OF5Checksum !== undefined) {
this.useIATA2OF5Checksum = source.useIATA2OF5Checksum;
}
if (source.useCode11Checksum !== undefined) {
this.useCode11Checksum = source.useCode11Checksum;
}
if (source.barcodeFormats !== undefined) {
this.barcodeFormats = source.barcodeFormats.map(it => it);
}
if (source.msiPlesseyChecksumAlgorithm !== undefined) {
this.msiPlesseyChecksumAlgorithm = source.msiPlesseyChecksumAlgorithm;
}
if (source.australiaPostCustomerFormat !== undefined) {
this.australiaPostCustomerFormat = source.australiaPostCustomerFormat;
}
if (source.lowPowerMode !== undefined) {
this.lowPowerMode = source.lowPowerMode;
}
if (source.gs1Handling !== undefined) {
this.gs1Handling = source.gs1Handling;
}
}
}
//# sourceMappingURL=BarcodeRecognizerConfiguration.js.map