react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
223 lines (218 loc) • 10.4 kB
text/typescript
import { AcknowledgementBottomBar } from '../document/AcknowledgementScreenConfiguration';
import { AcknowledgementMode } from '../document/AcknowledgementScreenConfiguration';
import { AcknowledgementScreenConfiguration } from '../document/AcknowledgementScreenConfiguration';
import { AspectRatio } from '../common/Common';
import { BackgroundStyle } from '../common/Common';
import { BadgeStyle } from '../common/Common';
import { BarButtonConfiguration } from '../common/Common';
import { ButtonConfiguration } from '../common/Common';
import { CameraBottomBar } from '../document/CameraScreenConfiguration';
import { CameraModule } from '../common/CameraConfiguration';
import { CameraPermissionScreen } from '../common/CameraPermission';
import { CameraPreviewMode } from '../common/Common';
import { CameraScreenConfiguration } from '../document/CameraScreenConfiguration';
import { CaptureFeedback } from '../document/CameraScreenConfiguration';
import { CapturePhotoQualityPrioritization } from '../document/DocumentScannerCameraConfiguration';
import { CheckIntroImage } from '../document/IntroductionScreenConfiguration';
import { CreditCardIntroImage } from '../document/IntroductionScreenConfiguration';
import { CroppingBottomBar } from '../document/CroppingScreenConfiguration';
import { CroppingScreenConfiguration } from '../document/CroppingScreenConfiguration';
import { CustomImage } from '../document/IntroductionScreenConfiguration';
import { DeepPartial, PartiallyConstructible } from '../../utils';
import { DocumentAnalysisMode } from '../document/DocumentScannerOutputSettings';
import { DocumentIntroImage } from '../document/IntroductionScreenConfiguration';
import { DocumentPolygonConfiguration } from '../document/CameraScreenConfiguration';
import { DocumentQuality } from '../../document/DocumentQuality';
import { DocumentScannerCameraConfiguration } from '../document/DocumentScannerCameraConfiguration';
import { DocumentScannerOutputSettings } from '../document/DocumentScannerOutputSettings';
import { DocumentScannerScreens } from '../document/DocumentScannerScreens';
import { DocumentScannerTextLocalization } from '../document/DocumentScannerTextLocalization';
import { DocumentScannerUserGuidance } from '../document/DocumentScannerUserGuidance';
import { FinderCorneredStyle } from '../common/ViewFinderConfiguration';
import { FinderStrokedStyle } from '../common/ViewFinderConfiguration';
import { FinderStyle } from '../common/ViewFinderConfiguration';
import { ForegroundStyle } from '../common/Common';
import { IconButton } from '../common/Common';
import { IconStyle } from '../common/Common';
import { IconUserGuidanceConfiguration } from '../common/UserGuidanceConfiguration';
import { IdCardIntroImage } from '../document/IntroductionScreenConfiguration';
import { IntroImage } from '../document/IntroductionScreenConfiguration';
import { IntroListEntry } from '../document/IntroductionScreenConfiguration';
import { IntroductionScreenConfiguration } from '../document/IntroductionScreenConfiguration';
import { MedicalCertificateIntroImage } from '../document/IntroductionScreenConfiguration';
import { NavigationBarMode } from '../common/NavigationBarConfiguration';
import { NoButtonMode } from '../document/CameraScreenConfiguration';
import { NoIntroImage } from '../document/IntroductionScreenConfiguration';
import { OrientationLockMode } from '../common/Common';
import { PagePreviewMode } from '../document/CameraScreenConfiguration';
import { PageSnapCheckMarkAnimation } from '../document/CameraScreenConfiguration';
import { PageSnapFeedbackMode } from '../document/CameraScreenConfiguration';
import { PageSnapFeedbackNone } from '../document/CameraScreenConfiguration';
import { PageSnapFunnelAnimation } from '../document/CameraScreenConfiguration';
import { Palette } from '../common/Common';
import { ParametricFilter } from '../../document/ParametricFilters';
import { PolygonStyle } from '../common/Common';
import { PopupMenuItem } from '../common/Common';
import { PreviewButton } from '../document/CameraScreenConfiguration';
import { ReceiptsIntroImage } from '../document/IntroductionScreenConfiguration';
import { ReorderPagesScreenConfiguration } from '../document/ReorderPagesScreenConfiguration';
import { ReviewBottomBarConfiguration } from '../document/ReviewScreenConfiguration';
import { ReviewMorePopupMenu } from '../document/ReviewScreenConfiguration';
import { ReviewScreenConfiguration } from '../document/ReviewScreenConfiguration';
import { RoundButton } from '../common/Common';
import { ScanAssistanceOverlay } from '../document/CameraScreenConfiguration';
import { ScanbotAlertDialog } from '../common/ScanbotAlertDialog';
import { ShutterButton } from '../document/CameraScreenConfiguration';
import { StatusBarMode } from '../common/TopBarConfiguration';
import { StyledText } from '../common/Common';
import { TextButtonMode } from '../document/CameraScreenConfiguration';
import { Timeouts } from '../common/Common';
import { UserGuidanceConfiguration } from '../common/UserGuidanceConfiguration';
import { UserGuidanceStates } from '../document/DocumentScannerUserGuidance';
import { UserGuidanceVisibility } from '../document/DocumentScannerGuidanceVisibility';
import { Vibration } from '../common/Common';
import { ViewFinderConfiguration } from '../common/ViewFinderConfiguration';
import { ZoomOverlay } from '../document/ReviewScreenConfiguration';
/**
Configuration of the general appearance.
*/
export class DocumentFlowAppearanceConfiguration extends PartiallyConstructible {
/**
Determines the visual mode used for the status bar icons.
Default is LIGHT
*/
public statusBarMode: StatusBarMode = 'LIGHT';
/**
Determines the visual mode used for the navigation bar icons. Android only.
Default is LIGHT
*/
public navigationBarMode: NavigationBarMode = 'LIGHT';
/**
The background color of the top bar. Only applicable when the visual mode is specified as 'SOLID', otherwise ignored.
Default is "?sbColorPrimary"
*/
public topBarBackgroundColor: string = '?sbColorPrimary';
/**
The background color of the bottom bar.
Default is "?sbColorPrimary"
*/
public bottomBarBackgroundColor: string = '?sbColorPrimary';
/**
Which mode to use when orientation should be locked to landscape or portrait.
Default is NONE
*/
public orientationLockMode: OrientationLockMode = 'NONE';
/** @param source {@displayType `DeepPartial<DocumentFlowAppearanceConfiguration>`} */
public constructor(source: DeepPartial<DocumentFlowAppearanceConfiguration> = {}) {
super();
if (source.statusBarMode !== undefined) {
this.statusBarMode = source.statusBarMode;
}
if (source.navigationBarMode !== undefined) {
this.navigationBarMode = source.navigationBarMode;
}
if (source.topBarBackgroundColor !== undefined) {
this.topBarBackgroundColor = source.topBarBackgroundColor;
}
if (source.bottomBarBackgroundColor !== undefined) {
this.bottomBarBackgroundColor = source.bottomBarBackgroundColor;
}
if (source.orientationLockMode !== undefined) {
this.orientationLockMode = source.orientationLockMode;
}
}
}
/**
Configuration of the document scanner screen.
*/
export class DocumentScanningFlow extends PartiallyConstructible {
/**
Version number of the configuration object.
Default is "1.0"
*/
public version: string = '1.0';
/**
The configuration object should be applied for this screen.
Default is "DocumentScanner"
*/
public screen: string = 'DocumentScanner';
/**
Define the screen's base color values from which other colors are derived.
*/
public palette: Palette = new Palette({
sbColorPrimary: '#C8193C',
sbColorPrimaryDisabled: '#F5F5F5',
sbColorNegative: '#FF3737',
sbColorPositive: '#4EFFB4',
sbColorWarning: '#FFCE5C',
sbColorSecondary: '#FFEDEE',
sbColorSecondaryDisabled: '#F5F5F5',
sbColorOnPrimary: '#FFFFFF',
sbColorOnSecondary: '#C8193C',
sbColorSurface: '#FFFFFF',
sbColorOutline: '#EFEFEF',
sbColorOnSurfaceVariant: '#707070',
sbColorOnSurface: '#000000',
sbColorSurfaceLow: '#00000026',
sbColorSurfaceHigh: '#0000007A',
sbColorModalOverlay: '#000000A3',
});
/**
Configuration of all the strings for the document scanner screen.
*/
public localization: DocumentScannerTextLocalization = new DocumentScannerTextLocalization({});
/**
Configuration of the general appearance.
*/
public appearance: DocumentFlowAppearanceConfiguration = new DocumentFlowAppearanceConfiguration(
{}
);
/**
Configuration of the output settings.
*/
public outputSettings: DocumentScannerOutputSettings = new DocumentScannerOutputSettings({});
/**
Configuration of the document scanner sub-screens.
*/
public screens: DocumentScannerScreens = new DocumentScannerScreens({});
/**
The UUID of the existing document to be edited.
*/
public documentUuid: string | null = null;
/**
Clean the existing pages from the scanning session.
Default is true
*/
public cleanScanningSession: boolean = true;
/** @param source {@displayType `DeepPartial<DocumentScanningFlow>`} */
public constructor(source: DeepPartial<DocumentScanningFlow> = {}) {
super();
if (source.version !== undefined) {
this.version = source.version;
}
if (source.screen !== undefined) {
this.screen = source.screen;
}
if (source.palette !== undefined) {
this.palette = new Palette(source.palette);
}
if (source.localization !== undefined) {
this.localization = new DocumentScannerTextLocalization(source.localization);
}
if (source.appearance !== undefined) {
this.appearance = new DocumentFlowAppearanceConfiguration(source.appearance);
}
if (source.outputSettings !== undefined) {
this.outputSettings = new DocumentScannerOutputSettings(source.outputSettings);
}
if (source.screens !== undefined) {
this.screens = new DocumentScannerScreens(source.screens);
}
if (source.documentUuid !== undefined) {
this.documentUuid = source.documentUuid != null ? source.documentUuid : null;
}
if (source.cleanScanningSession !== undefined) {
this.cleanScanningSession = source.cleanScanningSession;
}
}
}