react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
170 lines (158 loc) • 6.18 kB
text/typescript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/AcknowledgementScreenConfiguration.yaml
import { DocumentQuality } from '../../dqa/DocumentQualityAnalyzerTypes';
import {
BackgroundStyle,
BarButtonConfiguration,
IconStyle,
StyledText,
} from '../../ui_v2/common/Common';
import { IconUserGuidanceConfiguration } from '../../ui_v2/common/UserGuidanceConfiguration';
import { DeepPartial, PartiallyConstructible } from '../../utils/utils';
/**
Determines, after each page is snapped, whether the acknowledgment screen should be displayed or not.
- `BAD_QUALITY`:
The acknowledgement screen will only be shown when the quality of a scanned page is unacceptable. The quality threshold is determined by the `minimumQuality` parameter.
- `ALWAYS`:
The acknowledgement screen will always be shown after each snap, regardless of the scanned page's quality.
- `NONE`:
The acknowledgement screen will be disabled, in effect never shown.
*/
export type AcknowledgementMode = 'BAD_QUALITY' | 'ALWAYS' | 'NONE';
export const AcknowledgementModeValues: AcknowledgementMode[] = ['BAD_QUALITY', 'ALWAYS', 'NONE'];
/**
Configuration of the bottom bar for the acknowledgement screen.
*/
export class AcknowledgementBottomBar extends PartiallyConstructible {
/**
Configuration of the 'retake' button.
*/
public retakeButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({
text: '?acknowledgementRetakeButtonTitle',
color: '?sbColorOnPrimary',
}),
accessibilityDescription: '?accessibilityDescriptionAcknowledgementRetakeButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'accept' button, when the quality of the scanned page is acceptable.
*/
public acceptWhenOkButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({
text: '?acknowledgementAcceptButtonTitle',
color: '?sbColorOnPrimary',
}),
accessibilityDescription: '?accessibilityDescriptionAcknowledgementAcceptButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/**
Configuration of the 'accept' button, when the quality of the scanned page is unacceptable.
*/
public acceptWhenNotOkButton: BarButtonConfiguration = new BarButtonConfiguration({
title: new StyledText({
text: '?acknowledgementAcceptButtonTitle',
color: '?sbColorOnPrimary',
}),
accessibilityDescription: '?accessibilityDescriptionAcknowledgementAcceptButton',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
});
/** @param source {@displayType `DeepPartial<AcknowledgementBottomBar>`} */
public constructor(source: DeepPartial<AcknowledgementBottomBar> = {}) {
super();
if (source.retakeButton !== undefined) {
this.retakeButton = new BarButtonConfiguration(source.retakeButton);
}
if (source.acceptWhenOkButton !== undefined) {
this.acceptWhenOkButton = new BarButtonConfiguration(source.acceptWhenOkButton);
}
if (source.acceptWhenNotOkButton !== undefined) {
this.acceptWhenNotOkButton = new BarButtonConfiguration(source.acceptWhenNotOkButton);
}
}
}
/**
Configuration of the acknowledgement screen.
*/
export class AcknowledgementScreenConfiguration extends PartiallyConstructible {
/**
Configuration of the title, located in the top bar.
*/
public topBarTitle: StyledText = new StyledText({
visible: false,
text: '?acknowledgementTitle',
color: '?sbColorOnPrimary',
});
/**
The minimum quality of a scanned page to be deemed acceptable. Used in conjunction with the acknowledgement mode.
Default is POOR
*/
public minimumQuality: DocumentQuality = 'POOR';
/**
Determines, after each page is snapped, whether the acknowledgment screen should be displayed or not.
Default is ALWAYS
*/
public acknowledgementMode: AcknowledgementMode = 'ALWAYS';
/**
Configuration of the hint that explains that the quality of the scanned page is unacceptable.
*/
public badImageHint: IconUserGuidanceConfiguration = new IconUserGuidanceConfiguration({
visible: true,
icon: new IconStyle({ color: '?sbColorOnPrimary' }),
title: new StyledText({
text: '?acknowledgementScreenBadDocumentHint',
color: '?sbColorOnPrimary',
}),
background: new BackgroundStyle({
strokeColor: '?sbColorNegative',
fillColor: '?sbColorNegative',
strokeWidth: 0.0,
}),
});
/**
The background color of the acknowledgement screen.
Default is "?sbColorOutline"
*/
public backgroundColor: string = '?sbColorOutline';
/**
Configuration of the bottom bar for the acknowledgement screen.
*/
public bottomBar: AcknowledgementBottomBar = new AcknowledgementBottomBar({});
/** @param source {@displayType `DeepPartial<AcknowledgementScreenConfiguration>`} */
public constructor(source: DeepPartial<AcknowledgementScreenConfiguration> = {}) {
super();
if (source.topBarTitle !== undefined) {
this.topBarTitle = new StyledText(source.topBarTitle);
}
if (source.minimumQuality !== undefined) {
this.minimumQuality = source.minimumQuality;
}
if (source.acknowledgementMode !== undefined) {
this.acknowledgementMode = source.acknowledgementMode;
}
if (source.badImageHint !== undefined) {
this.badImageHint = new IconUserGuidanceConfiguration(source.badImageHint);
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.bottomBar !== undefined) {
this.bottomBar = new AcknowledgementBottomBar(source.bottomBar);
}
}
}