UNPKG

react-native-scanbot-sdk

Version:

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

799 lines (752 loc) 27.6 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/document/CameraScreenConfiguration.yaml import { DocumentScannerParameters } from '../../document_scanner/DocumentScannerTypes'; import { CameraPermissionScreen } from '../../ui_v2/common/CameraPermission'; import { BackgroundStyle, BadgeStyle, BarButtonConfiguration, ButtonConfiguration, ForegroundStyle, IconButton, IconStyle, PolygonStyle, StyledText, Timeouts, Vibration, } from '../../ui_v2/common/Common'; import { ScanbotAlertDialog } from '../../ui_v2/common/ScanbotAlertDialog'; import { UserGuidanceConfiguration } from '../../ui_v2/common/UserGuidanceConfiguration'; import { ViewFinderConfiguration } from '../../ui_v2/common/ViewFinderConfiguration'; import { AcknowledgementScreenConfiguration } from '../../ui_v2/document/AcknowledgementScreenConfiguration'; import { DocumentScannerCameraConfiguration } from '../../ui_v2/document/DocumentScannerCameraConfiguration'; import { UserGuidanceVisibility } from '../../ui_v2/document/DocumentScannerGuidanceVisibility'; import { DocumentScannerUserGuidance } from '../../ui_v2/document/DocumentScannerUserGuidance'; import { IntroductionScreenConfiguration } from '../../ui_v2/document/IntroductionScreenConfiguration'; import { AspectRatio } from '../../utils/geometry/Geometry'; import { DeepPartial, PartiallyConstructible } from '../../utils/utils'; /** Configuration of the 'shutter' button. */ export class ShutterButton extends PartiallyConstructible { /** Determines if the 'shutter' button can be tapped to manually snap a document when 'auto snapping mode' is active. Default is true */ public enabledInAutoSnappingMode: boolean = true; /** The text to be read when the 'shutter' button is selected via the accessibility mode. Default is "?accessibilityDescriptionCameraShutterButton" */ public accessibilityDescription: string = '?accessibilityDescriptionCameraShutterButton'; /** The outer color of the 'shutter' button. Default is "?sbColorOnPrimary" */ public outerColor: string = '?sbColorOnPrimary'; /** The inner color of the 'shutter' button. Default is "?sbColorOnPrimary" */ public innerColor: string = '?sbColorOnPrimary'; /** @param source {@displayType `DeepPartial<ShutterButton>`} */ public constructor(source: DeepPartial<ShutterButton> = {}) { super(); if (source.enabledInAutoSnappingMode !== undefined) { this.enabledInAutoSnappingMode = source.enabledInAutoSnappingMode; } if (source.accessibilityDescription !== undefined) { this.accessibilityDescription = source.accessibilityDescription; } if (source.outerColor !== undefined) { this.outerColor = source.outerColor; } if (source.innerColor !== undefined) { this.innerColor = source.innerColor; } } } /** Configuration of the 'preview' button. */ export type PreviewButton = PagePreviewMode | TextButtonMode | NoButtonMode; /** @internal */ export namespace PreviewButton { /** @internal */ export function From(source: { [key: string]: any }): PreviewButton { const _type = source._type; switch (_type) { case 'PagePreviewMode': return new PagePreviewMode(source); case 'TextButtonMode': return new TextButtonMode(source); case 'NoButtonMode': return new NoButtonMode(source); default: throw `Unknown child class name: ${_type}`; } } } /** Configuration of the scan assistance overlay. */ export class ScanAssistanceOverlay extends PartiallyConstructible { /** Determines whether the scan assistance overlay is visible or not. If the viewfinder is enabled, this flag is ignored and the scan assistance overlay is not displayed. Default is true */ public visible: boolean = true; /** The background color of the scan assistance overlay. Default is "?sbColorModalOverlay" */ public backgroundColor: string = '?sbColorModalOverlay'; /** The foreground color of the scan assistance overlay image. Default is "?sbColorSurface" */ public foregroundColor: string = '?sbColorSurface'; /** @param source {@displayType `DeepPartial<ScanAssistanceOverlay>`} */ public constructor(source: DeepPartial<ScanAssistanceOverlay> = {}) { super(); if (source.visible !== undefined) { this.visible = source.visible; } if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.foregroundColor !== undefined) { this.foregroundColor = source.foregroundColor; } } } /** Configuration of the 'preview' button in 'page preview mode'. */ export class PagePreviewMode extends PartiallyConstructible { public readonly _type: 'PagePreviewMode' = 'PagePreviewMode'; /** The text to be read when the 'preview' button is selected via the accessibility mode. Default is "?accessibilityDescriptionCameraPreviewButton" */ public accessibilityDescription: string = '?accessibilityDescriptionCameraPreviewButton'; /** The color of the image placeholder. Default is "?sbColorOnSurfaceVariant" */ public imagePlaceholderColor: string = '?sbColorOnSurfaceVariant'; /** Configuration of the page counter icon. */ public pageCounter: BadgeStyle = new BadgeStyle({ visible: true, background: new BackgroundStyle({ strokeColor: '?sbColorSurface', fillColor: '?sbColorSurface', }), foregroundColor: '?sbColorPrimary', }); /** @param source {@displayType `DeepPartial<PagePreviewMode>`} */ public constructor(source: DeepPartial<PagePreviewMode> = {}) { super(); if (source.accessibilityDescription !== undefined) { this.accessibilityDescription = source.accessibilityDescription; } if (source.imagePlaceholderColor !== undefined) { this.imagePlaceholderColor = source.imagePlaceholderColor; } if (source.pageCounter !== undefined) { this.pageCounter = new BadgeStyle(source.pageCounter); } } } /** Configuration of the 'preview' button in 'text button mode'. */ export class TextButtonMode extends PartiallyConstructible { public readonly _type: 'TextButtonMode' = 'TextButtonMode'; /** The text to be read when the 'preview' button is selected via the accessibility mode. Default is "?accessibilityDescriptionCameraPreviewButton" */ public accessibilityDescription: string = '?accessibilityDescriptionCameraPreviewButton'; /** Configuration of the text style for the 'preview' button. */ public style: StyledText = new StyledText({ text: '?cameraPreviewButtonTitle', color: '?sbColorOnPrimary', }); /** @param source {@displayType `DeepPartial<TextButtonMode>`} */ public constructor(source: DeepPartial<TextButtonMode> = {}) { super(); if (source.accessibilityDescription !== undefined) { this.accessibilityDescription = source.accessibilityDescription; } if (source.style !== undefined) { this.style = new StyledText(source.style); } } } /** Configuration of the 'preview' button in 'no button mode'. */ export class NoButtonMode extends PartiallyConstructible { public readonly _type: 'NoButtonMode' = 'NoButtonMode'; /** Whether the button is visible. Default is false */ public readonly visible: boolean = false; /** @param source {@displayType `DeepPartial<NoButtonMode>`} */ public constructor(source: DeepPartial<NoButtonMode> = {}) { super(); if (source.visible !== undefined) { this.visible = source.visible; } } } /** Configuration of the bottom bar for the camera screen. */ export class CameraBottomBar extends PartiallyConstructible { /** Configuration of the 'import' button. */ public importButton: BarButtonConfiguration = new BarButtonConfiguration({ title: new StyledText({ visible: false, text: '?cameraImportButtonTitle', color: '?sbColorOnPrimary', }), accessibilityDescription: '?accessibilityDescriptionCameraImportButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'auto snapping mode' button. */ public autoSnappingModeButton: BarButtonConfiguration = new BarButtonConfiguration({ title: new StyledText({ visible: false, text: '?cameraAutoSnapButtonTitle', color: '?sbColorOnPrimary', }), accessibilityDescription: '?accessibilityDescriptionCameraAutoSnapButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'manual snapping mode' button. */ public manualSnappingModeButton: BarButtonConfiguration = new BarButtonConfiguration({ title: new StyledText({ visible: false, text: '?cameraManualSnapButtonTitle', color: '?sbColorOnPrimary', }), accessibilityDescription: '?accessibilityDescriptionCameraManualSnapButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'shutter' button. */ public shutterButton: ShutterButton = new ShutterButton({ accessibilityDescription: '?accessibilityDescriptionCameraShutterButton', }); /** Configuration of the 'flashlight' button when in the 'on' state. */ public torchOnButton: BarButtonConfiguration = new BarButtonConfiguration({ title: new StyledText({ visible: false, text: '?cameraTorchOnButtonTitle', color: '?sbColorOnPrimary', }), accessibilityDescription: '?accessibilityDescriptionCameraTorchOnButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'flashlight' button when in the 'off' state. */ public torchOffButton: BarButtonConfiguration = new BarButtonConfiguration({ title: new StyledText({ visible: false, text: '?cameraTorchOffButtonTitle', color: '?sbColorOnPrimary', }), accessibilityDescription: '?accessibilityDescriptionCameraTorchOffButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'preview' button. */ public previewButton: PreviewButton = new PagePreviewMode({}); /** @param source {@displayType `DeepPartial<CameraBottomBar>`} */ public constructor(source: DeepPartial<CameraBottomBar> = {}) { super(); if (source.importButton !== undefined) { this.importButton = new BarButtonConfiguration(source.importButton); } if (source.autoSnappingModeButton !== undefined) { this.autoSnappingModeButton = new BarButtonConfiguration(source.autoSnappingModeButton); } if (source.manualSnappingModeButton !== undefined) { this.manualSnappingModeButton = new BarButtonConfiguration(source.manualSnappingModeButton); } if (source.shutterButton !== undefined) { this.shutterButton = new ShutterButton(source.shutterButton); } if (source.torchOnButton !== undefined) { this.torchOnButton = new BarButtonConfiguration(source.torchOnButton); } if (source.torchOffButton !== undefined) { this.torchOffButton = new BarButtonConfiguration(source.torchOffButton); } if (source.previewButton !== undefined) { this.previewButton = PreviewButton.From(source.previewButton); } } } /** The type of animation to display after snapping a page. */ export type PageSnapFeedbackMode = | PageSnapFunnelAnimation | PageSnapCheckMarkAnimation | PageSnapFeedbackNone; /** @internal */ export namespace PageSnapFeedbackMode { /** @internal */ export function From(source: { [key: string]: any }): PageSnapFeedbackMode { const _type = source._type; switch (_type) { case 'PageSnapFunnelAnimation': return new PageSnapFunnelAnimation(source); case 'PageSnapCheckMarkAnimation': return new PageSnapCheckMarkAnimation(source); case 'PageSnapFeedbackNone': return new PageSnapFeedbackNone(source); default: throw `Unknown child class name: ${_type}`; } } } /** Configuration of the funnel animation. */ export class PageSnapFunnelAnimation extends PartiallyConstructible { public readonly _type: 'PageSnapFunnelAnimation' = 'PageSnapFunnelAnimation'; /** The overlay color for the funnel animation. Default is "?sbColorModalOverlay" */ public overlayColor: string = '?sbColorModalOverlay'; /** @param source {@displayType `DeepPartial<PageSnapFunnelAnimation>`} */ public constructor(source: DeepPartial<PageSnapFunnelAnimation> = {}) { super(); if (source.overlayColor !== undefined) { this.overlayColor = source.overlayColor; } } } /** Configuration of the check mark animation. */ export class PageSnapCheckMarkAnimation extends PartiallyConstructible { public readonly _type: 'PageSnapCheckMarkAnimation' = 'PageSnapCheckMarkAnimation'; /** The overlay color for the check mark animation. Default is "?sbColorModalOverlay" */ public overlayColor: string = '?sbColorModalOverlay'; /** The background color for the check mark animation. Default is "?sbColorOutline" */ public checkMarkBackgroundColor: string = '?sbColorOutline'; /** The check mark color for the check mark animation. Default is "#00000000" */ public checkMarkColor: string = '#00000000'; /** @param source {@displayType `DeepPartial<PageSnapCheckMarkAnimation>`} */ public constructor(source: DeepPartial<PageSnapCheckMarkAnimation> = {}) { super(); if (source.overlayColor !== undefined) { this.overlayColor = source.overlayColor; } if (source.checkMarkBackgroundColor !== undefined) { this.checkMarkBackgroundColor = source.checkMarkBackgroundColor; } if (source.checkMarkColor !== undefined) { this.checkMarkColor = source.checkMarkColor; } } } /** To not use a snap animation. */ export class PageSnapFeedbackNone extends PartiallyConstructible { public readonly _type: 'PageSnapFeedbackNone' = 'PageSnapFeedbackNone'; /** @param source {@displayType `DeepPartial<PageSnapFeedbackNone>`} */ public constructor(source: DeepPartial<PageSnapFeedbackNone> = {}) { super(); } } /** Configuration of the feedback shown after snapping a page. */ export class CaptureFeedback extends PartiallyConstructible { /** Whether the camera preview should blink or not after snapping a page. Default is true */ public cameraBlinkEnabled: boolean = true; /** The type of animation to display after snapping a page. */ public snapFeedbackMode: PageSnapFeedbackMode = new PageSnapFunnelAnimation({}); /** @param source {@displayType `DeepPartial<CaptureFeedback>`} */ public constructor(source: DeepPartial<CaptureFeedback> = {}) { super(); if (source.cameraBlinkEnabled !== undefined) { this.cameraBlinkEnabled = source.cameraBlinkEnabled; } if (source.snapFeedbackMode !== undefined) { this.snapFeedbackMode = PageSnapFeedbackMode.From(source.snapFeedbackMode); } } } /** Configuration of the document contour detection polygon. */ export class DocumentPolygonConfiguration extends PartiallyConstructible { /** Determines the visibility mode for the polygon. Default is ENABLED */ public visibility: UserGuidanceVisibility = 'ENABLED'; /** Configuration of the polygon when the detected document status is 'OK'. */ public documentOk: PolygonStyle = new PolygonStyle({ strokeColor: '?sbColorPositive', fillColor: '#00000000', strokeWidth: 2.0, }); /** Configuration of the polygon when the detected document status is 'not OK'. */ public documentNotOk: PolygonStyle = new PolygonStyle({ strokeColor: '?sbColorNegative', fillColor: '#00000000', strokeWidth: 2.0, }); /** Configuration of the animated polygon when the document is being scanned for capturing in 'auto snapping mode'. */ public autoSnapProgress: PolygonStyle = new PolygonStyle({ strokeColor: '#40A9FF', fillColor: '#00000000', strokeWidth: 2.0, }); /** @param source {@displayType `DeepPartial<DocumentPolygonConfiguration>`} */ public constructor(source: DeepPartial<DocumentPolygonConfiguration> = {}) { super(); if (source.visibility !== undefined) { this.visibility = source.visibility; } if (source.documentOk !== undefined) { this.documentOk = new PolygonStyle(source.documentOk); } if (source.documentNotOk !== undefined) { this.documentNotOk = new PolygonStyle(source.documentNotOk); } if (source.autoSnapProgress !== undefined) { this.autoSnapProgress = new PolygonStyle(source.autoSnapProgress); } } } /** Configuration of the screen for scanning the pages with the camera. */ export class CameraScreenConfiguration extends PartiallyConstructible { /** Configuration of the acknowledgement screen. */ public acknowledgement: AcknowledgementScreenConfiguration = new AcknowledgementScreenConfiguration({}); /** Configuration of the document scanner introduction screen. */ public introduction: IntroductionScreenConfiguration = new IntroductionScreenConfiguration({}); /** Configuration of the scan assistance overlay. */ public scanAssistanceOverlay: ScanAssistanceOverlay = new ScanAssistanceOverlay({}); /** Configuration of the camera permission screen. */ public cameraPermission: CameraPermissionScreen = 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 title, located in the top bar. */ public topBarTitle: StyledText = new StyledText({ text: '?cameraTopBarTitle', color: '?sbColorOnPrimary', }); /** Configuration of the 'introduction' button, located in the top bar. */ public topBarIntroButton: IconButton = new IconButton({ color: '?sbColorOnPrimary', accessibilityDescription: '?accessibilityDescriptionCameraTopBarIntroButton', }); /** Configuration of the 'cancel' button, located in the top bar. */ public topBarBackButton: ButtonConfiguration = new ButtonConfiguration({ visible: true, text: '?cameraTopBarCancelButtonTitle', accessibilityDescription: '?accessibilityDescriptionCameraTopBarCancelButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0, }), foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false, }), }); /** Configuration of the static user guidance, located just below the top bar. */ public topUserGuidance: UserGuidanceConfiguration = new UserGuidanceConfiguration({ title: new StyledText({ text: '?cameraTopGuidance', color: '?sbColorOnPrimary' }), }); /** Configuration of the hints guiding users through the scanning process. */ public userGuidance: DocumentScannerUserGuidance = new DocumentScannerUserGuidance({}); /** The background color of the camera screen. Default is "#000000FF" */ public backgroundColor: string = '#000000FF'; /** If set to true, images imported from the gallery/photo library will be analyzed and eventually rotated to correct their orientation. Default is true */ public autoRotateImages: boolean = true; /** Configuration of the camera behavior. */ public cameraConfiguration: DocumentScannerCameraConfiguration = new DocumentScannerCameraConfiguration({}); /** The parameters of the document scanner. */ public scannerParameters: DocumentScannerParameters = new DocumentScannerParameters({}); /** Configuration of the document contour detection polygon. */ public polygon: DocumentPolygonConfiguration = new DocumentPolygonConfiguration({}); /** Configuration of the bottom bar for the camera screen. */ public bottomBar: CameraBottomBar = new CameraBottomBar({}); /** Configuration of the viewfinder. */ public viewFinder: ViewFinderConfiguration = new ViewFinderConfiguration({ aspectRatio: new AspectRatio({ width: 21.0, height: 29.0 }), visible: false, }); /** Configuration of the feedback shown after snapping a page. */ public captureFeedback: CaptureFeedback = new CaptureFeedback({}); /** Configuration of the scan confirmation vibration. */ public vibration: Vibration = new Vibration({ enabled: true }); /** Configuration of timeouts. */ public timeouts: Timeouts = new Timeouts({ autoCancelTimeout: 0, initialScanDelay: 0 }); /** Configuration of the alert dialog displayed when the scan limit is reached. */ public limitReachedAlertDialog: ScanbotAlertDialog = new ScanbotAlertDialog({ title: new StyledText({ text: '?cameraLimitReachedAlertTitle', color: '?sbColorOnSurface' }), subtitle: new StyledText({ text: '?cameraLimitReachedAlertSubtitle', color: '?sbColorOnSurfaceVariant', }), okButton: new ButtonConfiguration({ text: '?cameraLimitReachedOkButtonTitle', accessibilityDescription: '?accessibilityDescriptionCameraLimitReachedOkButton', background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }), }), cancelButton: new ButtonConfiguration({ visible: false }), }); /** Configuration of the alert dialog displayed when the 'cancel' button is pressed. */ public cancelAlertDialog: ScanbotAlertDialog = new ScanbotAlertDialog({ title: new StyledText({ text: '?cameraCancelAlertTitle', color: '?sbColorOnSurface' }), subtitle: new StyledText({ text: '?cameraCancelAlertSubtitle', color: '?sbColorOnSurfaceVariant', }), okButton: new ButtonConfiguration({ text: '?cameraCancelYesButtonTitle', accessibilityDescription: '?accessibilityDescriptionCameraCancelYesButton', background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }), }), cancelButton: new ButtonConfiguration({ text: '?cameraCancelNoButtonTitle', accessibilityDescription: '?accessibilityDescriptionCameraCancelNoButton', background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorPrimary' }), }), }); /** @param source {@displayType `DeepPartial<CameraScreenConfiguration>`} */ public constructor(source: DeepPartial<CameraScreenConfiguration> = {}) { super(); if (source.acknowledgement !== undefined) { this.acknowledgement = new AcknowledgementScreenConfiguration(source.acknowledgement); } if (source.introduction !== undefined) { this.introduction = new IntroductionScreenConfiguration(source.introduction); } if (source.scanAssistanceOverlay !== undefined) { this.scanAssistanceOverlay = new ScanAssistanceOverlay(source.scanAssistanceOverlay); } if (source.cameraPermission !== undefined) { this.cameraPermission = new CameraPermissionScreen(source.cameraPermission); } if (source.topBarTitle !== undefined) { this.topBarTitle = new StyledText(source.topBarTitle); } if (source.topBarIntroButton !== undefined) { this.topBarIntroButton = new IconButton(source.topBarIntroButton); } if (source.topBarBackButton !== undefined) { this.topBarBackButton = new ButtonConfiguration(source.topBarBackButton); } if (source.topUserGuidance !== undefined) { this.topUserGuidance = new UserGuidanceConfiguration(source.topUserGuidance); } if (source.userGuidance !== undefined) { this.userGuidance = new DocumentScannerUserGuidance(source.userGuidance); } if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.autoRotateImages !== undefined) { this.autoRotateImages = source.autoRotateImages; } if (source.cameraConfiguration !== undefined) { this.cameraConfiguration = new DocumentScannerCameraConfiguration(source.cameraConfiguration); } if (source.scannerParameters !== undefined) { this.scannerParameters = new DocumentScannerParameters(source.scannerParameters); } if (source.polygon !== undefined) { this.polygon = new DocumentPolygonConfiguration(source.polygon); } if (source.bottomBar !== undefined) { this.bottomBar = new CameraBottomBar(source.bottomBar); } if (source.viewFinder !== undefined) { this.viewFinder = new ViewFinderConfiguration(source.viewFinder); } if (source.captureFeedback !== undefined) { this.captureFeedback = new CaptureFeedback(source.captureFeedback); } if (source.vibration !== undefined) { this.vibration = new Vibration(source.vibration); } if (source.timeouts !== undefined) { this.timeouts = new Timeouts(source.timeouts); } if (source.limitReachedAlertDialog !== undefined) { this.limitReachedAlertDialog = new ScanbotAlertDialog(source.limitReachedAlertDialog); } if (source.cancelAlertDialog !== undefined) { this.cancelAlertDialog = new ScanbotAlertDialog(source.cancelAlertDialog); } } }