react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
889 lines (781 loc) • 22.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Vibration = exports.Timeouts = exports.StyledText = exports.SoundTypeValues = exports.Sound = exports.RoundButton = exports.PopupMenuItem = exports.PolygonStyle = exports.Palette = exports.OrientationLockModeValues = exports.IconStyle = exports.IconButton = exports.ForegroundStyle = exports.EdgeInsets = exports.CameraPreviewModeValues = exports.ButtonConfiguration = exports.BarButtonConfiguration = exports.BadgedButton = exports.BadgeStyle = exports.BackgroundStyle = void 0;
var _utils = require("../../utils/utils");
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/common/Common.yaml
/**
Value palette describing the colors of the scanner screens.
*/
class Palette extends _utils.PartiallyConstructible {
/**
The primary color used for enabled elements.
Default is "#C8193C"
*/
sbColorPrimary = '#C8193C';
/**
The primary color used for disabled elements.
Default is "#F5F5F5"
*/
sbColorPrimaryDisabled = '#F5F5F5';
/**
The color used to convey a negative meaning.
Default is "#FF3737"
*/
sbColorNegative = '#FF3737';
/**
The color used to convey a positive meaning.
Default is "#4EFFB4"
*/
sbColorPositive = '#4EFFB4';
/**
The color used to convey warnings.
Default is "#FFCE5C"
*/
sbColorWarning = '#FFCE5C';
/**
The secondary color used for enabled elements.
Default is "#FFEDEE"
*/
sbColorSecondary = '#FFEDEE';
/**
The secondary color used for disabled elements.
Default is "#F5F5F5"
*/
sbColorSecondaryDisabled = '#F5F5F5';
/**
The color used for displaying elements on top of the primary color.
Default is "#FFFFFF"
*/
sbColorOnPrimary = '#FFFFFF';
/**
The color used for displaying elements on top of the secondary color.
Default is "#C8193C"
*/
sbColorOnSecondary = '#C8193C';
/**
The color used for surfaces.
Default is "#FFFFFF"
*/
sbColorSurface = '#FFFFFF';
/**
The color used for outlines.
Default is "#EFEFEF"
*/
sbColorOutline = '#EFEFEF';
/**
The alternative color used on top of surfaces.
Default is "#707070"
*/
sbColorOnSurfaceVariant = '#707070';
/**
The color used on top of surfaces.
Default is "#000000"
*/
sbColorOnSurface = '#000000';
/**
The color with a low alpha (transparency) value used for certain surfaces.
Default is "#00000026"
*/
sbColorSurfaceLow = '#00000026';
/**
The color with a high alpha (transparency) value used for certain surfaces.
Default is "#0000007A"
*/
sbColorSurfaceHigh = '#0000007A';
/**
The color with a very high alpha (transparency) value used to fill certain overlays.
Default is "#000000A3"
*/
sbColorModalOverlay = '#000000A3';
/** @param source {@displayType `DeepPartial<Palette>`} */
constructor(source = {}) {
super();
if (source.sbColorPrimary !== undefined) {
this.sbColorPrimary = source.sbColorPrimary;
}
if (source.sbColorPrimaryDisabled !== undefined) {
this.sbColorPrimaryDisabled = source.sbColorPrimaryDisabled;
}
if (source.sbColorNegative !== undefined) {
this.sbColorNegative = source.sbColorNegative;
}
if (source.sbColorPositive !== undefined) {
this.sbColorPositive = source.sbColorPositive;
}
if (source.sbColorWarning !== undefined) {
this.sbColorWarning = source.sbColorWarning;
}
if (source.sbColorSecondary !== undefined) {
this.sbColorSecondary = source.sbColorSecondary;
}
if (source.sbColorSecondaryDisabled !== undefined) {
this.sbColorSecondaryDisabled = source.sbColorSecondaryDisabled;
}
if (source.sbColorOnPrimary !== undefined) {
this.sbColorOnPrimary = source.sbColorOnPrimary;
}
if (source.sbColorOnSecondary !== undefined) {
this.sbColorOnSecondary = source.sbColorOnSecondary;
}
if (source.sbColorSurface !== undefined) {
this.sbColorSurface = source.sbColorSurface;
}
if (source.sbColorOutline !== undefined) {
this.sbColorOutline = source.sbColorOutline;
}
if (source.sbColorOnSurfaceVariant !== undefined) {
this.sbColorOnSurfaceVariant = source.sbColorOnSurfaceVariant;
}
if (source.sbColorOnSurface !== undefined) {
this.sbColorOnSurface = source.sbColorOnSurface;
}
if (source.sbColorSurfaceLow !== undefined) {
this.sbColorSurfaceLow = source.sbColorSurfaceLow;
}
if (source.sbColorSurfaceHigh !== undefined) {
this.sbColorSurfaceHigh = source.sbColorSurfaceHigh;
}
if (source.sbColorModalOverlay !== undefined) {
this.sbColorModalOverlay = source.sbColorModalOverlay;
}
}
}
/**
Configuration of the text field appearance.
*/
exports.Palette = Palette;
class StyledText extends _utils.PartiallyConstructible {
/**
Determines whether the text field is visible or not.
Default is true
*/
visible = true;
/**
The value of the text field.
Default is ""
*/
text = '';
/**
The text color.
Default is "#FFFFFF"
*/
color = '#FFFFFF';
/**
Determines whether to enable drop shadows for the text.
Default is false
*/
useShadow = false;
/** @param source {@displayType `DeepPartial<StyledText>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.text !== undefined) {
this.text = source.text;
}
if (source.color !== undefined) {
this.color = source.color;
}
if (source.useShadow !== undefined) {
this.useShadow = source.useShadow;
}
}
}
/**
Configuration of the icon appearance.
*/
exports.StyledText = StyledText;
class IconStyle extends _utils.PartiallyConstructible {
/**
Determines whether the icon is visible or not.
Default is true
*/
visible = true;
/**
The icon color.
Default is "#FFFFFF"
*/
color = '#FFFFFF';
/** @param source {@displayType `DeepPartial<IconStyle>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.color !== undefined) {
this.color = source.color;
}
}
}
/**
Configuration of the icon appearance on a button.
*/
exports.IconStyle = IconStyle;
class IconButton extends _utils.PartiallyConstructible {
/**
Determines whether the icon is visible on the button.
Default is true
*/
visible = true;
/**
The icon color.
Default is "#FFFFFF"
*/
color = '#FFFFFF';
/**
The text to be read when the button is selected through accessibility mode.
Default is ""
*/
accessibilityDescription = '';
/** @param source {@displayType `DeepPartial<IconButton>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.color !== undefined) {
this.color = source.color;
}
if (source.accessibilityDescription !== undefined) {
this.accessibilityDescription = source.accessibilityDescription;
}
}
}
/**
Configuration of the polygon appearance.
*/
exports.IconButton = IconButton;
class PolygonStyle extends _utils.PartiallyConstructible {
/**
The color of the polygon outline.
Default is "#FFFFFFFF"
*/
strokeColor = '#FFFFFFFF';
/**
The fill color of the polygon.
Default is "#FFFFFF30"
*/
fillColor = '#FFFFFF30';
/**
The width of the polygon outline in dp.
Default is 2.0
*/
strokeWidth = 2.0;
/**
The corner radius of the polygon in dp.
Default is 0.0
*/
cornerRadius = 0.0;
/** @param source {@displayType `DeepPartial<PolygonStyle>`} */
constructor(source = {}) {
super();
if (source.strokeColor !== undefined) {
this.strokeColor = source.strokeColor;
}
if (source.fillColor !== undefined) {
this.fillColor = source.fillColor;
}
if (source.strokeWidth !== undefined) {
this.strokeWidth = source.strokeWidth;
}
if (source.cornerRadius !== undefined) {
this.cornerRadius = source.cornerRadius;
}
}
}
/**
Configuration of the background appearance for buttons and hints.
*/
exports.PolygonStyle = PolygonStyle;
class BackgroundStyle extends _utils.PartiallyConstructible {
/**
The color of the outline.
Default is "#FFFFFFFF"
*/
strokeColor = '#FFFFFFFF';
/**
The fill color.
Default is "#FFFFFF30"
*/
fillColor = '#FFFFFF30';
/**
The width of the outline in dp.
Default is 2.0
*/
strokeWidth = 2.0;
/** @param source {@displayType `DeepPartial<BackgroundStyle>`} */
constructor(source = {}) {
super();
if (source.strokeColor !== undefined) {
this.strokeColor = source.strokeColor;
}
if (source.fillColor !== undefined) {
this.fillColor = source.fillColor;
}
if (source.strokeWidth !== undefined) {
this.strokeWidth = source.strokeWidth;
}
}
}
/**
Configuration of the appearance for foreground elements (e.g. text and/or icons, etc).
*/
exports.BackgroundStyle = BackgroundStyle;
class ForegroundStyle extends _utils.PartiallyConstructible {
/**
Determines whether the icon is visible or not.
Default is true
*/
iconVisible = true;
/**
The color used for foreground elements.
Default is "#FFFFFF"
*/
color = '#FFFFFF';
/**
Determines whether to use drop shadows for foreground elements.
Default is false
*/
useShadow = false;
/** @param source {@displayType `DeepPartial<ForegroundStyle>`} */
constructor(source = {}) {
super();
if (source.iconVisible !== undefined) {
this.iconVisible = source.iconVisible;
}
if (source.color !== undefined) {
this.color = source.color;
}
if (source.useShadow !== undefined) {
this.useShadow = source.useShadow;
}
}
}
/**
Configuration of the badge.
*/
exports.ForegroundStyle = ForegroundStyle;
class BadgeStyle extends _utils.PartiallyConstructible {
/**
Determines whether the badge is visible or not.
Default is true
*/
visible = true;
/**
Configuration of the background appearance for the badge.
*/
background = new BackgroundStyle({});
/**
The color of the badge's foreground (icon, text).
Default is "?sbColorOnSurface"
*/
foregroundColor = '?sbColorOnSurface';
/** @param source {@displayType `DeepPartial<BadgeStyle>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.background !== undefined) {
this.background = new BackgroundStyle(source.background);
}
if (source.foregroundColor !== undefined) {
this.foregroundColor = source.foregroundColor;
}
}
}
/**
Configuration of the round button.
*/
exports.BadgeStyle = BadgeStyle;
class RoundButton extends _utils.PartiallyConstructible {
/**
Determines whether the button is visible or not.
Default is true
*/
visible = true;
/**
The text to be read when the button is selected through accessibility mode.
Default is ""
*/
accessibilityDescription = '';
/**
The color of the button's background.
Default is "#0000007A"
*/
backgroundColor = '#0000007A';
/**
The color of the button's foreground (icon, text).
Default is "#FFFFFF"
*/
foregroundColor = '#FFFFFF';
/**
The color of the button's background when the button is active (selected, toggled).
Default is "#FFCE5C"
*/
activeBackgroundColor = '#FFCE5C';
/**
The color of the button's foreground (icon, text) when the button is active (selected, toggled).
Default is "#1C1B1F"
*/
activeForegroundColor = '#1C1B1F';
/** @param source {@displayType `DeepPartial<RoundButton>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.accessibilityDescription !== undefined) {
this.accessibilityDescription = source.accessibilityDescription;
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.foregroundColor !== undefined) {
this.foregroundColor = source.foregroundColor;
}
if (source.activeBackgroundColor !== undefined) {
this.activeBackgroundColor = source.activeBackgroundColor;
}
if (source.activeForegroundColor !== undefined) {
this.activeForegroundColor = source.activeForegroundColor;
}
}
}
/**
Configuration of the button with a badge.
*/
exports.RoundButton = RoundButton;
class BadgedButton extends _utils.PartiallyConstructible {
/**
The color of the badge's background.
Default is "#FFFFFF"
*/
badgeBackgroundColor = '#FFFFFF';
/**
The color of the badge's foreground (icon, text).
Default is "#C8193C"
*/
badgeForegroundColor = '#C8193C';
/**
Determines whether the button is visible or not.
Default is true
*/
visible = true;
/**
The color of the button's background.
Default is "#0000007A"
*/
backgroundColor = '#0000007A';
/**
The color of the button's foreground (icon, text).
Default is "#FFFFFF"
*/
foregroundColor = '#FFFFFF';
/**
The color of the button's background when the button is active (selected, toggled).
Default is "#FFCE5C"
*/
activeBackgroundColor = '#FFCE5C';
/**
The color of the button's foreground (icon, text) when the button is active (selected, toggled).
Default is "#1C1B1F"
*/
activeForegroundColor = '#1C1B1F';
/** @param source {@displayType `DeepPartial<BadgedButton>`} */
constructor(source = {}) {
super();
if (source.badgeBackgroundColor !== undefined) {
this.badgeBackgroundColor = source.badgeBackgroundColor;
}
if (source.badgeForegroundColor !== undefined) {
this.badgeForegroundColor = source.badgeForegroundColor;
}
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.foregroundColor !== undefined) {
this.foregroundColor = source.foregroundColor;
}
if (source.activeBackgroundColor !== undefined) {
this.activeBackgroundColor = source.activeBackgroundColor;
}
if (source.activeForegroundColor !== undefined) {
this.activeForegroundColor = source.activeForegroundColor;
}
}
}
/**
Configuration of the button.
*/
exports.BadgedButton = BadgedButton;
class ButtonConfiguration extends _utils.PartiallyConstructible {
/**
Determines whether the button is visible or not.
Default is true
*/
visible = true;
/**
The text to be displayed on the button.
Default is ""
*/
text = '';
/**
The text to be read when the button is selected through accessibility mode.
Default is ""
*/
accessibilityDescription = '';
/**
Configuration of the background appearance for the button.
*/
background = new BackgroundStyle({});
/**
Configuration of the appearance for foreground elements (e.g. text and/or icons, etc) of the button.
*/
foreground = new ForegroundStyle({});
/** @param source {@displayType `DeepPartial<ButtonConfiguration>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.text !== undefined) {
this.text = source.text;
}
if (source.accessibilityDescription !== undefined) {
this.accessibilityDescription = source.accessibilityDescription;
}
if (source.background !== undefined) {
this.background = new BackgroundStyle(source.background);
}
if (source.foreground !== undefined) {
this.foreground = new ForegroundStyle(source.foreground);
}
}
}
/**
Configuration for the popup menu items.
*/
exports.ButtonConfiguration = ButtonConfiguration;
class PopupMenuItem extends _utils.PartiallyConstructible {
/**
The text to be displayed on the button.
*/
title = new StyledText({});
/**
The text to be read when the button is selected through accessibility mode.
Default is ""
*/
accessibilityDescription = '';
/**
Configuration of the icon appearance.
*/
icon = new IconStyle({});
/** @param source {@displayType `DeepPartial<PopupMenuItem>`} */
constructor(source = {}) {
super();
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.accessibilityDescription !== undefined) {
this.accessibilityDescription = source.accessibilityDescription;
}
if (source.icon !== undefined) {
this.icon = new IconStyle(source.icon);
}
}
}
/**
Configuration of the button located on a bar.
*/
exports.PopupMenuItem = PopupMenuItem;
class BarButtonConfiguration extends _utils.PartiallyConstructible {
/**
Determines whether the button is visible or not.
Default is true
*/
visible = true;
/**
The text to be displayed on the button.
*/
title = new StyledText({});
/**
The text to be read when the button is selected through accessibility mode.
Default is ""
*/
accessibilityDescription = '';
/**
Configuration of the background appearance for the button.
*/
background = new BackgroundStyle({});
/**
Configuration of the icon appearance.
*/
icon = new IconStyle({});
/** @param source {@displayType `DeepPartial<BarButtonConfiguration>`} */
constructor(source = {}) {
super();
if (source.visible !== undefined) {
this.visible = source.visible;
}
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.accessibilityDescription !== undefined) {
this.accessibilityDescription = source.accessibilityDescription;
}
if (source.background !== undefined) {
this.background = new BackgroundStyle(source.background);
}
if (source.icon !== undefined) {
this.icon = new IconStyle(source.icon);
}
}
}
/**
Configure the orientation of the interface.
- `NONE`:
Do not restrict the interface's orientation.
- `PORTRAIT`:
Lock the orientation to portrait.
- `LANDSCAPE`:
Lock the orientation to landscape.
*/
exports.BarButtonConfiguration = BarButtonConfiguration;
const OrientationLockModeValues = exports.OrientationLockModeValues = ['NONE', 'PORTRAIT', 'LANDSCAPE'];
/**
Configuration of the camera preview mode.
- `FIT_IN`:
In this mode, the camera preview frames will be scaled to fit inside the layout view size - the full preview frame content will be visible, but unused edges might appear in the preview layout.
- `FILL_IN`:
In this mode, the camera preview frames fill the entire layout view - the preview frames may contain additional content at the edges that are not visible in the preview layout.
*/
const CameraPreviewModeValues = exports.CameraPreviewModeValues = ['FIT_IN', 'FILL_IN'];
/**
Determines the successful detection sound.
- `MODERN_BEEP`:
A modern beep sound.
- `CLASSIC_BEEP`:
The old, classic beep sound.
*/
const SoundTypeValues = exports.SoundTypeValues = ['MODERN_BEEP', 'CLASSIC_BEEP'];
/**
Configuration for the sound.
*/
class Sound extends _utils.PartiallyConstructible {
/**
Determine whether the beep sound should be enabled or not when a barcode is detected.
Default is true
*/
successBeepEnabled = true;
/**
Determines the successful detection sound.
Default is MODERN_BEEP
*/
soundType = 'MODERN_BEEP';
/** @param source {@displayType `DeepPartial<Sound>`} */
constructor(source = {}) {
super();
if (source.successBeepEnabled !== undefined) {
this.successBeepEnabled = source.successBeepEnabled;
}
if (source.soundType !== undefined) {
this.soundType = source.soundType;
}
}
}
/**
Configure the vibration.
*/
exports.Sound = Sound;
class Vibration extends _utils.PartiallyConstructible {
/**
Determine whether vibration should be enabled or not when a barcode is detected.
Default is false
*/
enabled = false;
/** @param source {@displayType `DeepPartial<Vibration>`} */
constructor(source = {}) {
super();
if (source.enabled !== undefined) {
this.enabled = source.enabled;
}
}
}
/**
Configuration of timeouts.
*/
exports.Vibration = Vibration;
class Timeouts extends _utils.PartiallyConstructible {
/**
Sets the length of time, in milliseconds, when the scanner should auto close. Default is 0 (disabled).
Default is 0
*/
autoCancelTimeout = 0;
/**
Sets the length of time, in milliseconds, that the first scan will be delayed by. Default is 0 (disabled).
Default is 0
*/
initialScanDelay = 0;
/** @param source {@displayType `DeepPartial<Timeouts>`} */
constructor(source = {}) {
super();
if (source.autoCancelTimeout !== undefined) {
this.autoCancelTimeout = source.autoCancelTimeout;
}
if (source.initialScanDelay !== undefined) {
this.initialScanDelay = source.initialScanDelay;
}
}
}
/**
Represents the insets of a rectangle.
*/
exports.Timeouts = Timeouts;
class EdgeInsets extends _utils.PartiallyConstructible {
/**
The top inset.
Default is 0.0
*/
top = 0.0;
/**
The left inset.
Default is 0.0
*/
left = 0.0;
/**
The bottom inset.
Default is 0.0
*/
bottom = 0.0;
/**
The right inset.
Default is 0.0
*/
right = 0.0;
/** @param source {@displayType `DeepPartial<EdgeInsets>`} */
constructor(source = {}) {
super();
if (source.top !== undefined) {
this.top = source.top;
}
if (source.left !== undefined) {
this.left = source.left;
}
if (source.bottom !== undefined) {
this.bottom = source.bottom;
}
if (source.right !== undefined) {
this.right = source.right;
}
}
}
exports.EdgeInsets = EdgeInsets;
//# sourceMappingURL=Common.js.map