react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
153 lines (133 loc) • 5.4 kB
text/typescript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/DocumentScannerCameraConfiguration.yaml
import { CameraModule } from '../../ui_v2/common/CameraConfiguration';
import { CameraPreviewMode } from '../../ui_v2/common/Common';
import { DeepPartial, PartiallyConstructible } from '../../utils/utils';
/**
Determines the prioritization of still image quality and capturing speed.
- `SPEED`:
Captures a still image at the highest possible speed. The quality of the image may be degraded.
- `BALANCED`:
Balances capturing speed and image quality equally. This is the default value.
- `QUALITY`:
Captures a still image with the best possible quality in terms of noise, frozen motion and detail in low light. The speed of the capturing might be reduced.
*/
export type CapturePhotoQualityPrioritization = 'SPEED' | 'BALANCED' | 'QUALITY';
export const CapturePhotoQualityPrioritizationValues: CapturePhotoQualityPrioritization[] = [
'SPEED',
'BALANCED',
'QUALITY',
];
/**
Configuration of the camera behavior.
*/
export class DocumentScannerCameraConfiguration extends PartiallyConstructible {
/**
Determines which camera module to use on start-up.
Default is BACK
*/
public cameraModule: CameraModule = 'BACK';
/**
The default zoom factor on start-up.
Default is 1.0
*/
public defaultZoomFactor: number = 1.0;
/**
Determines whether the document should be cropped automatically after a manual snap or not.
Default is true
*/
public autoCropOnManualSnap: boolean = true;
/**
Determines whether the flashlight is enabled or not on start-up.
Default is false
*/
public flashEnabled: boolean = false;
/**
Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific).
Default is false
*/
public minFocusDistanceLock: boolean = false;
/**
Determines whether touch-to-focus is enabled or not. Android only.
Default is false
*/
public touchToFocusEnabled: boolean = false;
/**
Determines whether pinch-to-zoom is enabled or not.
Default is true
*/
public pinchToZoomEnabled: boolean = true;
/**
Determines which camera preview mode to use.
Default is FILL_IN
*/
public cameraPreviewMode: CameraPreviewMode = 'FILL_IN';
/**
Determines the prioritization of still image quality and capturing speed.
Default is BALANCED
*/
public captureQualityPrioritization: CapturePhotoQualityPrioritization = 'BALANCED';
/**
Controls the auto snapping speed. The sensitivity must be between 0.0 and 1.0. A value of 1.0 triggers auto snapping immediately, while a value of 0.0 delays the auto snapping by 3 seconds. The default value is 0.66 (2 seconds).
Default is 0.66
*/
public autoSnappingSensitivity: number = 0.66;
/**
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page.
Default is 200
*/
public autoSnappingDelay: number = 200;
/**
Determines if auto snapping is enabled or not.
Default is true
*/
public autoSnappingEnabled: boolean = true;
/**
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. For iOS version 17.2 or later is required. On iPhones with camera control (iPhone 16 series) this also enables zooming and capturing with the camera control.
Default is true
*/
public captureWithHardwareButtonsEnabled: boolean = true;
/** @param source {@displayType `DeepPartial<DocumentScannerCameraConfiguration>`} */
public constructor(source: DeepPartial<DocumentScannerCameraConfiguration> = {}) {
super();
if (source.cameraModule !== undefined) {
this.cameraModule = source.cameraModule;
}
if (source.defaultZoomFactor !== undefined) {
this.defaultZoomFactor = source.defaultZoomFactor;
}
if (source.autoCropOnManualSnap !== undefined) {
this.autoCropOnManualSnap = source.autoCropOnManualSnap;
}
if (source.flashEnabled !== undefined) {
this.flashEnabled = source.flashEnabled;
}
if (source.minFocusDistanceLock !== undefined) {
this.minFocusDistanceLock = source.minFocusDistanceLock;
}
if (source.touchToFocusEnabled !== undefined) {
this.touchToFocusEnabled = source.touchToFocusEnabled;
}
if (source.pinchToZoomEnabled !== undefined) {
this.pinchToZoomEnabled = source.pinchToZoomEnabled;
}
if (source.cameraPreviewMode !== undefined) {
this.cameraPreviewMode = source.cameraPreviewMode;
}
if (source.captureQualityPrioritization !== undefined) {
this.captureQualityPrioritization = source.captureQualityPrioritization;
}
if (source.autoSnappingSensitivity !== undefined) {
this.autoSnappingSensitivity = source.autoSnappingSensitivity;
}
if (source.autoSnappingDelay !== undefined) {
this.autoSnappingDelay = source.autoSnappingDelay;
}
if (source.autoSnappingEnabled !== undefined) {
this.autoSnappingEnabled = source.autoSnappingEnabled;
}
if (source.captureWithHardwareButtonsEnabled !== undefined) {
this.captureWithHardwareButtonsEnabled = source.captureWithHardwareButtonsEnabled;
}
}
}