UNPKG

react-native-scanbot-sdk

Version:

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

155 lines (151 loc) 5.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UserGuidanceStates = exports.DocumentScannerUserGuidance = void 0; var _Common = require("../common/Common"); var _utils = require("../../utils"); /** Configure the titles of the user guidance hints for different states. */ class UserGuidanceStates extends _utils.PartiallyConstructible { /** The user guidance text displayed when no document is found. Default is "?cameraUserGuidanceNoDocumentFound" */ noDocumentFound = '?cameraUserGuidanceNoDocumentFound'; /** The user guidance text displayed when a landscape document is detected when the camera is in portrait mode (and vice versa). Default is "?cameraUserGuidanceBadAspectRatio" */ badAspectRatio = '?cameraUserGuidanceBadAspectRatio'; /** The user guidance text displayed when the document pitch/skew angle is unacceptable. Default is "?cameraUserGuidanceBadAngles" */ badAngles = '?cameraUserGuidanceBadAngles'; /** The user guidance text displayed when the document is not centered in the finder view. Default is "?cameraUserGuidanceTextHintOffCenter" */ textHintOffCenter = '?cameraUserGuidanceTextHintOffCenter'; /** The user guidance text displayed when the document is too far from camera. Default is "?cameraUserGuidanceTooSmall" */ tooSmall = '?cameraUserGuidanceTooSmall'; /** The user guidance text displayed when the background is too noisy. Default is "?cameraUserGuidanceTooNoisy" */ tooNoisy = '?cameraUserGuidanceTooNoisy'; /** The user guidance text displayed when it is too dark to capture an adequate image. Default is "?cameraUserGuidanceTooDark" */ tooDark = '?cameraUserGuidanceTooDark'; /** The user guidance text displayed when the device is in energy saving mode. iOS only. Default is "?cameraUserGuidanceEnergySaveMode" */ energySaveMode = '?cameraUserGuidanceEnergySaveMode'; /** The user guidance text displayed when the document is ready to be captured in 'auto snapping' mode. Default is "?cameraUserGuidanceReadyToCapture" */ readyToCapture = '?cameraUserGuidanceReadyToCapture'; /** The user guidance text displayed when the document is being captured and user needs to hold the device still. Default is "?cameraUserGuidanceReadyToCapture" */ capturing = '?cameraUserGuidanceReadyToCapture'; /** The user guidance text displayed when the document is ready to be captured in 'manual snapping' mode. Default is "?cameraUserGuidanceReadyToCaptureManual" */ captureManual = '?cameraUserGuidanceReadyToCaptureManual'; /** @param source {@displayType `DeepPartial<UserGuidanceStates>`} */ constructor(source = {}) { super(); if (source.noDocumentFound !== undefined) { this.noDocumentFound = source.noDocumentFound; } if (source.badAspectRatio !== undefined) { this.badAspectRatio = source.badAspectRatio; } if (source.badAngles !== undefined) { this.badAngles = source.badAngles; } if (source.textHintOffCenter !== undefined) { this.textHintOffCenter = source.textHintOffCenter; } if (source.tooSmall !== undefined) { this.tooSmall = source.tooSmall; } if (source.tooNoisy !== undefined) { this.tooNoisy = source.tooNoisy; } if (source.tooDark !== undefined) { this.tooDark = source.tooDark; } if (source.energySaveMode !== undefined) { this.energySaveMode = source.energySaveMode; } if (source.readyToCapture !== undefined) { this.readyToCapture = source.readyToCapture; } if (source.capturing !== undefined) { this.capturing = source.capturing; } if (source.captureManual !== undefined) { this.captureManual = source.captureManual; } } } /** Configuration of the hints guiding users through the scanning process. */ exports.UserGuidanceStates = UserGuidanceStates; class DocumentScannerUserGuidance extends _utils.PartiallyConstructible { /** Determines when the user guidance hints should be visible. Default is ENABLED */ visibility = 'ENABLED'; /** Configure the text style for the user guidance hints. */ title = new _Common.StyledText({ text: '?cameraUserGuidanceStart', color: '?sbColorOnPrimary' }); /** Configure the background style for the user guidance hints. */ background = new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '?sbColorSurfaceHigh' }); /** Configure the titles of the user guidance hints for different states. */ statesTitles = new UserGuidanceStates({}); /** @param source {@displayType `DeepPartial<DocumentScannerUserGuidance>`} */ constructor(source = {}) { super(); if (source.visibility !== undefined) { this.visibility = source.visibility; } if (source.title !== undefined) { this.title = new _Common.StyledText(source.title); } if (source.background !== undefined) { this.background = new _Common.BackgroundStyle(source.background); } if (source.statesTitles !== undefined) { this.statesTitles = new UserGuidanceStates(source.statesTitles); } } } exports.DocumentScannerUserGuidance = DocumentScannerUserGuidance; //# sourceMappingURL=DocumentScannerUserGuidance.js.map