UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

140 lines (136 loc) 5.11 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/barcode/BarcodeInfoMapping.yaml import { ButtonConfiguration, StyledText } from '../../ui_v2/common/Common'; import { PartiallyConstructible } from '../../utils/utils'; /** Configuration of the mapper's error dialog. */ export class BarcodeItemErrorState extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<BarcodeItemErrorState>`} */ constructor(source = {}) { super(); /** Title displayed above the error message. */ this.title = new StyledText({ text: 'Connection Error!', color: '?sbColorOnSurface' }); /** Error message. */ this.subtitle = new StyledText({ text: 'There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.', color: '?sbColorOnSurfaceVariant', }); /** Configuration of the retry button. */ this.retryButton = new ButtonConfiguration({}); /** Configuration of the cancel button. */ this.cancelButton = new ButtonConfiguration({}); if (source.title !== undefined) { this.title = new StyledText(source.title); } if (source.subtitle !== undefined) { this.subtitle = new StyledText(source.subtitle); } if (source.retryButton !== undefined) { this.retryButton = new ButtonConfiguration(source.retryButton); } if (source.cancelButton !== undefined) { this.cancelButton = new ButtonConfiguration(source.cancelButton); } } } /** Format of the mapped barcode data. */ export class BarcodeMappedData extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<BarcodeMappedData>`} */ constructor(source = {}) { super(); if (source.title !== undefined) { this.title = source.title; } else { throw new Error('title must be present in constructor argument'); } if (source.subtitle !== undefined) { this.subtitle = source.subtitle; } else { throw new Error('subtitle must be present in constructor argument'); } if (source.barcodeImage !== undefined) { this.barcodeImage = source.barcodeImage; } else { throw new Error('barcodeImage must be present in constructor argument'); } } } (function (BarcodeMappedData) { /** Use this key to display the original barcode image. Default is "BARCODE_IMAGE" */ BarcodeMappedData.BARCODE_IMAGE_KEY = 'BARCODE_IMAGE'; })(BarcodeMappedData || (BarcodeMappedData = {})); /** Configuration of the barcode data mapping. */ export class BarcodeInfoMapping extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<BarcodeInfoMapping>`} */ constructor(source = {}) { super(); /** Callback to map the barcode data to the data of the corresponding product. */ this.barcodeItemMapper = null; /** Background color of the barcode info dialog. Default is "?sbColorSurface" */ this.sheetColor = '?sbColorSurface'; /** Color of the divider and separator lines in the barcode info dialog. Default is "?sbColorOutline" */ this.dividerColor = '?sbColorOutline'; /** Background color of the overlay surrounding the barcode mapping error dialog. Default is "?sbColorModalOverlay" */ this.modalOverlayColor = '?sbColorModalOverlay'; /** Text being displayed while a barcode is being mapped. */ this.loadingMessage = new StyledText({ text: 'Loading message for barcode info mapping.', color: '?sbColorPrimary', }); /** Configuration of the error state displayed when processing a barcode fails. */ this.errorState = new BarcodeItemErrorState({}); if (source.barcodeItemMapper !== undefined) { this.barcodeItemMapper = source.barcodeItemMapper != null ? source.barcodeItemMapper : null; } if (source.sheetColor !== undefined) { this.sheetColor = source.sheetColor; } if (source.dividerColor !== undefined) { this.dividerColor = source.dividerColor; } if (source.modalOverlayColor !== undefined) { this.modalOverlayColor = source.modalOverlayColor; } if (source.loadingMessage !== undefined) { this.loadingMessage = new StyledText(source.loadingMessage); } if (source.errorState !== undefined) { this.errorState = new BarcodeItemErrorState(source.errorState); } } } //# sourceMappingURL=BarcodeInfoMapping.js.map