react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
1,692 lines (1,670 loc) • 52.3 kB
text/typescript
import {Page, Status} from '.';
import type {Size, BarcodeFormat} from '.';
import type {
HealthInsuranceCardValidationType,
BarcodeDocumentFormat,
IDCardDocumentType,
LicensePlateDetectorMode,
MSIPlesseyChecksumAlgorithm,
EngineMode,
TextFilterStrategy,
CameraModule,
InterfaceOrientation,
} from './enum';
import type {
FinderAspectRatio,
JSStringToBoolTextFunction,
JSStringToStringTextFunction,
} from './model';
export interface DocumentScannerAccessibilityConfiguration {
/**
* Text, that is used as an accessibility label for the flash button.
*/
flashButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the flash button.
*/
flashButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the multi-page button.
*/
multiPageButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the multi-page button.
*/
multiPageButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the auto-snapping button.
*/
autoSnappingButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the auto-snapping button.
*/
autoSnappingButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the cancel button.
*/
cancelButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the cancel button.
*/
cancelButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the page-amount button.
*/
pageCounterButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the page-amount button.
*/
pageCounterAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the shutter button.
*/
shutterButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the shutter button.
*/
shutterButtonAccessibilityHint: string;
}
export interface DocumentScannerConfiguration {
/**
* The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document.
* Default is 75.0.
*/
acceptedAngleScore?: number;
/**
* The minimum document width or height in percent (0 - 100) of the screen size to accept a detected document.
* Default is 80.0.
*/
acceptedSizeScore?: number;
/**
* Controls whether the auto-snapping toggle button is hidden or not.
*/
autoSnappingButtonHidden?: boolean;
/**
* Title of the auto-snapping toggle button.
*/
autoSnappingButtonTitle?: string;
/**
* When auto-snapping is enabled the document scanner will take a photo automatically
* when a document is detected, conditions are good and the auto-snapping time-out elapses. In this
* mode the user can still tap the shutter button to snap a document.
*/
autoSnappingEnabled?: boolean;
/**
* Controls the auto-snapping speed. Sensitivity must be within the 0..1 range.
* A value of 1.0 triggers automatic capturing immediately, a value of 0.0 delays the automatic by 3 seconds.
* The default value is 0.66 (2 seconds)
*/
autoSnappingSensitivity?: number;
/**
* The background color of the bottom shutter-bar.
*/
bottomBarBackgroundColor?: string;
/**
* The color of the title of all buttons in the bottom shutter-bar (Cancel button, etc.),
* as well as the camera permission prompt button.
*/
bottomBarButtonsColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* The color of the camera background (relevant only when the camera preview mode is CameraPreviewMode.FIT_IN).
*/
cameraBackgroundColor?: string;
/**
* Title of the cancel button.
*/
cancelButtonTitle?: string;
/**
* Title of the button that opens the screen where the user can allow
* the usage of the camera by the app.
*/
enableCameraButtonTitle?: string;
/**
* Text that will be displayed when the app
* is not allowed to use the camera, prompting the user
* to enable the usage of the camera.
*/
enableCameraExplanationText?: string;
/**
* Controls whether the flash toggle button is hidden or not.
*/
flashButtonHidden?: boolean;
/**
* Title of the flash toggle button.
*/
flashButtonTitle?: string;
/**
* Controls whether the flash should be initially enabled.
* The default value is FALSE.
*/
flashEnabled?: boolean;
/**
* Sets whether to ignore the OK_BUT_BAD_ASPECT_RATIO detection status.
* By default BadAspectRatio is not ignored.
*/
ignoreBadAspectRatio?: boolean;
/**
* The image scaling factor. The factor must be within the 0..1 range.
* A factor of 1 means that the resulting images retain their original size.
* When the factor is less than 1, resulting images will be made smaller by that factor.
* By default the scale is 1.
*/
imageScale?: number;
/**
* Controls whether the multi-page toggle button is hidden or not.
*/
multiPageButtonHidden?: boolean;
/**
* Title of the multi-page mode toggle button.
*/
multiPageButtonTitle?: string;
/**
* Controls multi-page mode. When enabled, the user can take multiple document photos before
* closing the screen by tapping the page counter button. When disabled, the screen will be
* closed immediately after the first document photo is made.
* The default value is FALSE.
*/
multiPageEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Title suffix of the button that finishes the document scanning when multi-page scanning is enabled.
* The button's title has the format "# Pages", where # shows the number of images captured up to now and the
* suffix "Pages" is set using this method.
*/
pageCounterButtonTitle?: string;
/**
* The background color of the detected document outline when the document's angle, size or aspect ratio
* is not yet sufficiently good.
* (All net.doo.snap.lib.detector.DetectionResult with OK_BUT_XXX).
*/
polygonBackgroundColor?: string;
/**
* The background color of the detected document outline when we are ready to snap OK.
*/
polygonBackgroundColorOK?: string;
/**
* The color of the detected document outline when the document's angle, size or aspect ratio
* is not yet sufficiently good.
* (All detection statuses in net.doo.snap.lib.detector.DetectionResult that have the OK_BUT_XXX prefix).
*/
polygonColor?: string;
/**
* The color of the detected document outline when we are ready to snap OK.
*/
polygonColorOK?: string;
/**
* Width of the detected document outline.
*/
polygonLineWidth?: number;
/**
* The radius to use when drawing rounded corners of the polygon. Default is 8.0.
*/
polygonCornerRadius?: number;
/**
* Stroke color of polygon auto snap progress animation. Default is green. Can't be nil.
*/
polygonAutoSnapProgressColor?: string;
/**
* Line width of polygon auto snap progress animation. Default is 5.0.
*/
polygonAutoSnapProgressLineWidth?: number;
/**
* Whether polygon auto snap progress animation is enabled or not. Default is true.
*/
polygonAutoSnapProgressEnabled?: boolean;
/**
* The foreground color of the shutter button in auto-snapping mode.
*/
shutterButtonAutoInnerColor?: string;
/**
* The background color of the shutter button in auto-snapping mode.
*/
shutterButtonAutoOuterColor?: string;
shutterButtonIndicatorColor?: string;
/**
* The foreground color of the shutter button in manual mode.
*/
shutterButtonManualInnerColor?: string;
/**
* The background color of the shutter button in manual mode.
*/
shutterButtonManualOuterColor?: string;
/**
* Text hint that will be shown when the current detection status is OK_BUT_BAD_ANGLES
*/
textHintBadAngles?: string;
/**
* Text hint that will be shown when the current detection status is OK_BUT_BAD_ASPECT_RATIO
*/
textHintBadAspectRatio?: string;
/**
* Text hint that will be shown when the current detection status is ERROR_NOTHING_DETECTED
*/
textHintNothingDetected?: string;
/**
* Text hint that will be shown when the current detection status is OK
*/
textHintOK?: string;
/**
* Text hint that will be shown when the current detection status is ERROR_TOO_DARK
*/
textHintTooDark?: string;
/**
* Text hint that will be shown when the current detection status is ERROR_TOO_NOISY
*/
textHintTooNoisy?: string;
/**
* Text hint that will be shown when the current detection status is OK_BUT_TOO_SMALL
*/
textHintTooSmall?: string;
/**
* The background color of the top toolbar.
*/
topBarBackgroundColor?: string;
/**
* The color of all active toggle buttons in the toolbar.
*/
topBarButtonsActiveColor?: string;
/**
* The color of all inactive toggle buttons in the toolbar.
*/
topBarButtonsInactiveColor?: string;
/**
* The background color of the user guidance hints.
*/
userGuidanceBackgroundColor?: string;
/**
* The text color of the user guidance hints.
*/
userGuidanceTextColor?: string;
/**
* Limits the maximum size of the document image. If width or height are zero, this property is effectively ignored.
*/
documentImageSizeLimit?: Size;
/**
* Hides the shutter button if set to TRUE. Shows it otherwise. Defaults to FALSE.
* If set to TRUE, auto-snapping is enabled and the property autoSnappingEnabled of the behaviour configuration will
* have no effect.
* Also the auto-snapping button will be hidden.
*/
shutterButtonHidden?: boolean;
/**
* The text being displayed on the user-guidance label, when the scanners energy saver is activated.
* iOS only.
*/
textHintEnergySavingActive?: string;
/**
* Maximum number of pages to scan. Ignored when set to null, or when `multiPageEnabled` is FALSE. Default value is null.
*/
maxNumberOfPages?: number;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* Allows you to customize the accessibility configuration for the Document Scanner UI
*/
accessibilityConfiguration?: DocumentScannerAccessibilityConfiguration;
}
export interface CroppingScreenAccessibilityConfiguration {
/**
* Text, that is used as an accessibility label for the cancel button.
*/
cancelButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the cancel button.
*/
cancelButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the done button.
*/
doneButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the done button.
*/
doneButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the detect button.
*/
detectButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the detect button.
*/
detectButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the reset button.
*/
resetButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the reset button.
*/
resetButtonAccessibilityHint: string;
/**
* Text, that is used as an accessibility label for the rotate button.
*/
rotateButtonAccessibilityLabel: string;
/**
* Text, that is used as an accessibility hint for the rotate button.
*/
rotateButtonAccessibilityHint: string;
}
export interface CroppingScreenConfiguration {
/**
* The color of the cropping anchor handles.
*/
anchorPointsColor?: string;
/**
* String being displayed as a hint. Empty by default.
*/
hintTitle?: string;
/**
* Text color of the hint title.
*/
hintTitleColor?: string;
/**
* Background color of the main screen.
*/
backgroundColor?: string;
/**
* Background color of the bottom toolbar.
*/
bottomBarBackgroundColor?: string;
/**
* Color of the titles of all buttons in the bottom toolbar (Rotate button).
*/
bottomBarButtonsColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Title of the cancel button.
*/
cancelButtonTitle?: string;
/**
* Title of the Done button.
*/
doneButtonTitle?: string;
/**
* Default color of the cropping outline.
*/
polygonColor?: string;
/**
* Outline color of magnetically snapped edges.
*/
polygonColorMagnetic?: string;
/**
* Width of the cropping outline.
*/
polygonLineWidth?: number;
/**
* Title of the Rotate button.
*/
rotateButtonTitle?: string;
titleColor?: string;
/**
* Background color of the top toolbar.
*/
topBarBackgroundColor?: string;
/**
* Color of the titles of all buttons in the top toolbar (Cancel and Done buttons).
*/
topBarButtonsColor?: string;
topBarTitle?: string;
/**
* Title of the Detect button.
*/
detectButtonTitle?: string;
/**
* Title of the Reset button.
*/
resetButtonTitle?: string;
/**
* Controls whether the Rotate button is hidden or not.
*/
rotateButtonHidden?: boolean;
/**
* Controls whether the Detect/Reset button is hidden or not.
*/
detectResetButtonHidden?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* Allows you to customize the accessibility configuration for the Cropping Screen UI
*/
accessibilityConfiguration?: CroppingScreenAccessibilityConfiguration;
/**
* Defines if the top and bottom buttons are swapped. Default is false.
*/
topAndBottomButtonsSwapped?: boolean;
}
export interface MrzScannerConfiguration {
/**
* Bottom buttons color for the 'active' state
*/
bottomButtonsActiveColor?: string;
/**
* Bottom buttons color for the 'inactive' state
*/
bottomButtonsInactiveColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color outside of the finder window.
*/
cameraOverlayColor?: string;
/**
* Title of the cancel button.
*/
cancelButtonTitle?: string;
/**
* Title of the button that opens the screen where the user can allow
* the usage of the camera by the app.
*/
enableCameraButtonTitle?: string;
/**
* Text that will be displayed when the app
* is not allowed to use the camera, prompting the user
* to enable the usage of the camera.
*/
enableCameraExplanationText?: string;
/**
* Height of the finder window in pixels.
*/
finderHeight?: number;
/**
* Color of the finder window's outline.
*/
finderLineColor?: string;
/**
* Thickness of the finder window's outline.
*/
finderLineWidth?: number;
/**
* Text hint shown under the finder window.
*/
finderTextHint?: string;
/**
* Color of the text hint under the finder window.
*/
finderTextHintColor?: string;
/**
* Width of the finder window in pixels.
*/
finderWidth?: number;
/**
* The flash button title.
*/
flashButtonTitle?: string;
/**
* Controls whether the flash should be initially enabled.
* The default value is FALSE.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Controls whether to play a beep sound after a successful detection.
* Default value is TRUE.
*/
successBeepEnabled?: boolean;
/**
* Background color of the top toolbar.
*/
topBarBackgroundColor?: string;
/**
* Color of the titles of all buttons in the top toolbar.
*/
topBarButtonsColor?: string;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
}
export interface BarcodeScannerConfiguration {
/**
* An optional array of barcode document formats that act as a detection filter.
* By default all supported document formats will be detected.
*/
acceptedDocumentFormats?: BarcodeDocumentFormat[];
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
* The default value is 0.
*/
cameraZoomFactor?: number;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
* To use legacy recognizer, please specify LEGACY
*/
engineMode?: EngineMode;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* String being displayed as description.
*/
finderTextHint?: string;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
* Default is 1 - it is a square frame, which is good for QR capturing.
*/
finderAspectRatio?: FinderAspectRatio;
/**
* String being displayed on the flash button.
*/
flashButtonTitle?: string;
/**
* Foreground color of the flash button when flash is off.
*/
flashButtonInactiveColor?: string;
/**
* Whether flash is toggled on or off.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Optional minimum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
minimumTextLength?: number;
/**
* Optional maximum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
maximumTextLength?: number;
/**
* Optional minimum required quiet zone on the barcode.
* Measured in modules (the size of minimal bar on the barcode).
* The default is 10.
* NOTE: This feature works on ITF barcodes only.
*/
minimum1DBarcodesQuietZone?: number;
/**
* With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
* Has no effect if both single and double digit MSI Plessey checksums are enabled.
* The default is `false`
*/
stripCheckDigits?: boolean;
/**
* Whether scanner screen should make a sound on successful barcode or MRZ detection.
*/
successBeepEnabled?: boolean;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the cancel button.
*/
topBarButtonsColor?: string;
/**
* Accepted barcode formats
*/
barcodeFormats?: BarcodeFormat[];
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
* Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
* The default value is `true`.
* NOTE: Currently works for CODE128 barcodes only!
*/
gs1DecodingEnabled?: boolean;
/**
* The checksum algorithm for MSI Plessey barcodes.
* The default value is Mod10.
*/
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
/**
* If `true`, enabled the mode which slightly decreases the scanning quality and the energy consumption, and increases the scanning speed. If `false` - mode is disabled.
* The default is `false`
* Android only.
*/
lowPowerMode?: boolean;
}
export interface BatchBarcodeScannerConfiguration {
/**
* An optional array of barcode document formats that act as a detection filter.
* By default all supported document formats will be detected.
*/
acceptedDocumentFormats?: BarcodeDocumentFormat[];
/**
* String used for displaying amount of scanned barcodes. Use %d for number formatting symbol.
*/
barcodesCountText?: string;
/**
* Text color of the barcodes count label.
*/
barcodesCountTextColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
* The default value is 0.
*/
cameraZoomFactor?: number;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* String being displayed on the clear button.
*/
clearButtonTitle?: string;
/**
* String being displayed on the delete button.
*/
deleteButtonTitle?: string;
/**
* Foreground color of the top bar buttons on the details screen.
*/
detailsActionColor?: string;
/**
* Background color of the details screen.
*/
detailsBackgroundColor?: string;
/**
* Text color in the details barcodes list. Also affects image background, separator and progress spinner.
*/
detailsPrimaryColor?: string;
/**
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
* To use legacy recognizer, please specify LEGACY
*/
engineMode?: EngineMode;
/**
* String used to show process of fetching mapped data for barcodes.
*/
fetchingStateText?: string;
/**
* Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
* Default is 1 - it is a square frame, which is good for QR capturing.
*/
finderAspectRatio?: FinderAspectRatio;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* String being displayed as description.
*/
finderTextHint?: string;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* Whether flash is toggled on or off.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* String to show that no barcodes were scanned yet.
*/
noBarcodesTitle?: string;
/**
* Enables or disables the barcode detection.
*/
recognitionEnabled?: boolean;
/**
* With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
* Has no effect if both single and double digit MSI Plessey checksums are enabled.
* The default is `false`
*/
stripCheckDigits?: boolean;
/**
* String being displayed on the submit button.
*/
submitButtonTitle?: string;
/**
* Whether scanner screen should make a sound on successful barcode or MRZ detection.
*/
successBeepEnabled?: boolean;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the top bar buttons on the scanning screen.
*/
topBarButtonsColor?: string;
/**
* Foreground color of the flash button when flash is off.
*/
topBarButtonsInactiveColor?: string;
/**
* Accepted barcode formats
*/
barcodeFormats?: BarcodeFormat[];
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* Optional minimum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
minimumTextLength?: number;
/**
* Optional maximum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
maximumTextLength?: number;
/**
* Optional minimum required quiet zone on the barcode.
* Measured in modules (the size of minimal bar on the barcode).
* The default is 10.
* NOTE: This feature works on ITF barcodes only.
*/
minimum1DBarcodesQuietZone?: number;
/**
* When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
* Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
* The default value is `true`.
* NOTE: Currently works for CODE128 barcodes only!
*/
gs1DecodingEnabled?: boolean;
/**
* The checksum algorithms for MSI Plessey barcodes.
* The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
*/
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
/**
* If `true`, enabled the mode which slightly decreases the scanning quality and the energy consumption, and increases the scanning speed. If `false` - mode is disabled.
* The default is `false`
* Android only.
*/
lowPowerMode?: boolean;
}
export interface HealthInsuranceCardScannerConfiguration {
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* String being displayed when health insurance card was not found.
*/
detectionStatusFailedDetectionText?: string;
/**
* String being displayed when health insurance card was found but not recognized.
*/
detectionStatusFailedValidationText?: string;
/**
* String being displayed when health insurance card was found and recognized.
*/
detectionStatusSuccessText?: string;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* String being displayed as description.
*/
finderTextHint?: string;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* String being displayed on the flash button.
*/
flashButtonTitle?: string;
/**
* Whether flash is toggled on or off.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Enables or disables the machine readable zones detection.
*/
recognitionEnabled?: boolean;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the cancel button and the flash button (iOS only) when the flash is active.
*/
topBarButtonsColor?: string;
/**
* Foreground color of the flash button when flash is off (iOS only)
*/
flashButtonInactiveColor?: string;
/**
* The type of health insurance card validation.
*/
validationType?: HealthInsuranceCardValidationType;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
}
export interface IdCardScannerConfiguration {
/**
* Accepted document types. All other document types will be ignored.
* By default - DeIdFront and DeIdBack
*/
acceptedDocumentTypes?: IDCardDocumentType[];
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* Whether the cancel button is hidden or not (iOS only)
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* String being displayed on the clear button.
*/
clearButtonTitle?: string;
/**
* String that shows average confidence value of scanned card. Use %li as number formatting symbol.
*/
confidenceValue?: string;
/**
* Foreground color of the top bar buttons on the details screen.
*/
detailsActionColor?: string;
/**
* Background color of the details screen.
*/
detailsBackgroundColor?: string;
/**
* Text color in the details list. Also affects image background and separator.
*/
detailsPrimaryColor?: string;
/**
* The title for the results group in the ID card scanner list, for `DePassport`
*/
dePassportDocumentTitle?: string;
/**
* The title for the results group in the ID card scanner list, for `DeIdCardBack`
*/
deIdCardBackDocumentTitle?: string;
/**
* The title for the results group in the ID card scanner list, for `DeIdCardFront`
*/
deIdCardFrontDocumentTitle?: string;
/**
* A title for address field in details screen.
*/
fieldAddressTitle?: string;
/**
* A title for birth date field in details screen.
*/
fieldBirthDateTitle?: string;
/**
* A title for birth place field in details screen.
*/
fieldBirthPlaceTitle?: string;
/**
* Color of confidence value label background in details screen, when the field confidence level is high.
*/
fieldConfidenceHighColor?: string;
/**
* Color of confidence value label background in details screen, when the field confidence level is low.
*/
fieldConfidenceLowColor?: string;
/**
* Color of confidence value label background in details screen, when the field confidence level is moderate.
*/
fieldConfidenceModerateColor?: string;
/**
* Color of confidence value label text in details. Use %d for number formatting symbol.
*/
fieldConfidenceTextColor?: string;
/**
* A title for country code field in details screen.
*/
fieldCountryCodeTitle?: string;
/**
* A title for expiry date field in details screen.
*/
fieldExpiryDateTitle?: string;
/**
* A title for eye color field in details screen.
*/
fieldEyeColorTitle?: string;
/**
* A title for gender field in details screen.
*/
fieldGenderTitle?: string;
/**
* A title for given names field in details screen.
*/
fieldGivenNamesTitle?: string;
/**
* A title for height field in details screen.
*/
fieldHeightTitle?: string;
/**
* A title for id field in details screen.
*/
fieldIDTitle?: string;
/**
* A title for issuing date field in details screen.
*/
fieldIssueDateTitle?: string;
/**
* A title for issuing authority field in details screen.
*/
fieldIssuingAuthorityTitle?: string;
/**
* A title for maiden name field in details screen.
*/
fieldMaidenNameTitle?: string;
/**
* A title for machine readable zone field in details screen.
*/
fieldMRZTitle?: string;
/**
* A title for nationality field in details screen.
*/
fieldNationalityTitle?: string;
/**
* A title for passport type field in details screen.
*/
fieldPassportTypeTitle?: string;
/**
* A title for photo field in details screen.
*/
fieldPhotoTitle?: string;
/**
* A title for PIN field in details screen.
*/
fieldPINTitle?: string;
/**
* A title for pseudonym field in details screen.
*/
fieldPseudonymTitle?: string;
/**
* String used for displaying amount of detected fields. Use %li for number formatting symbol.
*/
fieldsCountText?: string;
/**
* Text color of the fields count label. Use %d for number formatting symbol.
*/
fieldsCountTextColor?: string;
/**
* A title for signature field in details screen.
*/
fieldSignatureTitle?: string;
/**
* A title for surname field in details screen.
*/
fieldSurnameTitle?: string;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* Whether the torch light is toggled on or off.
*/
flashEnabled?: boolean;
/**
* A title to show image content.
*/
imageTitle?: string;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* String that notifies that nothing was scanned yet.
*/
noDataTitle?: string;
/**
* String that asks user to scan back side of a card.
*/
scanBackSideTitle?: string;
/**
* String that asks user to scan front side of a card.
*/
scanFrontSideTitle?: string;
/**
* String that notifies that both sides of card are scanned.
*/
scannedEverythingTitle?: string;
/**
* Defines, if photo image should be stored in internal storage (SBSDKUIIDCardStorage) on disk.
*/
shouldSavePhotoImageInStorage?: boolean;
/**
* Defines, if signature image should be stored in internal storage (SBSDKUIIDCardStorage) on disk.
*/
shouldSaveSignatureImageInStorage?: boolean;
/**
* String that asks user to start scanning a card.
*/
startScanningTitle?: string;
/**
* String being displayed on the 'View Results' button.
*/
viewResultsButtonTitle?: string;
/**
* Color of tip background on scanning screen.
*/
tipBackgroundColor?: string;
/**
* Color of tip text on scanning screen.
*/
tipTextColor?: string;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the top bar buttons on the scanning screen.
*/
topBarButtonsColor?: string;
/**
* Foreground color of the flash button when flash is off.
*/
topBarButtonsInactiveColor?: string;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* The accepted minimal sharpness score. Images with a score less than that will
* be rejected with blurry status.
*
* 0 - any image will be accepted (NOTE: the value must be > 0 for the ID Card Scanner to work)
* 80 - a good compromise; the recommended setting.
* 100 - only very sharp images will be accepted.
*
* The default value is 80.
*/
sharpnessAcceptanceFactor?: number;
}
export interface TextDataScannerConfiguration {
/**
* A string (list) of accepted characters during text recognition.
* If empty or nil, all characters are accepted.
* Defaults to nil.
*/
allowedSymbols?: string[];
/**
* The aspect ratio for the workflow steps region of interest and, equally, for the finder view.
* Defaults to 5:1.
*/
aspectRatio?: FinderAspectRatio;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* Foreground color of the flash button when flash is off.
*/
flashButtonInactiveColor?: string;
/**
* Whether flash is toggled on or off.
*/
flashEnabled?: boolean;
/**
* A user guidance hint for this workflow step.
* The guidance hint is displayed while the workflow step is active.
*/
guidanceText?: string;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* The maximum number of accumulated video frames before the current recognition result is returned.
*/
maximumNumberOfAccumulatedFrames?: any;
/**
* The minimum equal results in accumulated video frames to count as valid.
*/
minimumNumberOfRequiredFramesWithEqualRecognitionResult?: any;
/**
* Maximum image side length (height or width) for OCR processing.
* If the initial image has longer side - it will be downscaled to the limit.
* Setting to 0 means no limit. Default is 0.
* Using this parameter might be useful for slower devices or to reduce processing load.
*/
ocrResolutionLimit?: any;
/**
* Sets a validation pattern to validate to automatically validate recognized text.
* ‘?’ = any character
* ‘#’ - any digit
* All other characters represent themselves.
*/
pattern?: string;
/**
* The cameras zoom level preferred for this step. The actual zoom might be different from the preferred one
* to avoid clipping of finder area and maintain its aspect ratio and height;
*/
preferredZoom?: number;
/**
* Enables or disables the recognition.
*/
recognitionEnabled?: boolean;
/**
* If set to true pattern validation also validates successfully if only a part of the whole recognized text matches
* the the validation pattern.
* If set to false, the whole text must match the validation pattern.
* Applies to pattern validation only. Defaults to false.
*/
shouldMatchSubstring?: boolean;
/**
* ! EXPERIMENTAL !
* Callback to clean a recognized text prior to validation. Filter out unwanted phrases and textual noise here.
* Default is nil.
* eg.
*
* (text) => {
* let out = text.toUpperCase();
* if (out[0] === 'X') {
* out = out.replace('X', '');
* }
* return out;
* }
*
* Notes:
* • Use JSStringToStringTextFunctionBuilder! Do not set this manually;
* • Do not reference any external library or any variable that is declared outside of the
* scope of the function
*/
stringSanitizerBlock?: JSStringToStringTextFunction;
/**
* A string of two-letter ISO 639-1 language codes, separated by ‘+’,
* the OCR engine should use for recognition. E.g. “de+en”
* (german and english) “ar+he+ja” (arabic, hebrew and japanese).
* If the string is invalid or nil the user preferred languages are used.
* Ignores white spaces, invalid languages and invalid characters.
*/
supportedLanguages?: string;
/**
* The title of the step.
* By default it is an empty.
*/
title?: string;
/**
* Recognition strategy for the text. Default is 'Document'.
*/
textFilterStrategy?: TextFilterStrategy;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the cancel button and when flash button is on.
*/
topBarButtonsColor?: string;
/**
* The preferred height of the finder for zoom scale 1.0 (unzoomed).
* The actual finder height might change to maintain aspect ratio and to not clip the screen.
* Defaults to 40 points.
*/
unzoomedFinderHeight?: number;
/**
* ! EXPERIMENTAL !
* Callback block for recognized text validation. If pattern validation is not powerful enough, you can
* specify your own validation block here. Defaults to nil.
* eg.
*
* (text) => {
* let firstLetter = text[0].toUpperCase();
* let length = text.length;
* return firstLetter === 'A' && length >= 4 && length < 20;
* }
*
* Notes:
* • Use JSStringToBoolTextFunctionBuilder! Do not set this manually;
* • Do not reference any external library or any variable that is declared outside of the
* scope of the function
*/
validationBlock?: JSStringToBoolTextFunction;
/**
* The color of the word boxes. It is recommended to use colors with alpha < 0.5.
*/
wordBoxHighlightColor?: string;
/**
* Whether the word boxes should be shown.
*/
wordBoxHighlightEnabled?: boolean;
}
export interface LicensePlateScannerConfiguration {
/**
* Foreground color of the top bar buttons when they are active.
*/
topBarButtonsColor?: string;
/**
* Foreground color of the top bar buttons when they are inactive.
*/
topBarButtonsInactiveColor?: string;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* Whether the flash light is toggled on or off.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* The maximum number of accumulated video frames before the current recognition result is returned. Defaults to 3.
*/
maximumNumberOfAccumulatedFrames?: number;
/**
* The minimum equal results in accumulated video frames to count as valid. Defaults to 2.
*/
minNumberOfRequiredFramesWithEqualRecognitionResult?: number;
/**
* The detector mode used to find a license plate in an image (CLASSIC or ML_BASED). Default value is ML_BASED.
*/
detectorMode?: LicensePlateDetectorMode;
/**
* The string being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* The string being displayed as description.
*/
finderTextHint?: string;
/**
* The title of the confirmation dialog.
*/
confirmationDialogTitle?: string;
/**
* The message text of the confirmation dialog.
*/
confirmationDialogMessage?: string;
/**
* The title of the confirmation dialog retry button.
*/
confirmationDialogRetryButtonTitle?: string;
/**
* The title of the confirmation dialog confirm button.
*/
confirmationDialogConfirmButtonTitle?: string;
/**
* Whether the confirm button of the confirmation dialog should be filled or not
*/
confirmationDialogConfirmButtonFilled?: boolean;
/**
* The text of the confirm button in the confirmation dialog when the button is filled
*/
confirmationDialogConfirmButtonFilledTextColor?: string;
/**
* The accent color used for styling the confirmation dialog
*/
confirmationDialogAccentColor?: string;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
}
export interface MedicalCertificateScannerConfiguration {
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Title of the cancel button.
*/
cancelButtonTitle?: string;
/**
* Title of the button that opens the screen where the user can allow
* the usage of the camera by the app.
*/
enableCameraButtonTitle?: string;
/**
* Text that will be displayed when the app
* is not allowed to use the camera, prompting the user
* to enable the usage of the camera.
*/
enableCameraExplanationText?: string;
/**
* Controls whether the flash should be initially enabled.
* The default value is FALSE.
*/
flashEnabled?: boolean;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* The color of all active toggle buttons in the toolbar.
*/
topBarButtonsActiveColor?: string;
/**
* Foreground color of the flash button when the flash is off.
*/
topBarButtonsInactiveColor?: string;
/**
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
* Android only.
*/
useButtonsAllCaps?: boolean;
/**
* The background color of the user guidance hints.
*/
userGuidanceBackgroundColor?: string;
/**
* The text color of the user guidance hints.
*/
userGuidanceTextColor?: string;
/*
* Whether the information of the patient (name, address) is extracted or not.
* The default value is true.
*/
extractPatientInfo?: boolean;
/**
* Whether the cancel button is hidden or not.
* The default value is false.
* iOS only.
*/
cancelButtonHidden?: boolean;
guidanceText?: {
/** String being displayed when capturing a photo of a medical certificate. */
capturing?: string;
/** String being displayed when recognizing a medical certificate. */
recognizing?: string;
/** String being displayed when searching for a medical certificate. */
searching?: string;
/** String being displayed when scanning starts for a medical certificate. */
scanningStarted?: string;
/**
* String being displayed when the detection is paused.
* iOS only
*/
paused?: string;
/**
* String being displayed when energy saving is active.
* iOS only
*/
energySaving?: string;
};
errorDialogText?: {
/** String being displayed as the button text in the error alert that may occur when the recognition fails on captured images. */
button?: string;
/** String being displayed as the title in the error alert that may occur when the recognition fails on captured images. */
title?: string;
/** String being displayed as the message in the error alert that may occur when the recognition fails on captured images. */
message?: string;
};
}
export interface NFCPassportReaderConfiguration {
/**
* A title for the error, when NFC reader failed to perform authentication.
*/
authenticationErrorTitle?: string;
/**
* The preferred camera module (default: BACK)
*/
cameraModule?: CameraModule;
/**
* Background color of the detection overlay.
*/
cameraOverlayColor?: string;
/**
* Whether the cancel button is hidden or not.
*/
cancelButtonHidden?: boolean;
/**
* String being displayed on the cancel button.
*/
cancelButtonTitle?: string;
/**
* A title for the error, when NFC reader failed to download the data.
*/
downloadErrorTitle?: string;
/**
* A hint that notifies about downloading datagroups.
*/
downloadingDataTitle?: string;
/**
* Foreground color of the detection overlay.
*/
finderLineColor?: string;
/**
* Width of inner finder frame border. Default is 2.
*/
finderLineWidth?: number;
/**
* String being displayed as description.
*/
finderTextHint?: string;
/**
* Foreground color of the description label.
*/
finderTextHintColor?: string;
/**
* Whether flash is toggled on or off.
*/
flashEnabled?: boolean;
/**
* String being displayed as a hint to hold device over the NFC chip.
*/
holdOverTheChipTitle?: string;
/**
* UI Interface orientation lock mode (PORTRAIT, LANDSCAPE, ALL)
*/
interfaceOrientation?: InterfaceOrientation;
/**
* A title for the state when there is no NFC chip installed on the device, or it is not available.
*/
noChipErrorTitle?: string;
/**
* The owner's photo image URL. Storage for this URL can be controlled with SBSDKUINFCPassportReaderStorage.
*/
photoImageURL?: string;
/**
* Color of the progress bar.
*/
progressBarColor?: string;
/**
* Defines, if photo image should be stored in internal storage (SBSDKUINFCPassportReaderStorage) on disk.
*/
shouldSavePhotoImageInStorage?: boolean;
/**
* Whether scanner screen should make a sound on successful MRZ detection.
*/
successBeepEnabled?: boolean;
/**
* Background color of the top bar.
*/
topBarBackgroundColor?: string;
/**
* Foreground color of the cancel button and selected flash button.
*/
topBarButtonsColor?: string;
/**
* Foreground color of the flash button when the flash is off.
*/
topBarButtonsInactiveColor?: string;
}
interface InternalBarcodeDetectionCommonParameters {
/**
* Accepted barcode formats
*/
barcodeFormats?: BarcodeFormat[];
/**
* An optional array of barcode document formats that act as a detection filter.
* By default all supported document formats will be detected.
*/
acceptedDocumentFormats?: BarcodeDocumentFormat[];
/**
* Optional minimum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
minimumTextLength?: number;
/**
* Optional maximum required text length of the detected barcode.
* The default is 0 (setting is turned off).
* NOTE: This feature works on ITF barcodes only.
*/
maximumTextLength?: number;
/**
* Optional minimum required quiet zone on the barcode.
* Measured in modules (the size of minimal bar on the barcode).
* The default is 10.
* NOTE: This feature works on ITF barcodes only.
*/
minimum1DBarcodesQuietZone?