UNPKG

react-native-scanbot-sdk

Version:

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

178 lines (168 loc) 6.11 kB
/// 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 { DeepPartial, PartiallyConstructible } from '../../utils/utils'; /** Configuration of the bottom bar for the cropping screen. */ export class CroppingBottomBar extends PartiallyConstructible { /** Configuration of the 'detect document' button, located in the bottom bar. */ public detectButton: BarButtonConfiguration = 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. */ public rotateButton: BarButtonConfiguration = 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. */ public resetButton: BarButtonConfiguration = 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' }), }); /** @param source {@displayType `DeepPartial<CroppingBottomBar>`} */ public constructor(source: DeepPartial<CroppingBottomBar> = {}) { super(); 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 { /** Configuration of the 'cancel' button, located in the top bar. */ public topBarBackButton: ButtonConfiguration = 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. */ public topBarTitle: StyledText = new StyledText({ text: '?croppingScreenTitle', color: '?sbColorOnPrimary', }); /** Configuration of the 'confirm' button, located in the top bar. */ public topBarConfirmButton: ButtonConfiguration = 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" */ public backgroundColor: string = '?sbColorOutline'; /** The color of the cropping handles. Default is "?sbColorSurface" */ public croppingHandlerColor: string = '?sbColorSurface'; /** The color of the cropping polygon. Default is "?sbColorSurface" */ public croppingPolygonColor: string = '?sbColorSurface'; /** The color of the magnetic lines on the cropping polygon. Default is "?sbColorSurface" */ public croppingPolygonMagneticLineColor: string = '?sbColorSurface'; /** Configuration of the bottom bar for the cropping screen. */ public bottomBar: CroppingBottomBar = new CroppingBottomBar({}); /** @param source {@displayType `DeepPartial<CroppingScreenConfiguration>`} */ public constructor(source: DeepPartial<CroppingScreenConfiguration> = {}) { super(); 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); } } }