capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
241 lines (237 loc) • 8.7 kB
JavaScript
/// 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 {
/** @param source {@displayType `DeepPartial<IntroListEntry>`} */
constructor(source = {}) {
super();
/**
The image of the entry.
*/
this.image = new NoIntroImage({});
/**
The text of the entry.
*/
this.text = new StyledText({ text: '?cameraIntroDescription', color: '?sbColorOnSurface' });
if (source.image !== undefined) {
this.image = IntroImage.From(source.image);
}
if (source.text !== undefined) {
this.text = new StyledText(source.text);
}
}
}
/** @internal */
export var IntroImage;
(function (IntroImage) {
/** @internal */
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 {
/** @param source {@displayType `DeepPartial<NoIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'NoIntroImage';
}
}
/**
A custom image for the introduction screen.
*/
export class CustomImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CustomImage>`} */
constructor(source = {}) {
super();
this._type = 'CustomImage';
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 {
/** @param source {@displayType `DeepPartial<ReceiptsIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'ReceiptsIntroImage';
}
}
/**
The image for the introduction screen with a medical certificate template.
*/
export class MedicalCertificateIntroImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<MedicalCertificateIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'MedicalCertificateIntroImage';
}
}
/**
The image for the introduction screen with a document template.
*/
export class DocumentIntroImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<DocumentIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'DocumentIntroImage';
}
}
/**
The image for the introduction screen with a check template.
*/
export class CheckIntroImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CheckIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'CheckIntroImage';
}
}
/**
The image for the introduction screen with an ID card template.
*/
export class IdCardIntroImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<IdCardIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'IdCardIntroImage';
}
}
/**
The image for the introduction screen with a credit card template.
*/
export class CreditCardIntroImage extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CreditCardIntroImage>`} */
constructor(source = {}) {
super();
this._type = 'CreditCardIntroImage';
}
}
/**
Configuration of the introduction screen for the document scanner.
*/
export class IntroductionScreenConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<IntroductionScreenConfiguration>`} */
constructor(source = {}) {
super();
/**
The background color of the introduction screen.
Default is "?sbColorSurface"
*/
this.backgroundColor = '?sbColorSurface';
/**
The divider color of the introduction screen.
Default is "?sbColorOutline"
*/
this.dividerColor = '?sbColorOutline';
/**
The handle color of the introduction screen.
Default is "?sbColorOutline"
*/
this.handlerColor = '?sbColorOutline';
/**
Determines whether the introduction screen should automatically be shown or not when the scanning session starts.
Default is false
*/
this.showAutomatically = false;
/**
Configuration of the 'done' button, located in the top bar.
*/
this.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.
*/
this.title = new StyledText({ text: '?cameraIntroTitle', color: '?sbColorOnSurface' });
/**
The subtitle of the introduction screen.
*/
this.subtitle = new StyledText({ text: '?cameraIntroSubtitle', color: '?sbColorOnSurface' });
/**
Configure the scanning steps of the introduction screen.
*/
this.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' }),
}),
];
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