react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
409 lines (398 loc) • 14.1 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/check/CheckScannerScreenConfiguration.yaml
import { CheckScannerConfiguration } from '../../check/CheckScannerTypes';
import { CheckScannerIntroScreenConfiguration } from '../../ui_v2/check/CheckScannerIntroScreenConfiguration';
import { CheckScannerScreenTextLocalization } from '../../ui_v2/check/CheckScannerScreenTextLocalization';
import { CheckScannerGuidanceConfiguration } from '../../ui_v2/check/CheckScannerUserGuidance';
import { CheckScanningProgressConfiguration } from '../../ui_v2/check/CheckScanningProgressConfiguration';
import { ActionBarConfiguration } from '../../ui_v2/common/ActionBarConfiguration';
import { CameraConfiguration } from '../../ui_v2/common/CameraConfiguration';
import { CameraPermissionScreen } from '../../ui_v2/common/CameraPermission';
import { BackgroundStyle, ButtonConfiguration, EdgeInsets, ForegroundStyle, IconButton, IconStyle, Palette, RoundButton, Sound, StyledText, Vibration } from '../../ui_v2/common/Common';
import { ScanCompletionOverlay } from '../../ui_v2/common/ScanCompletionOverlay';
import { ScanbotAlertDialog } from '../../ui_v2/common/ScanbotAlertDialog';
import { TopBarConfiguration } from '../../ui_v2/common/TopBarConfiguration';
import { UserGuidanceConfiguration } from '../../ui_v2/common/UserGuidanceConfiguration';
import { FinderCorneredStyle, PermanentViewFinderConfiguration } from '../../ui_v2/common/ViewFinderConfiguration';
import { AspectRatio } from '../../utils/geometry/Geometry';
import { PartiallyConstructible } from '../../utils/utils';
/**
Configuration of the screen for detecting check data.
*/
export class CheckScannerScreenConfiguration extends PartiallyConstructible {
/**
Version number of the configuration object.
Default is "1.0"
*/
version = '1.0';
/**
The configuration object should be applied for this screen.
Default is "CheckScanner"
*/
screen = 'CheckScanner';
/**
Configuration of the all strings for check scanner screen.
*/
localization = new CheckScannerScreenTextLocalization({});
/**
Define the screen's base color values from which other colors are derived.
*/
palette = new Palette({});
/**
The background color of the check scanner screen.
Default is "?sbColorSurfaceLow"
*/
backgroundColor = '?sbColorSurfaceLow';
/**
Configuration of the camera behavior.
*/
cameraConfiguration = new CameraConfiguration({
orientationLockMode: 'PORTRAIT'
});
/**
Configuration of the dialog for requesting camera permissions.
*/
cameraPermission = new CameraPermissionScreen({
statusBarMode: 'DARK',
background: '?sbColorSurface',
iconBackground: '?sbColorOutline',
icon: new IconStyle({
visible: true,
color: '?sbColorOnSurface'
}),
enableCameraButton: new ButtonConfiguration({
visible: true,
text: '?cameraPermissionEnableCameraButton',
accessibilityDescription: '?accessibilityDescriptionCameraPermissionEnableCameraButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 0.0
}),
foreground: new ForegroundStyle({
iconVisible: false,
color: '?sbColorOnPrimary',
useShadow: false
})
}),
closeButton: new ButtonConfiguration({
visible: true,
text: '?cameraPermissionCloseButton',
accessibilityDescription: '?accessibilityDescriptionCameraPermissionCloseButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new ForegroundStyle({
iconVisible: false,
color: '?sbColorPrimary',
useShadow: false
})
}),
enableCameraTitle: new StyledText({
text: '?cameraPermissionEnableCameraTitle',
color: '?sbColorOnSurface'
}),
enableCameraExplanation: new StyledText({
text: '?cameraPermissionEnableCameraExplanation',
color: '?sbColorOnSurfaceVariant'
})
});
/**
Configuration of the top user guidance.
*/
topUserGuidance = new UserGuidanceConfiguration({
title: new StyledText({
text: '?topUserGuidance'
})
});
/**
Configuration of the user guidance below finder view.
*/
scanStatusUserGuidance = new CheckScannerGuidanceConfiguration({});
/**
Configuration of the top bar on the check scanner screen.
*/
topBar = new TopBarConfiguration({
title: new StyledText({
visible: true,
text: '?topBarTitle'
}),
cancelButton: new ButtonConfiguration({
text: '?topBarCancelButton',
accessibilityDescription: '?accessibilityDescriptionCancelButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new ForegroundStyle({
color: '?sbColorOnPrimary'
})
})
});
/**
Configuration of the button in the top bar that opens the introduction screen.
*/
topBarOpenIntroScreenButton = new IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionOpenIntroScreenButton'
});
/**
Configuration of the introduction screen for the check scanner.
*/
introScreen = new CheckScannerIntroScreenConfiguration({});
/**
Configuration of the action bar.
*/
actionBar = new ActionBarConfiguration({
flipCameraButton: new RoundButton({
visible: false,
accessibilityDescription: '?accessibilityDescriptionFlipCameraButton',
backgroundColor: '?sbColorSurfaceHigh',
foregroundColor: '?sbColorOnPrimary',
activeBackgroundColor: '?sbColorWarning',
activeForegroundColor: '#1C1B1F'
})
});
/**
Configuration of the view finder.
*/
viewFinder = new PermanentViewFinderConfiguration({
style: new FinderCorneredStyle({
strokeColor: '?sbColorSurface',
strokeWidth: 2.0
}),
aspectRatio: new AspectRatio({
width: 2.14,
height: 1.0
}),
minimumInsets: new EdgeInsets({
top: 24.0,
left: 24.0,
bottom: 24.0,
right: 24.0
})
});
/**
Configuration for the check recognizer.
*/
scannerConfiguration = new CheckScannerConfiguration({});
/**
Flag to capture high resolution image.
Default is false
*/
captureHighResolutionImage = false;
/**
Flag to show or hide the preset button.
Default is true
*/
exampleOverlayVisible = true;
/**
Configuration of visualization of the scanning progress.
*/
scanningProgress = new CheckScanningProgressConfiguration({});
/**
Timeout for the no Check found state. If the no Check found state is active longer than this value, the alert will be presented.
Default is 5000
*/
noCheckFoundTimeout = 5000;
/**
Timeout for the accumulation state. If the accumulation state is active longer than this value, the alert will be presented.
Default is 3000
*/
accumulationTimeout = 3000;
/**
Configuration of the success overlay.
*/
successOverlay = new ScanCompletionOverlay({});
/**
Configuration of the alert dialog that will be presented when no Check is detected.
*/
noCheckDetectedAlertDialog = new ScanbotAlertDialog({
title: new StyledText({
text: '?checkNoCheckDetectedAlertTitle',
color: '?sbColorOnSurface'
}),
subtitle: new StyledText({
text: '?checkNoCheckDetectedAlertSubtitle',
color: '?sbColorOnSurfaceVariant'
}),
sheetColor: '?sbColorSurface',
modalOverlayColor: '?sbColorModalOverlay',
dividerColor: '?sbColorOutline',
okButton: new ButtonConfiguration({
visible: true,
text: '?checkAlertRetryButton',
accessibilityDescription: '?accessibilityDescriptionRetryButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 1.0
}),
foreground: new ForegroundStyle({
iconVisible: true,
color: '?sbColorOnPrimary',
useShadow: false
})
}),
cancelButton: new ButtonConfiguration({
visible: true,
text: '?checkAlertCloseScannerButton',
accessibilityDescription: '?accessibilityDescriptionCloseScannerButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 1.0
}),
foreground: new ForegroundStyle({
iconVisible: false,
color: '?sbColorPrimary',
useShadow: false
})
})
});
/**
Configuration of the alert dialog that will be presented when scanned image is not good.
*/
imageNotGoodAlertDialog = new ScanbotAlertDialog({
title: new StyledText({
text: '?checkImageNotGoodAlertTitle',
color: '?sbColorOnSurface'
}),
subtitle: new StyledText({
text: '?checkImageNotGoodAlertSubtitle',
color: '?sbColorOnSurfaceVariant'
}),
sheetColor: '?sbColorSurface',
modalOverlayColor: '?sbColorModalOverlay',
dividerColor: '?sbColorOutline',
okButton: new ButtonConfiguration({
visible: true,
text: '?checkAlertRetryButton',
accessibilityDescription: '?accessibilityDescriptionRetryButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 1.0
}),
foreground: new ForegroundStyle({
iconVisible: true,
color: '?sbColorOnPrimary',
useShadow: false
})
}),
cancelButton: new ButtonConfiguration({
visible: true,
text: '?checkAlertCloseScannerButton',
accessibilityDescription: '?accessibilityDescriptionCloseScannerButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 1.0
}),
foreground: new ForegroundStyle({
iconVisible: false,
color: '?sbColorPrimary',
useShadow: false
})
})
});
/**
Configuration of the scan confirmation sound.
*/
sound = new Sound({});
/**
Configuration of the vibration feedback.
*/
vibration = new Vibration({});
/**
If enabled, the screen will not turn off while the check scanner is active. (Android only).
Default is true
*/
keepScreenOn = true;
/** @param source {@displayType `DeepPartial<CheckScannerScreenConfiguration>`} */
constructor(source = {}) {
super();
if (source.version !== undefined) {
this.version = source.version;
}
if (source.screen !== undefined) {
this.screen = source.screen;
}
if (source.localization !== undefined) {
this.localization = new CheckScannerScreenTextLocalization(source.localization);
}
if (source.palette !== undefined) {
this.palette = new Palette(source.palette);
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.cameraConfiguration !== undefined) {
this.cameraConfiguration = new CameraConfiguration(source.cameraConfiguration);
}
if (source.cameraPermission !== undefined) {
this.cameraPermission = new CameraPermissionScreen(source.cameraPermission);
}
if (source.topUserGuidance !== undefined) {
this.topUserGuidance = new UserGuidanceConfiguration(source.topUserGuidance);
}
if (source.scanStatusUserGuidance !== undefined) {
this.scanStatusUserGuidance = new CheckScannerGuidanceConfiguration(source.scanStatusUserGuidance);
}
if (source.topBar !== undefined) {
this.topBar = new TopBarConfiguration(source.topBar);
}
if (source.topBarOpenIntroScreenButton !== undefined) {
this.topBarOpenIntroScreenButton = new IconButton(source.topBarOpenIntroScreenButton);
}
if (source.introScreen !== undefined) {
this.introScreen = new CheckScannerIntroScreenConfiguration(source.introScreen);
}
if (source.actionBar !== undefined) {
this.actionBar = new ActionBarConfiguration(source.actionBar);
}
if (source.viewFinder !== undefined) {
this.viewFinder = new PermanentViewFinderConfiguration(source.viewFinder);
}
if (source.scannerConfiguration !== undefined) {
this.scannerConfiguration = new CheckScannerConfiguration(source.scannerConfiguration);
}
if (source.captureHighResolutionImage !== undefined) {
this.captureHighResolutionImage = source.captureHighResolutionImage;
}
if (source.exampleOverlayVisible !== undefined) {
this.exampleOverlayVisible = source.exampleOverlayVisible;
}
if (source.scanningProgress !== undefined) {
this.scanningProgress = new CheckScanningProgressConfiguration(source.scanningProgress);
}
if (source.noCheckFoundTimeout !== undefined) {
this.noCheckFoundTimeout = source.noCheckFoundTimeout;
}
if (source.accumulationTimeout !== undefined) {
this.accumulationTimeout = source.accumulationTimeout;
}
if (source.successOverlay !== undefined) {
this.successOverlay = new ScanCompletionOverlay(source.successOverlay);
}
if (source.noCheckDetectedAlertDialog !== undefined) {
this.noCheckDetectedAlertDialog = new ScanbotAlertDialog(source.noCheckDetectedAlertDialog);
}
if (source.imageNotGoodAlertDialog !== undefined) {
this.imageNotGoodAlertDialog = new ScanbotAlertDialog(source.imageNotGoodAlertDialog);
}
if (source.sound !== undefined) {
this.sound = new Sound(source.sound);
}
if (source.vibration !== undefined) {
this.vibration = new Vibration(source.vibration);
}
if (source.keepScreenOn !== undefined) {
this.keepScreenOn = source.keepScreenOn;
}
}
}
//# sourceMappingURL=CheckScannerScreenConfiguration.js.map