react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
163 lines (150 loc) • 4.65 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/mrz/MRZScannerIntroScreenConfiguration.yaml
import { BackgroundStyle, ButtonConfiguration, ForegroundStyle, StyledText } from '../../ui_v2/common/Common';
import { PartiallyConstructible } from '../../utils/utils';
/**
Determines the image for the introduction screen.
*/
/** @internal */
export let MrzScannerIntroImage;
(function (_MrzScannerIntroImage) {
function From(source) {
const _type = source._type;
switch (_type) {
case 'MrzIntroDefaultImage':
return new MrzIntroDefaultImage(source);
case 'MrzIntroNoImage':
return new MrzIntroNoImage(source);
case 'MrzIntroCustomImage':
return new MrzIntroCustomImage(source);
default:
throw `Unknown child class name: ${_type}`;
}
}
_MrzScannerIntroImage.From = From;
})(MrzScannerIntroImage || (MrzScannerIntroImage = {}));
/**
No image for the introduction screen.
*/
export class MrzIntroDefaultImage extends PartiallyConstructible {
_type = 'MrzIntroDefaultImage';
/** @param source {@displayType `DeepPartial<MrzIntroDefaultImage>`} */
constructor(source = {}) {
super();
}
}
/**
No image for the introduction screen.
*/
export class MrzIntroNoImage extends PartiallyConstructible {
_type = 'MrzIntroNoImage';
/** @param source {@displayType `DeepPartial<MrzIntroNoImage>`} */
constructor(source = {}) {
super();
}
}
/**
A custom image for the introduction screen.
*/
export class MrzIntroCustomImage extends PartiallyConstructible {
_type = 'MrzIntroCustomImage';
/**
The web or file URI to the image.
*/
/** @param source {@displayType `DeepPartial<MrzIntroCustomImage>`} */
constructor(source = {}) {
super();
if (source.uri !== undefined) {
this.uri = source.uri;
} else {
throw new Error('uri must be present in constructor argument');
}
}
}
/**
Configuration of the introduction screen for the MRZ scanner.
*/
export class MrzScannerIntroScreenConfiguration extends PartiallyConstructible {
/**
The image for the introduction screen.
*/
image = new MrzIntroDefaultImage({});
/**
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;
/**
The title of the introduction screen, located in the top bar.
*/
title = new StyledText({
text: '?introScreenTitle',
color: '?sbColorOnSurface'
});
/**
The text explanation of the introduction screen.
*/
explanation = new StyledText({
text: '?introScreenText',
color: '?sbColorOnSurface'
});
/**
Configuration of the 'Done' / 'Start scanning' button.
*/
doneButton = new ButtonConfiguration({
text: '?introScreenDoneButton',
accessibilityDescription: '?accessibilityDescriptionIntroScreenDoneButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '?sbColorPrimary',
strokeWidth: 0.0
}),
foreground: new ForegroundStyle({
color: '?sbColorOnPrimary'
})
});
/** @param source {@displayType `DeepPartial<MrzScannerIntroScreenConfiguration>`} */
constructor(source = {}) {
super();
if (source.image !== undefined) {
this.image = MrzScannerIntroImage.From(source.image);
}
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.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.explanation !== undefined) {
this.explanation = new StyledText(source.explanation);
}
if (source.doneButton !== undefined) {
this.doneButton = new ButtonConfiguration(source.doneButton);
}
}
}
//# sourceMappingURL=MRZScannerIntroScreenConfiguration.js.map