react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
173 lines (154 loc) • 6.14 kB
text/typescript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/DocumentScannerUserGuidance.yaml
import { BackgroundStyle, StyledText } from '../../ui_v2/common/Common';
import { UserGuidanceVisibility } from '../../ui_v2/document/DocumentScannerGuidanceVisibility';
import { DeepPartial, PartiallyConstructible } from '../../utils/utils';
/**
Configure the titles of the user guidance hints for different states.
*/
export class UserGuidanceStates extends PartiallyConstructible {
/**
The user guidance text displayed when no document is found.
Default is "?cameraUserGuidanceNoDocumentFound"
*/
public noDocumentFound: string = '?cameraUserGuidanceNoDocumentFound';
/**
The user guidance text displayed a detected documents aspect ratio is not within the acceptable range.
Default is "?cameraUserGuidanceBadAspectRatio"
*/
public badAspectRatio: string = '?cameraUserGuidanceBadAspectRatio';
/**
The user guidance text displayed when the document pitch/skew angle is unacceptable.
Default is "?cameraUserGuidanceBadAngles"
*/
public badAngles: string = '?cameraUserGuidanceBadAngles';
/**
The user guidance text displayed when a landscape document is detected when the camera is in portrait mode (and vice versa).
Default is "?cameraUserGuidanceOrientationMismatch"
*/
public orientationMismatch: string = '?cameraUserGuidanceOrientationMismatch';
/**
The user guidance text displayed when the document is not centered in the finder view.
Default is "?cameraUserGuidanceTextHintOffCenter"
*/
public textHintOffCenter: string = '?cameraUserGuidanceTextHintOffCenter';
/**
The user guidance text displayed when the document is too far from camera.
Default is "?cameraUserGuidanceTooSmall"
*/
public tooSmall: string = '?cameraUserGuidanceTooSmall';
/**
The user guidance text displayed when the background is too noisy.
Default is "?cameraUserGuidanceTooNoisy"
*/
public tooNoisy: string = '?cameraUserGuidanceTooNoisy';
/**
The user guidance text displayed when it is too dark to capture an adequate image.
Default is "?cameraUserGuidanceTooDark"
*/
public tooDark: string = '?cameraUserGuidanceTooDark';
/**
The user guidance text displayed when the device is in energy saving mode. iOS only.
Default is "?cameraUserGuidanceEnergySaveMode"
*/
public energySaveMode: string = '?cameraUserGuidanceEnergySaveMode';
/**
The user guidance text displayed when the document is ready to be captured in 'auto snapping' mode.
Default is "?cameraUserGuidanceReadyToCapture"
*/
public readyToCapture: string = '?cameraUserGuidanceReadyToCapture';
/**
The user guidance text displayed when the document is being captured and user needs to hold the device still.
Default is "?cameraUserGuidanceReadyToCapture"
*/
public capturing: string = '?cameraUserGuidanceReadyToCapture';
/**
The user guidance text displayed when the document is ready to be captured in 'manual snapping' mode.
Default is "?cameraUserGuidanceReadyToCaptureManual"
*/
public captureManual: string = '?cameraUserGuidanceReadyToCaptureManual';
/** @param source {@displayType `DeepPartial<UserGuidanceStates>`} */
public constructor(source: DeepPartial<UserGuidanceStates> = {}) {
super();
if (source.noDocumentFound !== undefined) {
this.noDocumentFound = source.noDocumentFound;
}
if (source.badAspectRatio !== undefined) {
this.badAspectRatio = source.badAspectRatio;
}
if (source.badAngles !== undefined) {
this.badAngles = source.badAngles;
}
if (source.orientationMismatch !== undefined) {
this.orientationMismatch = source.orientationMismatch;
}
if (source.textHintOffCenter !== undefined) {
this.textHintOffCenter = source.textHintOffCenter;
}
if (source.tooSmall !== undefined) {
this.tooSmall = source.tooSmall;
}
if (source.tooNoisy !== undefined) {
this.tooNoisy = source.tooNoisy;
}
if (source.tooDark !== undefined) {
this.tooDark = source.tooDark;
}
if (source.energySaveMode !== undefined) {
this.energySaveMode = source.energySaveMode;
}
if (source.readyToCapture !== undefined) {
this.readyToCapture = source.readyToCapture;
}
if (source.capturing !== undefined) {
this.capturing = source.capturing;
}
if (source.captureManual !== undefined) {
this.captureManual = source.captureManual;
}
}
}
/**
Configuration of the hints guiding users through the scanning process.
*/
export class DocumentScannerUserGuidance extends PartiallyConstructible {
/**
Determines when the user guidance hints should be visible.
Default is ENABLED
*/
public visibility: UserGuidanceVisibility = 'ENABLED';
/**
Configure the text style for the user guidance hints.
*/
public title: StyledText = new StyledText({
text: '?cameraUserGuidanceStart',
color: '?sbColorOnPrimary',
});
/**
Configure the background style for the user guidance hints.
*/
public background: BackgroundStyle = new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '?sbColorSurfaceHigh',
});
/**
Configure the titles of the user guidance hints for different states.
*/
public statesTitles: UserGuidanceStates = new UserGuidanceStates({});
/** @param source {@displayType `DeepPartial<DocumentScannerUserGuidance>`} */
public constructor(source: DeepPartial<DocumentScannerUserGuidance> = {}) {
super();
if (source.visibility !== undefined) {
this.visibility = source.visibility;
}
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.background !== undefined) {
this.background = new BackgroundStyle(source.background);
}
if (source.statesTitles !== undefined) {
this.statesTitles = new UserGuidanceStates(source.statesTitles);
}
}
}