UNPKG

react-native-scanbot-sdk

Version:

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

290 lines (265 loc) 7.84 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/document/IntroductionScreenConfiguration.yaml import { BackgroundStyle, ButtonConfiguration, ForegroundStyle, StyledText } from '../../ui_v2/common/Common'; import { PartiallyConstructible } from '../../utils/utils'; /** An entry in the list of scanning steps of the introduction screen. */ export class IntroListEntry extends PartiallyConstructible { /** The image of the entry. */ image = new NoIntroImage({}); /** The text of the entry. */ text = new StyledText({ text: '?cameraIntroDescription', color: '?sbColorOnSurface' }); /** @param source {@displayType `DeepPartial<IntroListEntry>`} */ constructor(source = {}) { super(); if (source.image !== undefined) { this.image = IntroImage.From(source.image); } if (source.text !== undefined) { this.text = new StyledText(source.text); } } } /** Determines the image for the introduction screen. */ /** @internal */ export let IntroImage; (function (_IntroImage) { function From(source) { const _type = source._type; switch (_type) { case 'NoIntroImage': return new NoIntroImage(source); case 'CustomImage': return new CustomImage(source); case 'ReceiptsIntroImage': return new ReceiptsIntroImage(source); case 'MedicalCertificateIntroImage': return new MedicalCertificateIntroImage(source); case 'DocumentIntroImage': return new DocumentIntroImage(source); case 'CheckIntroImage': return new CheckIntroImage(source); case 'IdCardIntroImage': return new IdCardIntroImage(source); case 'CreditCardIntroImage': return new CreditCardIntroImage(source); default: throw `Unknown child class name: ${_type}`; } } _IntroImage.From = From; })(IntroImage || (IntroImage = {})); /** No image for the introduction screen. */ export class NoIntroImage extends PartiallyConstructible { _type = 'NoIntroImage'; /** @param source {@displayType `DeepPartial<NoIntroImage>`} */ constructor(source = {}) { super(); } } /** A custom image for the introduction screen. */ export class CustomImage extends PartiallyConstructible { _type = 'CustomImage'; /** The web or file URI to the image. */ /** @param source {@displayType `DeepPartial<CustomImage>`} */ constructor(source = {}) { super(); if (source.uri !== undefined) { this.uri = source.uri; } else { throw new Error('uri must be present in constructor argument'); } } } /** The image for the introduction screen with a receipt template. */ export class ReceiptsIntroImage extends PartiallyConstructible { _type = 'ReceiptsIntroImage'; /** @param source {@displayType `DeepPartial<ReceiptsIntroImage>`} */ constructor(source = {}) { super(); } } /** The image for the introduction screen with a medical certificate template. */ export class MedicalCertificateIntroImage extends PartiallyConstructible { _type = 'MedicalCertificateIntroImage'; /** @param source {@displayType `DeepPartial<MedicalCertificateIntroImage>`} */ constructor(source = {}) { super(); } } /** The image for the introduction screen with a document template. */ export class DocumentIntroImage extends PartiallyConstructible { _type = 'DocumentIntroImage'; /** @param source {@displayType `DeepPartial<DocumentIntroImage>`} */ constructor(source = {}) { super(); } } /** The image for the introduction screen with a check template. */ export class CheckIntroImage extends PartiallyConstructible { _type = 'CheckIntroImage'; /** @param source {@displayType `DeepPartial<CheckIntroImage>`} */ constructor(source = {}) { super(); } } /** The image for the introduction screen with an ID card template. */ export class IdCardIntroImage extends PartiallyConstructible { _type = 'IdCardIntroImage'; /** @param source {@displayType `DeepPartial<IdCardIntroImage>`} */ constructor(source = {}) { super(); } } /** The image for the introduction screen with a credit card template. */ export class CreditCardIntroImage extends PartiallyConstructible { _type = 'CreditCardIntroImage'; /** @param source {@displayType `DeepPartial<CreditCardIntroImage>`} */ constructor(source = {}) { super(); } } /** Configuration of the introduction screen for the document scanner. */ export class IntroductionScreenConfiguration extends PartiallyConstructible { /** The background color of the introduction screen. Default is "?sbColorSurface" */ backgroundColor = '?sbColorSurface'; /** The divider color of the introduction screen. Default is "?sbColorOutline" */ dividerColor = '?sbColorOutline'; /** The handle color of the introduction screen. Default is "?sbColorOutline" */ handlerColor = '?sbColorOutline'; /** Determines whether the introduction screen should automatically be shown or not when the scanning session starts. Default is false */ showAutomatically = false; /** Configuration of the 'done' button, located in the top bar. */ topBarDoneButton = new ButtonConfiguration({ visible: true, text: '?cameraIntroDoneButton', accessibilityDescription: '?accessibilityDescriptionCameraIntroDoneButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorPrimary', useShadow: false }) }); /** The title of the introduction screen, located in the top bar. */ title = new StyledText({ text: '?cameraIntroTitle', color: '?sbColorOnSurface' }); /** The subtitle of the introduction screen. */ subtitle = new StyledText({ text: '?cameraIntroSubtitle', color: '?sbColorOnSurface' }); /** Configure the scanning steps of the introduction screen. */ items = [new IntroListEntry({ image: new DocumentIntroImage({}), text: new StyledText({ text: '?cameraIntroItem1', color: '?sbColorOnSurface' }) }), new IntroListEntry({ image: new NoIntroImage({}), text: new StyledText({ text: '?cameraIntroItem2', color: '?sbColorOnSurface' }) }), new IntroListEntry({ image: new NoIntroImage({}), text: new StyledText({ text: '?cameraIntroItem3', color: '?sbColorOnSurface' }) }), new IntroListEntry({ image: new NoIntroImage({}), text: new StyledText({ text: '?cameraIntroItem4', color: '?sbColorOnSurface' }) })]; /** @param source {@displayType `DeepPartial<IntroductionScreenConfiguration>`} */ constructor(source = {}) { super(); if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.dividerColor !== undefined) { this.dividerColor = source.dividerColor; } if (source.handlerColor !== undefined) { this.handlerColor = source.handlerColor; } if (source.showAutomatically !== undefined) { this.showAutomatically = source.showAutomatically; } if (source.topBarDoneButton !== undefined) { this.topBarDoneButton = new ButtonConfiguration(source.topBarDoneButton); } if (source.title !== undefined) { this.title = new StyledText(source.title); } if (source.subtitle !== undefined) { this.subtitle = new StyledText(source.subtitle); } if (source.items !== undefined) { this.items = source.items.map(it => { return new IntroListEntry(it); }); } } } //# sourceMappingURL=IntroductionScreenConfiguration.js.map