react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
391 lines (377 loc) • 15.1 kB
text/typescript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/ReviewScreenConfiguration.yaml
import {
BackgroundStyle,
BarButtonConfiguration,
ButtonConfiguration,
ForegroundStyle,
IconButton,
IconStyle,
PopupMenuItem,
RoundButton,
StyledText,
} from '../../ui_v2/common/Common';
import { ScanbotAlertDialog } from '../../ui_v2/common/ScanbotAlertDialog';
import { UserGuidanceConfiguration } from '../../ui_v2/common/UserGuidanceConfiguration';
import { DeepPartial, PartiallyConstructible } from '../../utils/utils';
/**
Configuration of the bottom bar for the review screen.
*/
export class ReviewBottomBarConfiguration extends PartiallyConstructible {
/**
Configuration of the 'add' button, located in the bottom bar.
*/
public addButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({ text: '?reviewScreenAddButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionReviewAddButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'retake' button, located in the bottom bar.
*/
public retakeButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({ text: '?reviewScreenRetakeButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionReviewRetakeButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'crop' button, located in the bottom bar.
*/
public cropButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({ text: '?reviewScreenCropButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionReviewCropButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'rotate' button, located in the bottom bar.
*/
public rotateButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({ text: '?reviewScreenRotateButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionReviewRotateButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'delete' button, located in the bottom bar.
*/
public deleteButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({ text: '?reviewScreenDeleteButtonTitle', color: '?sbColorOnPrimary' }),
accessibilityDescription: '?accessibilityDescriptionReviewDeleteButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'submit' button, located in the bottom bar.
*/
public submitButton: ButtonConfiguration = new ButtonConfiguration({
text: '?reviewScreenSubmitButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewSubmitButton',
background: new BackgroundStyle({
strokeColor: '?sbColorSurface',
fillColor: '?sbColorSurface',
strokeWidth: 0.0,
}),
foreground: new ForegroundStyle({ color: '?sbColorOnSurface' }),
});
/** @param source {@displayType `DeepPartial<ReviewBottomBarConfiguration>`} */
public constructor(source: DeepPartial<ReviewBottomBarConfiguration> = {}) {
super();
if (source.addButton !== undefined) {
this.addButton = new BarButtonConfiguration(source.addButton);
}
if (source.retakeButton !== undefined) {
this.retakeButton = new BarButtonConfiguration(source.retakeButton);
}
if (source.cropButton !== undefined) {
this.cropButton = new BarButtonConfiguration(source.cropButton);
}
if (source.rotateButton !== undefined) {
this.rotateButton = new BarButtonConfiguration(source.rotateButton);
}
if (source.deleteButton !== undefined) {
this.deleteButton = new BarButtonConfiguration(source.deleteButton);
}
if (source.submitButton !== undefined) {
this.submitButton = new ButtonConfiguration(source.submitButton);
}
}
}
/**
Configuration of the 'more' popup menu for the review screen.
*/
export class ReviewMorePopupMenu extends PartiallyConstructible {
/**
The background color of the popup menu.
Default is "?sbColorSurface"
*/
public backgroundColor: string = '?sbColorSurface';
/**
Configuration of the 'reorder pages' button.
*/
public reorderPages: PopupMenuItem = new PopupMenuItem({
title: new StyledText({
text: '?reviewScreenReorderPagesButtonTitle',
color: '?sbColorOnSurface',
}),
accessibilityDescription: '?accessibilityDescriptionReviewReorderPagesButton',
icon: new IconStyle({ color: '?sbColorOnSurface' }),
});
/**
Configuration of the 'delete all' button.
*/
public deleteAll: PopupMenuItem = new PopupMenuItem({
title: new StyledText({ text: '?reviewScreenDeleteAllButtonTitle', color: '?sbColorNegative' }),
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllButton',
icon: new IconStyle({ color: '?sbColorNegative' }),
});
/** @param source {@displayType `DeepPartial<ReviewMorePopupMenu>`} */
public constructor(source: DeepPartial<ReviewMorePopupMenu> = {}) {
super();
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.reorderPages !== undefined) {
this.reorderPages = new PopupMenuItem(source.reorderPages);
}
if (source.deleteAll !== undefined) {
this.deleteAll = new PopupMenuItem(source.deleteAll);
}
}
}
/**
Configuration of the zoom overlay for the review screen.
*/
export class ZoomOverlay extends PartiallyConstructible {
/**
The background color of the zoom overlay.
Default is "?sbColorModalOverlay"
*/
public overlayColor: string = '?sbColorModalOverlay';
/**
Configuration of the 'close' button for the zoom overlay.
*/
public closeButton: ButtonConfiguration = new ButtonConfiguration({
text: '?zoomOverlayCancelButtonText',
accessibilityDescription: '?accessibilityDescriptionZoomOverlayCancelButton',
background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }),
});
/** @param source {@displayType `DeepPartial<ZoomOverlay>`} */
public constructor(source: DeepPartial<ZoomOverlay> = {}) {
super();
if (source.overlayColor !== undefined) {
this.overlayColor = source.overlayColor;
}
if (source.closeButton !== undefined) {
this.closeButton = new ButtonConfiguration(source.closeButton);
}
}
}
/**
Configuration of the screen for reviewing the scanned pages.
*/
export class ReviewScreenConfiguration extends PartiallyConstructible {
/**
Determines whether the review screen should be shown or not. If 'false', the review screen will be skipped and the scanned document will be returned immediately.
Default is true
*/
public enabled: boolean = true;
/**
Configuration of the title, located in the top bar.
*/
public topBarTitle: StyledText = new StyledText({
text: '?reviewScreenTitle',
color: '?sbColorOnPrimary',
});
/**
Configuration of the 'more' button, located in the top bar.
*/
public topBarMoreButton: IconButton = new IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewMoreButton',
});
/**
Configuration of the 'back' button, located in the top bar.
*/
public topBarBackButton: ButtonConfiguration = new ButtonConfiguration({
visible: true,
text: '?reviewTopBarBackButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewTopBarBackButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
foreground: new ForegroundStyle({
iconVisible: true,
color: '?sbColorOnPrimary',
useShadow: false,
}),
});
/**
Configuration of the 'more' popup menu for the review screen.
*/
public morePopup: ReviewMorePopupMenu = new ReviewMorePopupMenu({});
/**
Configuration of the 'zoom' button.
*/
public zoomButton: RoundButton = new RoundButton({
accessibilityDescription: '?accessibilityDescriptionReviewZoomButton',
backgroundColor: '?sbColorSurfaceHigh',
foregroundColor: '?sbColorOnPrimary',
});
/**
Configuration of the zoom overlay for the review screen.
*/
public zoomOverlay: ZoomOverlay = new ZoomOverlay({});
/**
The background color of the review screen.
Default is "?sbColorOnSurfaceVariant"
*/
public backgroundColor: string = '?sbColorOnSurfaceVariant';
/**
Configuration of the bottom bar for the review screen.
*/
public bottomBar: ReviewBottomBarConfiguration = new ReviewBottomBarConfiguration({});
/**
Configuration of the 'next page' button.
*/
public switchNextPageButton: IconButton = new IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewNextPageButton',
});
/**
Configuration of the 'previous page' button.
*/
public switchPreviousPageButton: IconButton = new IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewPreviousPageButton',
});
/**
Configuration of the page count label.
*/
public pageCounter: UserGuidanceConfiguration = new UserGuidanceConfiguration({
title: new StyledText({ text: '?reviewScreenPageCount', color: '?sbColorOnPrimary' }),
background: new BackgroundStyle({ fillColor: '?sbColorSurfaceHigh', strokeWidth: 0.0 }),
});
/**
Configuration of the alert dialog displayed when trying to delete all the pages.
*/
public deleteAllPagesAlertDialog: ScanbotAlertDialog = new ScanbotAlertDialog({
title: new StyledText({ text: '?reviewDeleteAllPagesAlertTitle', color: '?sbColorOnSurface' }),
subtitle: new StyledText({
text: '?reviewDeleteAllPagesAlertSubtitle',
color: '?sbColorOnSurfaceVariant',
}),
okButton: new ButtonConfiguration({
text: '?reviewDeleteAllPagesAlertDeleteButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton',
background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }),
}),
actionButton: new ButtonConfiguration({ visible: false }),
cancelButton: new ButtonConfiguration({
text: '?reviewDeleteAllPagesAlertCancelButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton',
background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorPrimary' }),
}),
});
/**
Configuration of the alert dialog displayed when trying to delete a single page.
*/
public deletePageAlertDialog: ScanbotAlertDialog = new ScanbotAlertDialog({
title: new StyledText({ text: '?reviewDeletePageAlertTitle', color: '?sbColorOnSurface' }),
subtitle: new StyledText({
text: '?reviewDeletePageAlertSubTitle',
color: '?sbColorOnSurfaceVariant',
}),
okButton: new ButtonConfiguration({
text: '?reviewDeletePageAlertConfirmButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertConfirmButton',
background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }),
}),
actionButton: new ButtonConfiguration({
text: '?reviewDeletePageAlertDeleteRetakeButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton',
background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorPrimary' }),
}),
cancelButton: new ButtonConfiguration({
text: '?reviewDeletePageAlertCancelButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertCancelButton',
background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }),
foreground: new ForegroundStyle({ color: '?sbColorPrimary' }),
}),
});
/** @param source {@displayType `DeepPartial<ReviewScreenConfiguration>`} */
public constructor(source: DeepPartial<ReviewScreenConfiguration> = {}) {
super();
if (source.enabled !== undefined) {
this.enabled = source.enabled;
}
if (source.topBarTitle !== undefined) {
this.topBarTitle = new StyledText(source.topBarTitle);
}
if (source.topBarMoreButton !== undefined) {
this.topBarMoreButton = new IconButton(source.topBarMoreButton);
}
if (source.topBarBackButton !== undefined) {
this.topBarBackButton = new ButtonConfiguration(source.topBarBackButton);
}
if (source.morePopup !== undefined) {
this.morePopup = new ReviewMorePopupMenu(source.morePopup);
}
if (source.zoomButton !== undefined) {
this.zoomButton = new RoundButton(source.zoomButton);
}
if (source.zoomOverlay !== undefined) {
this.zoomOverlay = new ZoomOverlay(source.zoomOverlay);
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.bottomBar !== undefined) {
this.bottomBar = new ReviewBottomBarConfiguration(source.bottomBar);
}
if (source.switchNextPageButton !== undefined) {
this.switchNextPageButton = new IconButton(source.switchNextPageButton);
}
if (source.switchPreviousPageButton !== undefined) {
this.switchPreviousPageButton = new IconButton(source.switchPreviousPageButton);
}
if (source.pageCounter !== undefined) {
this.pageCounter = new UserGuidanceConfiguration(source.pageCounter);
}
if (source.deleteAllPagesAlertDialog !== undefined) {
this.deleteAllPagesAlertDialog = new ScanbotAlertDialog(source.deleteAllPagesAlertDialog);
}
if (source.deletePageAlertDialog !== undefined) {
this.deletePageAlertDialog = new ScanbotAlertDialog(source.deletePageAlertDialog);
}
}
}