UNPKG

react-native-scanbot-sdk

Version:

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

178 lines (167 loc) 6.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AcknowledgementScreenConfiguration = exports.AcknowledgementModeValues = exports.AcknowledgementBottomBar = void 0; var _Common = require("../../ui_v2/common/Common"); var _UserGuidanceConfiguration = require("../../ui_v2/common/UserGuidanceConfiguration"); var _utils = require("../../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/document/AcknowledgementScreenConfiguration.yaml /** Determines, after each page is snapped, whether the acknowledgment screen should be displayed or not. - `BAD_QUALITY`: The acknowledgement screen will only be shown when the quality of a scanned page is unacceptable. The quality threshold is determined by the `minimumQuality` parameter. - `ALWAYS`: The acknowledgement screen will always be shown after each snap, regardless of the scanned page's quality. - `NONE`: The acknowledgement screen will be disabled, in effect never shown. */ const AcknowledgementModeValues = exports.AcknowledgementModeValues = ['BAD_QUALITY', 'ALWAYS', 'NONE']; /** Configuration of the bottom bar for the acknowledgement screen. */ class AcknowledgementBottomBar extends _utils.PartiallyConstructible { /** Configuration of the 'retake' button. */ retakeButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?acknowledgementRetakeButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionAcknowledgementRetakeButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** Configuration of the 'accept' button, when the quality of the scanned page is acceptable. */ acceptWhenOkButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?acknowledgementAcceptButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionAcknowledgementAcceptButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** Configuration of the 'accept' button, when the quality of the scanned page is unacceptable. */ acceptWhenNotOkButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?acknowledgementAcceptButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionAcknowledgementAcceptButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** @param source {@displayType `DeepPartial<AcknowledgementBottomBar>`} */ constructor(source = {}) { super(); if (source.retakeButton !== undefined) { this.retakeButton = new _Common.BarButtonConfiguration(source.retakeButton); } if (source.acceptWhenOkButton !== undefined) { this.acceptWhenOkButton = new _Common.BarButtonConfiguration(source.acceptWhenOkButton); } if (source.acceptWhenNotOkButton !== undefined) { this.acceptWhenNotOkButton = new _Common.BarButtonConfiguration(source.acceptWhenNotOkButton); } } } /** Configuration of the acknowledgement screen. */ exports.AcknowledgementBottomBar = AcknowledgementBottomBar; class AcknowledgementScreenConfiguration extends _utils.PartiallyConstructible { /** Configuration of the title, located in the top bar. */ topBarTitle = new _Common.StyledText({ visible: false, text: '?acknowledgementTitle', color: '?sbColorOnPrimary' }); /** The minimum quality of a scanned page to be deemed acceptable. Used in conjunction with the acknowledgement mode. Default is POOR */ minimumQuality = 'POOR'; /** Determines, after each page is snapped, whether the acknowledgment screen should be displayed or not. Default is ALWAYS */ acknowledgementMode = 'ALWAYS'; /** Configuration of the hint that explains that the quality of the scanned page is unacceptable. */ badImageHint = new _UserGuidanceConfiguration.IconUserGuidanceConfiguration({ visible: true, icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }), title: new _Common.StyledText({ text: '?acknowledgementScreenBadDocumentHint', color: '?sbColorOnPrimary' }), background: new _Common.BackgroundStyle({ strokeColor: '?sbColorNegative', fillColor: '?sbColorNegative', strokeWidth: 0.0 }) }); /** The background color of the acknowledgement screen. Default is "?sbColorOutline" */ backgroundColor = '?sbColorOutline'; /** Configuration of the bottom bar for the acknowledgement screen. */ bottomBar = new AcknowledgementBottomBar({}); /** @param source {@displayType `DeepPartial<AcknowledgementScreenConfiguration>`} */ constructor(source = {}) { super(); if (source.topBarTitle !== undefined) { this.topBarTitle = new _Common.StyledText(source.topBarTitle); } if (source.minimumQuality !== undefined) { this.minimumQuality = source.minimumQuality; } if (source.acknowledgementMode !== undefined) { this.acknowledgementMode = source.acknowledgementMode; } if (source.badImageHint !== undefined) { this.badImageHint = new _UserGuidanceConfiguration.IconUserGuidanceConfiguration(source.badImageHint); } if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.bottomBar !== undefined) { this.bottomBar = new AcknowledgementBottomBar(source.bottomBar); } } } exports.AcknowledgementScreenConfiguration = AcknowledgementScreenConfiguration; //# sourceMappingURL=AcknowledgementScreenConfiguration.js.map