react-native-scanbot-barcode-scanner-sdk
Version:
Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS
430 lines (364 loc) • 14.7 kB
text/typescript
import { GenericDocument } from './documents/GenericDocument';
/** The Barcode Scanner Result Field */
export interface BarcodeResultField {
/** The recognized barcode type */
type: BarcodeFormat;
/** The recognized barcode text */
text: string;
/** The recognized barcode text with extension (if available) */
textWithExtension: string;
/** The array of raw bytes that compose the recognized barcode */
rawBytes: number[];
/** True if the Barcode Document has been parsed successfully */
parsedSuccessful: boolean;
/** The parsed known document format (if parsed successfully). */
formattedResult?: GenericDocument;
}
/** Barcode document format */
export type BarcodeDocumentFormat =
/** American Association of Motor Vehicle Administrators barcode document */
| 'AAMVA'
/** Boarding pass barcode document */
| 'BOARDING_PASS'
/** German medical plan barcode document */
| 'DE_MEDICAL_PLAN'
/** German medical certificate barcode document */
| 'MEDICAL_CERTIFICATE'
/** ID Card barcode document */
| 'ID_CARD_PDF_417'
/** SEPA barcode document */
| 'SEPA'
/** Swiss QR barcode document */
| 'SWISS_QR'
/** VCard barcode document */
| 'VCARD'
/** GS1 barcode document */
| 'GS1';
/** Barcode document format */
export type BarcodeFormat =
/** Aztec barcode type */
| 'AZTEC'
/** CODABAR barcode type */
| 'CODABAR'
/** CODE_25 barcode type */
| 'CODE_25'
/** CODE_39 barcode type */
| 'CODE_39'
/** CODE_93 barcode type */
| 'CODE_93'
/** CODE_128 barcode type */
| 'CODE_128'
/** DATA_MATRIX barcode type */
| 'DATA_MATRIX'
/** EAN_8 barcode type */
| 'EAN_8'
/** EAN_13 barcode type */
| 'EAN_13'
/** ITF barcode type */
| 'ITF'
/** PDF_417 barcode type */
| 'PDF_417'
/** QR_CODE barcode type */
| 'QR_CODE'
/** MICRO_QR_CODE barcode type */
| 'MICRO_QR_CODE'
/** DATABAR barcode type */
| 'DATABAR'
/** DATABAR_EXPANDED barcode type */
| 'DATABAR_EXPANDED'
/** UPC_A barcode type */
| 'UPC_A'
/** UPC_E barcode type */
| 'UPC_E'
/** MSI Plessey barcode type */
| 'MSI_PLESSEY'
/** IATA (2 of 5) barcode type */
| 'IATA_2_OF_5'
/** INDUSTRIAL (2 of 5) barcode type */
| 'INDUSTRIAL_2_OF_5'
/** USPS Intelligent Mail, a.k.a. USPS OneCode, USPS-STD-11 */
| 'USPS_INTELLIGENT_MAIL'
/** Royal Mail Four-State Customer Code, a.k.a. RM4SCC, CBC, BPO 4 State Code */
| 'ROYAL_MAIL'
/** Japan Post Four-State Barcode */
| 'JAPAN_POST'
/** Royal TNT Post Four-State Barcode, a.k.a. KIX, Klant IndeX */
| 'ROYAL_TNT_POST'
/** Australia Post Four-State Customer Code */
| 'AUSTRALIA_POST'
/** GS1 DataBar Limited */
| 'DATABAR_LIMITED'
/** GS1 DataBar Composite */
| 'GS1_COMPOSITE'
/** Micro pdf 417 */
| 'MICRO_PDF_417'
/** Maxicode */
| 'MAXI_CODE'
/** rMQR Code */
| 'RMQR_CODE'
/** Code 11 */
| 'CODE_11'
/** Code 32 */
| 'CODE_32';
/** A filter for extended EAN and UPC barcodes. */
export type BarcodesExtensionFilter =
/** EAN and UPC codes are not filtered. Both are returned regardless if they have an extension or not. */
| 'NO_FILTER'
/** Only EAN and UPC codes with extensions are returned. */
| 'ONLY_WITH_EXTENSIONS'
/** Only EAN and UPC codes without extensions are returned. */
| 'ONLY_WITHOUT_EXTENSIONS';
/** Camera module to use */
export type CameraModule =
/** Front camera */
| 'FRONT'
/** Back camera */
| 'BACK'
/** The back camera with the widest available lens. iOS only. */
| 'BACK_WIDEST';
/** MSI plessey checksum algorithm */
export type MSIPlesseyChecksumAlgorithm =
/** Not use checksum */
| 'NONE'
/** Mod10 checksum algorithm */
| 'MOD_10'
/** Mod11IBM checksum algorithm */
| 'MOD_11_IBM'
/** Mod11NCR checksum algorithm */
| 'MOD_11_NCR'
/** Mod1010 checksum algorithm */
| 'MOD_1010'
/** Mod1110IBM checksum algorithm */
| 'MOD_1110_IBM'
/** Mod1110NCR checksum algorithm */
| 'MOD_1110_NCR';
/** The customer format used in AUSTRALIA_POST codes. Only relevant for format codes 59 and 62. */
export type AustraliaPostCustomerFormat =
/** The numeric format. */
| 'NUMERIC'
/** The alphanumeric format. */
| 'ALPHA_NUMERIC';
/** Barcode scanner engine mode */
export type EngineMode =
/** Recommended barcode scanning mode. Used by default */
| 'NEXT_GEN'
/** Legacy barcode scanning mode. */
| 'LEGACY';
/** Applied interface orientation */
export type OrientationLockMode =
/** Do not restrict interface orientation */
| 'NONE'
/** Portrait screen orientations only */
| 'PORTRAIT'
/** Landscape screen orientations only */
| 'LANDSCAPE';
/** Finder aspect ratio */
export interface AspectRatio {
/** The width component of the aspect ratio. */
width: number;
/** The height component of the aspect ratio. */
height: number;
}
/** Standard size object */
export interface Size {
/** Width parameter */
width: number;
/** Height parameter */
height: number;
}
/** Represents camera preview modes */
export type CameraPreviewMode =
/** In this mode camera preview frames will be downscaled to the layout view size - full preview frame content will be visible, but unused edges could be appeared in the preview layout. */
| 'FIT_IN'
/** In this mode camera preview frames fill the layout view - the preview frames may contain additional content on the edges that was not visible in the preview layout. */
| 'FILL_IN';
/** Barcode scanner engine mode */
export type BarcodeOverlayTextFormat =
/** Show only barcode overlay frame. */
| 'NONE'
/** Show barcode value with extention. */
| 'CODE'
/** Show barcode value with barcode format. */
| 'CODE_AND_TYPE';
/** GS1 handling mode */
export type Gs1HandlingMode =
/** 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. */
| 'NONE'
/** 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. */
| 'PARSE'
/** Same as PARSE. Additionally, messages containing unknown AI keys, or containing values of incorrect format for known keys, are not returned. */
| 'VALIDATE_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. */
| 'DECODE_STRUCTURE'
/** Full validation including linting and checksums. This is the most strict mode. */
| 'VALIDATE_FULL'
/** Same as DECODE_STRUCTURE, but with full validation. */
| 'DECODE_FULL';
/** Barcode Selection Overlay configuration */
export interface SelectionOverlayConfiguration {
/** Whether the barcode selection overlay is enabled or not. */
overlayEnabled: boolean;
/** Whether the barcode is selected automatically when being detected or not. */
automaticSelectionEnabled: boolean;
/** Define the way of how to show barcode data with selection overlay. */
textFormat: BarcodeOverlayTextFormat;
/** The color of the polygon in the selection overlay. */
polygonColor: string;
/** The color of the text in the selection overlay. */
textColor: string;
/** The color of the texts background in the selection overlay. */
textContainerColor: string;
/** The color of the polygon in the selection overlay, when highlighted. */
highlightedPolygonColor: string;
/** The color of the text in the selection overlay, when highlighted. */
highlightedTextColor: string;
/** The color of the texts background in the selection overlay, when highlighted. */
highlightedTextContainerColor: string;
}
/** Confirmation Dialog configuration */
export interface ConfirmationDialogConfiguration {
/** Defines, if the confirmation dialog should be displayed or not before returing the results to the delegate. Defaults to False. */
resultWithConfirmationEnabled: boolean;
/** The text format of the result dialog. Defaults to TYPE_AND_CODE. */
dialogTextFormat: BarcodeDialogFormat;
/** The style of the confirmation dialog. iOS only. */
confirmationDialogStyle: DialogStyle;
/** The title of the confirmation dialog confirm button. */
confirmButtonTitle: string;
/** The style of the confirmation dialogs confirm button. iOS only. */
confirmationDialogConfirmButtonStyle: DialogButtonStyle;
/** The title of the confirmation dialog retry button. */
retryButtonTitle: string;
/** The style of the confirmation dialogs retry button. iOS only. */
confirmationDialogRetryButtonStyle: DialogButtonStyle;
/** The title of the confirmation dialog. */
dialogTitle: string;
/** The message text of the confirmation dialog. */
dialogMessage: string;
/** The accent color of buttons on a confirmation dialog. Android only. */
dialogButtonsAccentColor: string;
/** Allows to set if the confirm button should be filled. Defaults to TRUE. Android only. */
confirmButtonFilled: boolean;
/** Allows to set a text color of the filled button. See `confirmationDialogConfirmButtonFilled`. Android only. */
confirmButtonFilledTextColor: string;
}
/** The font name and size. iOS only. */
export interface Font {
/** The font name. defaults to SYSTEM. */
fontName: string;
/** The font size. defaults 17.0 . */
fontSize: number;
}
/** The blur effect style. iOS only. */
export type BlurEffect =
/** The area of the view is lighter than the underlying view. */
| 'EXTRA_LIGHT'
/** The area of the view is the same approximate lightness of the underlying view. */
| 'LIGHT'
/** The area of the view is darker than the underlying view. */
| 'DARK'
/** A regular blur style that adapts to the user interface style. */
| 'REGULAR'
/** A blur style for making content more prominent that adapts to the user interface style. */
| 'PROMINENT'
/** An adaptable blur effect that creates the appearance of an ultra-thin material. iOS13+. */
| 'SYSTEM_ULTRA_THIN_MATERIAL'
/** An adaptable blur effect that creates the appearance of a thin material. iOS13+. */
| 'SYSTEM_THIN_MATERIAL'
/** An adaptable blur effect that create the appearance of a material with normal thickness. Defaults on iOS13 and more. iOS13+. */
| 'SYSTEM_MATERIAL'
/** An adaptable blur effect that creates the appearance of a material that's thicker than normal. iOS13+. */
| 'SYSTEM_THICK_MATERIAL'
/** An adaptable blur effect that creates the appearance of the system chrome. iOS13+. */
| 'SYSTEM_CHROME_MATERIAL'
/** A blur effect that creates the appearance of an ultra-thin material and is always light. iOS13+. */
| 'SYSTEM_ULTRA_THIN_MATERIAL_LIGHT'
/** A blur effect that creates the appearance of a thin material and is always light. iOS13+. */
| 'SYSTEM_THIN_MATERIAL_LIGHT'
/** A blur effect that creates the appearance of a material with normal thickness and is always light. iOS13+. */
| 'SYSTEM_MATERIAL_LIGHT'
/** A blur effect that creates the appearance of a material that’s thicker than normal and is always light. iOS13+. */
| 'SYSTEM_THICK_MATERIAL_LIGHT'
/** A blur effect that creates the appearance of the system chrome and is always light. iOS13+ */
| 'SYSTEM_CHROME_MATERIAL_LIGHT'
/** A blur effect that creates the appearance of an ultra-thin material and is always dark. iOS13+ */
| 'SYSTEM_ULTRA_THIN_MATERIAL_DARK'
/** A blur effect that creates the appearance of a thin material and is always dark. iOS13+ */
| 'SYSTEM_THIN_MATERIAL_DARK'
/** A blur effect that creates the appearance of a material with normal thickness and is always dark. iOS13+. */
| 'SYSTEM_MATERIAL_DARK'
/** A blur effect that creates the appearance of a material that’s thicker than normal and is always dark. iOS13+. */
| 'SYSTEM_THICK_MATERIAL_DARK'
/** A blur effect that creates the appearance of the system chrome and is always dark. iOS13+ */
| 'SYSTEM_CHROME_MATERIAL_DARK';
/** Defines a range for zooming */
export interface ZoomRange {
/** The minimum zoom scale. Defaults to 1.0. */
minZoom: number;
/** The maximum zoom scale. Defaults to 12.0. */
maxZoom: number;
}
/** Configuration for the dialog/alert style */
export interface DialogStyle {
/** The Color of the screen-covering backdrop view. */
screenBackgroundColor: string;
/** The general background color of the actual dialog view. */
dialogBackgroundColor: string;
/** The visual effect of the dialogs background. */
dialogBackgroundEffect: BlurEffect;
/** The corner radius of the dialog. */
cornerRadius: number;
/** The color of the dialogs title. */
titleColor: string;
/** The font of the dialogs title */
titleFont: Font;
/** The color of the dialogs message. */
messageColor: string;
/** The font of the dialogs message. */
messageFont: Font;
/** The color of the separators around the dialogs button area. */
separatorColor: string;
/** The width of the separators in points. */
separatorWidth: number;
}
/** Configuration for the dialogs/alerts OK button style. */
export interface DialogButtonStyle {
/** The font of the button title. */
font: Font;
/** The color of the buttons title while not pressed. */
textColor: string;
/** The color of the buttons title while pressed. */
highlightedTextColor: string;
/** The background color of the button while not pressed. */
backgroundColor: string;
/** The background color of the button while pressed. */
highlightedBackgroundColor: string;
}
/** The barcode text format dialog. */
export type BarcodeDialogFormat =
/** Show the barcode value only. */
| 'CODE'
/** Show the barcode format with value. */
| 'TYPE_AND_CODE';
/** The SDK license status */
export type LicenseStatus =
/** License is valid and accepted. */
| 'Okay'
/** No license set yet. The SDK is in trial mode. */
| 'Trial'
/** No license set yet. The SDKs trial mode is over. */
| 'Expired'
/** No license active. The set license does not cover the current operating system. */
| 'WrongOS'
/** No license active. The set license was unreadable or has an invalid format. */
| 'Corrupted'
/** No license active. The set licenses does not cover the current apps bundle identifier. */
| 'AppIDMismatch'
/** No license set yet. The SDKs trial mode is over. */
| 'NotSet';
/** File encryption mode, 'AES128' or 'AES256'. */
export type FileEncryptionMode =
/** AES128 encryption mode */
| 'AES128'
/** AES256 encryption mode */
| 'AES256';