UNPKG

react-native-scanbot-sdk

Version:

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

271 lines (257 loc) 8.54 kB
import { PartiallyConstructible } from '../../utils'; /** The customer format used in AUSTRALIA_POST codes. Only relevant for format codes 59 and 62. - `NUMERIC`: The numeric format. - `ALPHA_NUMERIC`: The alphanumeric format. */ /** Type of MSI plessey checksum algorithm used. - `NONE`: No checksum algorithm used. - `MOD_10`: Mod10 checksum algorithm - `MOD_11_IBM`: Mod11IBM checksum algorithm - `MOD_11_NCR`: Mod11NCR checksum algorithm - `MOD_1010`: Mod1010 checksum algorithm - `MOD_1110_IBM`: Mod1110IBM checksum algorithm - `MOD_1110_NCR`: Mod1110NCR checksum algorithm */ /** GS1_COMPOSITE barcode type handling - `NONE`: The (FNC1) character is simply stripped from the result in barcodes that implement this mode. Do not use. Will be removed in a future release. - `PARSE`: GS1 messages are converted to the machine-readable format per the GS1 spec (the special FNC1 character is converted to ASCII \x1D). The implied 01 AI key is prepended to DataBar results. No validation is performed. - `VALIDATE_STRUCTURE`: Same as PARSE. Additionally, messages containing unknown AI keys, or containing values of incorrect format for known keys, are not returned. - `DECODE_STRUCTURE`: Same as VALIDATE_STRUCTURE, except that GS1 strings are converted to the human-readable format, instead (with parentheses used to wrap AI keys, e.g. (01)123456789). The \x1D character is never used in this representation. - `VALIDATE_FULL`: Full validation including linting and checksums. This is the most strict mode. - `DECODE_FULL`: Same as DECODE_STRUCTURE, but with full validation. */ /** Type of barcode document format used. - `AAMVA`: American Association of Motor Vehicle Administrators barcode document - `BOARDING_PASS`: Boarding pass barcode document - `DE_MEDICAL_PLAN`: German medication plan barcode document - `MEDICAL_CERTIFICATE`: German medical certificate barcode document - `ID_CARD_PDF_417`: ID card barcode document - `SEPA`: SEPA barcode (aka GiroCode) document - `SWISS_QR`: Swiss QR barcode document - `VCARD`: VCard barcode document - `GS1`: GS1 barcode document */ /** Barcode symbology used. - `AZTEC`: Aztec barcode type - `CODABAR`: Codabar barcode type - `CODE_25`: Code 25 barcode type - `CODE_39`: Code 39 barcode type - `CODE_93`: Code 93 barcode type - `CODE_128`: Code 128 barcode type - `DATA_MATRIX`: Data Matrix barcode type - `EAN_8`: EAN-8 barcode type - `EAN_13`: EAN-13 barcode type - `ITF`: ITF (Interleaved 2 of 5) barcode type - `PDF_417`: PDF417 barcode type - `QR_CODE`: QR Code barcode type - `MICRO_QR_CODE`: Micro QR Code barcode type - `DATABAR`: Databar barcode type - `DATABAR_EXPANDED`: Databar Expanded barcode type - `UPC_A`: UPC-A barcode type - `UPC_E`: UPC-E barcode type - `MSI_PLESSEY`: MSI Plessey barcode type - `IATA_2_OF_5`: IATA 2 of 5 barcode type - `INDUSTRIAL_2_OF_5`: Industrial 2 of 5 barcode type - `USPS_INTELLIGENT_MAIL`: USPS Intelligent Mail (aka USPS OneCode, USPS-STD-11) - `ROYAL_MAIL`: Royal Mail Four-State Customer Code, (aka RM4SCC, CBC, BPO 4 State Code) - `JAPAN_POST`: Japan Post Four-State Barcode - `ROYAL_TNT_POST`: Royal TNT Post Four-State Barcode (aka KIX, Klant IndeX) - `AUSTRALIA_POST`: Australia Post Four-State Customer Code - `DATABAR_LIMITED`: GS1 DataBar Limited - `GS1_COMPOSITE`: GS1 Composite - `MICRO_PDF_417`: Databar micro pdf 417 - `MAXI_CODE`: Maxicode - `RMQR_CODE`: RMQR code - `CODE_11`: Code 11 barcode type - `CODE_32`: Code 32 barcode type */ /** Filter for extended EAN and UPC barcodes. - `NO_FILTER`: EAN and UPC codes are not filtered. Both are returned regardless if they have an extension or not. - `ONLY_WITH_EXTENSIONS`: Only EAN and UPC codes with extensions are returned. - `ONLY_WITHOUT_EXTENSIONS`: Only EAN and UPC codes without extensions are returned. */ /** Configuration of the scanning behavior. */ export class BarcodeRecognizerConfiguration extends PartiallyConstructible { /** List of accepted barcode document formats. */ acceptedDocumentFormats = []; /** Filter for extended EAN and UPC barcodes. Default is NO_FILTER */ 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 "" */ 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 */ 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 */ 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 */ 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 */ 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 */ useIATA2OF5Checksum = true; /** If `true`, the optional check digit for CODE_11 codes is used in validation. The default is `true`. Default is true */ useCode11Checksum = true; /** List of accepted barcode symbologies. */ barcodeFormats = []; /** Checksum algorithm used for MSI Plessey barcodes. The default value is MOD_10. Default is MOD_10 */ msiPlesseyChecksumAlgorithm = 'MOD_10'; /** The customer format used in AUSTRALIA_POST codes. The default value is ALPHA_NUMERIC. Default is ALPHA_NUMERIC */ 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 */ lowPowerMode = false; /** The expected way of handling GS1_COMPOSITE barcodes. Default is PARSE */ gs1Handling = 'PARSE'; /** @param source {@displayType `DeepPartial<BarcodeRecognizerConfiguration>`} */ constructor(source = {}) { super(); 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