capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
135 lines (131 loc) • 6.37 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/CroppingScreenConfiguration.yaml
import { BackgroundStyle, BarButtonConfiguration, ButtonConfiguration, ForegroundStyle, IconStyle, StyledText, } from '../../ui_v2/common/Common';
import { PartiallyConstructible } from '../../utils/utils';
/**
Configuration of the bottom bar for the cropping screen.
*/
export class CroppingBottomBar extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CroppingBottomBar>`} */
constructor(source = {}) {
super();
/**
Configuration of the 'detect document' button, located in the bottom bar.
*/
this.detectButton = new BarButtonConfiguration({
title: new StyledText({ text: '?croppingDetectButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionCroppingDetectButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'rotate page' button, located in the bottom bar.
*/
this.rotateButton = new BarButtonConfiguration({
title: new StyledText({ text: '?croppingRotateButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionCroppingRotateButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'reset detection' button, located in the bottom bar.
*/
this.resetButton = new BarButtonConfiguration({
title: new StyledText({ text: '?croppingResetButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionCroppingResetButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
if (source.detectButton !== undefined) {
this.detectButton = new BarButtonConfiguration(source.detectButton);
}
if (source.rotateButton !== undefined) {
this.rotateButton = new BarButtonConfiguration(source.rotateButton);
}
if (source.resetButton !== undefined) {
this.resetButton = new BarButtonConfiguration(source.resetButton);
}
}
}
/**
Configuration of the screen for cropping the scanned pages.
*/
export class CroppingScreenConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<CroppingScreenConfiguration>`} */
constructor(source = {}) {
super();
/**
Configuration of the 'cancel' button, located in the top bar.
*/
this.topBarBackButton = new ButtonConfiguration({
visible: true,
text: '?croppingTopBarCancelButtonTitle',
accessibilityDescription: '?accessibilityDescriptionCroppingTopBarCancelButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }),
});
/**
Configuration of the title, located in the top bar.
*/
this.topBarTitle = new StyledText({ text: '?croppingScreenTitle', color: '?sbColorOnPrimary' });
/**
Configuration of the 'confirm' button, located in the top bar.
*/
this.topBarConfirmButton = new ButtonConfiguration({
visible: true,
text: '?croppingTopBarConfirmButtonTitle',
accessibilityDescription: '?accessibilityDescriptionCroppingTopBarConfirmButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }),
});
/**
The background color of the cropping screen.
Default is "?sbColorOutline"
*/
this.backgroundColor = '?sbColorOutline';
/**
The color of the cropping handles.
Default is "?sbColorSurface"
*/
this.croppingHandlerColor = '?sbColorSurface';
/**
The color of the cropping polygon.
Default is "?sbColorSurface"
*/
this.croppingPolygonColor = '?sbColorSurface';
/**
The color of the magnetic lines on the cropping polygon.
Default is "?sbColorSurface"
*/
this.croppingPolygonMagneticLineColor = '?sbColorSurface';
/**
Configuration of the bottom bar for the cropping screen.
*/
this.bottomBar = new CroppingBottomBar({});
if (source.topBarBackButton !== undefined) {
this.topBarBackButton = new ButtonConfiguration(source.topBarBackButton);
}
if (source.topBarTitle !== undefined) {
this.topBarTitle = new StyledText(source.topBarTitle);
}
if (source.topBarConfirmButton !== undefined) {
this.topBarConfirmButton = new ButtonConfiguration(source.topBarConfirmButton);
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.croppingHandlerColor !== undefined) {
this.croppingHandlerColor = source.croppingHandlerColor;
}
if (source.croppingPolygonColor !== undefined) {
this.croppingPolygonColor = source.croppingPolygonColor;
}
if (source.croppingPolygonMagneticLineColor !== undefined) {
this.croppingPolygonMagneticLineColor = source.croppingPolygonMagneticLineColor;
}
if (source.bottomBar !== undefined) {
this.bottomBar = new CroppingBottomBar(source.bottomBar);
}
}
}
//# sourceMappingURL=CroppingScreenConfiguration.js.map