react-native-scanbot-barcode-scanner-sdk 4.0.4 → 4.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/Libraries.txt +85 -419
- package/RNScanbotBarcodeSDK.podspec +3 -3
- package/android/build.gradle +12 -13
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +179 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.kt +23 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +23 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +79 -70
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/JSONObject.kt +90 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt +53 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.kt +24 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +4 -0
- package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -2
- package/index.d.ts +24 -29
- package/index.js +9 -2
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.h +0 -1
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +120 -148
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.h +0 -31
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.mm +45 -158
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.mm +0 -1
- package/ios/ScanbotBarcodeSdk.h +1 -12
- package/ios/ScanbotBarcodeSdk.m +64 -489
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +18 -0
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +36 -0
- package/js/{RTNScanbotBarcodeCameraViewNativeComponent.tsx → RTNScanbotBarcodeCameraViewNativeComponent.ts} +7 -35
- package/package.json +5 -2
- package/src/components/barcode-camera-view/{scanbot-barcode-camera-view-types.tsx → scanbot-barcode-camera-view-types.ts} +57 -16
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +14 -4
- package/src/configurations.ts +374 -0
- package/src/customConfigurations.ts +97 -0
- package/src/customResults.ts +6 -0
- package/src/customTypes.ts +10 -0
- package/src/results.ts +38 -0
- package/src/types.ts +1355 -0
- package/android/.project +0 -34
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkModule.java +0 -19
- package/android/src/main/java/com/reactlibrary/ScanbotBarcodeSdkPackage.java +0 -38
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +0 -166
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkConfiguration.java +0 -75
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +0 -460
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.java +0 -36
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/StorageUtils.java +0 -108
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorAdditionalConfigBuilder.java +0 -37
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/barcode/ScanbotBarcodeDetectorConfigBuilder.java +0 -45
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewConfiguration.java +0 -195
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/filters/ReactBarcodeExtensionsFilter.java +0 -59
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.java +0 -440
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/LogUtils.java +0 -43
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ResponseUtils.java +0 -33
- package/android/src/main/res/drawable/ic_baseline_arrow_back_24.xml +0 -10
- package/android/src/main/res/values/attrs.xml +0 -5
- package/ios/Categories/SBSDKPolygon+JSON.h +0 -16
- package/ios/Categories/SBSDKPolygon+JSON.m +0 -21
- package/ios/Categories/UIColor+JSON.h +0 -14
- package/ios/Categories/UIColor+JSON.m +0 -61
- package/ios/ScanbotBarcodeSDKConfiguration.h +0 -15
- package/ios/ScanbotBarcodeSDKConfiguration.m +0 -13
- package/ios/ScanbotBarcodeSdk.xcodeproj/project.pbxproj +0 -271
- package/ios/ScanbotBarcodeSdk.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/ScanbotBarcodeSdk.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/SharedConfiguration.h +0 -18
- package/ios/SharedConfiguration.m +0 -20
- package/ios/Utils/BarcodeMapping.h +0 -336
- package/ios/Utils/HashUtils.h +0 -46
- package/ios/Utils/JSONMappings.h +0 -25
- package/ios/Utils/LoggingUtils.h +0 -23
- package/ios/Utils/ObjectMapper.h +0 -26
- package/ios/Utils/ObjectMapper.m +0 -143
- package/ios/Utils/ReactBarcodeExtensionsFilter.h +0 -22
- package/ios/Utils/ReactBarcodeExtensionsFilter.m +0 -55
- package/ios/Utils/ScanbotStorageUtils.h +0 -25
- package/ios/Utils/ScanbotStorageUtils.m +0 -111
- package/src/configuration.ts +0 -328
- package/src/enum.ts +0 -106
- package/src/model.ts +0 -104
- package/src/result.ts +0 -45
- /package/src/components/barcode-camera-view/{scanbot-native-barcode-camera-view.tsx → scanbot-native-barcode-camera-view.ts} +0 -0
|
@@ -48,7 +48,7 @@ export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, Bar
|
|
|
48
48
|
* An optional array of barcode document formats that acts as a detection filter.
|
|
49
49
|
* By default all supported document formats will be detected.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
acceptedDocumentFormats?: string[]; // TODO: Should be BarcodeDocumentFormat[]
|
|
52
52
|
/**
|
|
53
53
|
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
|
|
54
54
|
* To use legacy recognizer, please specify LEGACY
|
|
@@ -60,9 +60,9 @@ export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, Bar
|
|
|
60
60
|
*/
|
|
61
61
|
cameraZoomFactor?: Float;
|
|
62
62
|
/**
|
|
63
|
-
* Use a filter to determine which type of barcode can be detected; see `
|
|
63
|
+
* Use a filter to determine which type of barcode can be detected; see `BarcodesExtensionFilter`
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
barcodesExtensionFilter?: string; // TODO: Should be BarcodesExtensionFilter
|
|
66
66
|
/**
|
|
67
67
|
* Enable or disable barcode detection. If disabled, the camera preview is active but no barcodes will be detected.
|
|
68
68
|
* Default is enabled.
|
|
@@ -70,29 +70,6 @@ export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, Bar
|
|
|
70
70
|
scanningEnabled?: boolean;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export type NativeComponentBarcodeFormat =
|
|
74
|
-
'AZTEC' |
|
|
75
|
-
'CODABAR' |
|
|
76
|
-
'CODE_39' |
|
|
77
|
-
'CODE_93' |
|
|
78
|
-
'CODE_128' |
|
|
79
|
-
'DATA_MATRIX' |
|
|
80
|
-
'EAN_8' |
|
|
81
|
-
'EAN_13' |
|
|
82
|
-
'ITF' |
|
|
83
|
-
'PDF_417' |
|
|
84
|
-
'QR_CODE' |
|
|
85
|
-
'RSS_14' |
|
|
86
|
-
'RSS_EXPANDED' |
|
|
87
|
-
'UPC_A' |
|
|
88
|
-
'UPC_E' |
|
|
89
|
-
'UNKNOWN' |
|
|
90
|
-
'IATA_2_OF_5' |
|
|
91
|
-
'INDUSTRIAL_2_OF_5' |
|
|
92
|
-
'MSI_PLESSEY' |
|
|
93
|
-
'CODE_25';
|
|
94
|
-
|
|
95
|
-
|
|
96
73
|
/**
|
|
97
74
|
* An interface that contains additional parameters for barcodes detection and filtering.
|
|
98
75
|
*/
|
|
@@ -128,13 +105,8 @@ export interface BarcodeAdditionalParameters {
|
|
|
128
105
|
* The default is `false`.
|
|
129
106
|
*/
|
|
130
107
|
stripCheckDigits?: boolean;
|
|
131
|
-
/**
|
|
132
|
-
|
|
133
|
-
* Turn it off if you don't want to see decoded FNC1 characters (']C1' and ASCII char 29).
|
|
134
|
-
* The default value is `true`.
|
|
135
|
-
* NOTE: Currently works for CODE128 barcodes only!
|
|
136
|
-
*/
|
|
137
|
-
gs1DecodingEnabled?: boolean;
|
|
108
|
+
/** The GS1 handling mode. The default value is PARSE. */
|
|
109
|
+
gs1HandlingMode?: string; // TODO: Should be Gs1HandlingMode;
|
|
138
110
|
/**
|
|
139
111
|
* The checksum algorithm for MSI Plessey barcodes.
|
|
140
112
|
* The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
|
|
@@ -178,7 +150,7 @@ export interface FinderConfig {
|
|
|
178
150
|
/**
|
|
179
151
|
* The finder view rectangle aspect ratio
|
|
180
152
|
*/
|
|
181
|
-
finderAspectRatio?:
|
|
153
|
+
finderAspectRatio?: AspectRatio;
|
|
182
154
|
/**
|
|
183
155
|
* Set the finderInsets left, top, bottom, right
|
|
184
156
|
*/
|
|
@@ -208,7 +180,7 @@ export interface FinderInset {
|
|
|
208
180
|
right: Float;
|
|
209
181
|
}
|
|
210
182
|
|
|
211
|
-
export interface
|
|
183
|
+
export interface AspectRatio {
|
|
212
184
|
width: Int32;
|
|
213
185
|
height: Int32;
|
|
214
186
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-scanbot-barcode-scanner-sdk",
|
|
3
3
|
"title": "Scanbot Barcode Scanner SDK for React Native",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.2.0-beta.2",
|
|
5
5
|
"scanbot": {
|
|
6
|
-
"
|
|
6
|
+
"iosWrapperVersion": "4.2.2.0-beta.2"
|
|
7
7
|
},
|
|
8
8
|
"description": "Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS",
|
|
9
9
|
"main": "index.js",
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"sdk",
|
|
32
32
|
"barcode",
|
|
33
33
|
"qr-code",
|
|
34
|
+
"react-native",
|
|
35
|
+
"barcode-scanner",
|
|
36
|
+
"Qrcode-scanner",
|
|
34
37
|
"scanner",
|
|
35
38
|
"scan",
|
|
36
39
|
"scanning",
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import {
|
|
3
|
-
BarcodeDocumentFormat,
|
|
4
|
-
BarcodeFilter,
|
|
5
|
-
BarcodeFormat,
|
|
6
|
-
EngineMode,
|
|
7
|
-
} from '../../enum';
|
|
8
|
-
import { FinderAspectRatio } from '../../model';
|
|
9
2
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { BarcodeScannerResult } from '../../results';
|
|
4
|
+
import { AspectRatio, BarcodeDocumentFormat, BarcodeFormat, BarcodesExtensionFilter, CodeDensity, EngineMode, Gs1HandlingMode, MSIPlesseyChecksumAlgorithm } from '../../types';
|
|
12
5
|
|
|
13
6
|
export interface ScanbotBarcodeCameraViewProperties {
|
|
14
|
-
onBarcodeScannerResult?: (result:
|
|
7
|
+
onBarcodeScannerResult?: (result: BarcodeScannerResult) => void;
|
|
15
8
|
configuration?: ScanbotBarcodeCameraViewConfiguration;
|
|
16
9
|
style: StyleProp<ViewStyle>;
|
|
17
10
|
children?: React.ReactNode;
|
|
18
11
|
}
|
|
19
12
|
|
|
20
13
|
export interface ScanbotBarcodeCameraNativeViewProperties {
|
|
21
|
-
onNativeBarcodeScannerResult?: (result:
|
|
14
|
+
onNativeBarcodeScannerResult?: (result: BarcodeScannerResult) => void;
|
|
22
15
|
requestComponentReload?: () => void;
|
|
23
16
|
configuration?: ScanbotBarcodeCameraViewConfiguration;
|
|
24
17
|
style: StyleProp<ViewStyle>;
|
|
@@ -60,10 +53,10 @@ export interface ScanbotBarcodeCameraViewConfiguration extends FinderConfig, Bar
|
|
|
60
53
|
* The default value is 0.-
|
|
61
54
|
*/
|
|
62
55
|
cameraZoomFactor?: number;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
/**
|
|
57
|
+
* The extension filter for EAN and UPC barcodes.
|
|
58
|
+
*/
|
|
59
|
+
barcodesExtensionFilter?: BarcodesExtensionFilter;
|
|
67
60
|
/**
|
|
68
61
|
* Enable or disable barcode detection. If disabled, the camera preview is active but no barcodes will be detected.
|
|
69
62
|
* Default is enabled.
|
|
@@ -102,7 +95,7 @@ export interface FinderConfig {
|
|
|
102
95
|
/**
|
|
103
96
|
* The finder view rectangle aspect ratio
|
|
104
97
|
*/
|
|
105
|
-
finderAspectRatio?:
|
|
98
|
+
finderAspectRatio?: AspectRatio;
|
|
106
99
|
/**
|
|
107
100
|
* Set the finderInsets left, top, bottom, right
|
|
108
101
|
*/
|
|
@@ -132,3 +125,51 @@ export interface FinderInset {
|
|
|
132
125
|
right: number;
|
|
133
126
|
}
|
|
134
127
|
|
|
128
|
+
/**
|
|
129
|
+
* An interface that contains additional parameters for barcodes detection and filtering.
|
|
130
|
+
*/
|
|
131
|
+
export interface BarcodeAdditionalParameters {
|
|
132
|
+
/**
|
|
133
|
+
* If `true`, enables the mode which slightly decreases the scanning quality and the energy consumption, thus increasing the scanning speed.
|
|
134
|
+
* The default is `false`.
|
|
135
|
+
* Android only.
|
|
136
|
+
*/
|
|
137
|
+
lowPowerMode?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Optional minimum required text length of the detected barcode.
|
|
140
|
+
* The default is 0 (setting is turned off).
|
|
141
|
+
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
142
|
+
*/
|
|
143
|
+
minimumTextLength?: number;
|
|
144
|
+
/**
|
|
145
|
+
* Optional maximum required text length of the detected barcode.
|
|
146
|
+
* The default is 0 (setting is turned off).
|
|
147
|
+
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
148
|
+
*/
|
|
149
|
+
maximumTextLength?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Optional minimum required quiet zone on the barcode.
|
|
152
|
+
* Measured in modules (the size of narrowest bar in the barcode).
|
|
153
|
+
* The default is 10.
|
|
154
|
+
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
155
|
+
*/
|
|
156
|
+
minimum1DBarcodesQuietZone?: number;
|
|
157
|
+
/**
|
|
158
|
+
* With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
|
|
159
|
+
* Has no effect if both single and double digit MSI Plessey checksums are enabled.
|
|
160
|
+
* The default is `false`.
|
|
161
|
+
*/
|
|
162
|
+
stripCheckDigits?: boolean;
|
|
163
|
+
/** The GS1 handling mode. The default value is PARSE. */
|
|
164
|
+
gs1HandlingMode?: Gs1HandlingMode;
|
|
165
|
+
/**
|
|
166
|
+
* The checksum algorithm for MSI Plessey barcodes.
|
|
167
|
+
* The default value is MSIPlesseyChecksumAlgorithm.MOD_10.
|
|
168
|
+
*/
|
|
169
|
+
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
170
|
+
/**
|
|
171
|
+
* Low density. Finds up to 6 QR codes in one image or video frame. This is the default value.
|
|
172
|
+
* High density. Finds up to 24 QR codes in one image or video frame.
|
|
173
|
+
*/
|
|
174
|
+
codeDensity?: CodeDensity;
|
|
175
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { EmitterSubscription, findNodeHandle, NativeMethods, Platform
|
|
2
|
+
import { EmitterSubscription, findNodeHandle, NativeMethods, Platform } from 'react-native';
|
|
3
3
|
import { Dimensions } from 'react-native';
|
|
4
4
|
import { ScanbotBarcodeCameraNativeViewProperties, ScanbotBarcodeCameraViewConfiguration, ScanbotBarcodeCameraViewProperties } from './scanbot-barcode-camera-view-types';
|
|
5
5
|
import ScanbotNativeBarcodeCameraView, { BarcodeCameraViewNativeCommands } from './scanbot-native-barcode-camera-view';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import { BarcodeScannerResult } from '../../results';
|
|
7
8
|
|
|
8
9
|
const Device = {
|
|
9
10
|
isPortrait: () => {
|
|
@@ -102,7 +103,7 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
|
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
let outResult:
|
|
106
|
+
let outResult: BarcodeScannerResult | undefined = undefined;
|
|
106
107
|
if (Platform.OS === 'ios') {
|
|
107
108
|
// The new-architecture Fabric Component callback returns a JSON string as a result
|
|
108
109
|
if (event.nativeEvent.jsonResult) {
|
|
@@ -198,6 +199,7 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
|
|
|
198
199
|
outObj.maximumTextLength = obj.maximumTextLength ?? -1;
|
|
199
200
|
outObj.minimumTextLength = obj.minimumTextLength ?? -1;
|
|
200
201
|
outObj.minimum1DBarcodesQuietZone = obj.minimum1DBarcodesQuietZone ?? -1;
|
|
202
|
+
|
|
201
203
|
return outObj;
|
|
202
204
|
}
|
|
203
205
|
|
|
@@ -208,6 +210,14 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
|
|
|
208
210
|
const config = props.configuration;
|
|
209
211
|
if (config != null) {
|
|
210
212
|
props.configuration = this.sanitizeNumbers(config as any);
|
|
213
|
+
|
|
214
|
+
// When using new arch on iOS platform, if we don't specify default values for boolean properties all of them will be
|
|
215
|
+
// considered as false while code genenarion
|
|
216
|
+
if (Platform.OS === 'ios') {
|
|
217
|
+
// For now only scanningEnabled should be set as true by default
|
|
218
|
+
if (props.configuration.scanningEnabled === undefined)
|
|
219
|
+
props.configuration.scanningEnabled = true;
|
|
220
|
+
}
|
|
211
221
|
}
|
|
212
222
|
|
|
213
223
|
return props;
|
|
@@ -257,4 +267,4 @@ export class ScanbotBarcodeCameraView extends React.Component<Properties, {}> {
|
|
|
257
267
|
BarcodeCameraViewNativeCommands[command](cameraView);
|
|
258
268
|
}
|
|
259
269
|
}
|
|
260
|
-
}
|
|
270
|
+
}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AspectRatio,
|
|
3
|
+
BarcodeDocumentFormat,
|
|
4
|
+
BarcodeFormat,
|
|
5
|
+
BarcodesExtensionFilter,
|
|
6
|
+
CameraModule,
|
|
7
|
+
CameraPreviewMode,
|
|
8
|
+
CodeDensity,
|
|
9
|
+
ConfirmationDialogConfiguration,
|
|
10
|
+
EngineMode,
|
|
11
|
+
FileEncryptionMode,
|
|
12
|
+
Gs1HandlingMode,
|
|
13
|
+
MSIPlesseyChecksumAlgorithm,
|
|
14
|
+
OrientationLockMode,
|
|
15
|
+
SelectionOverlayConfiguration,
|
|
16
|
+
ZoomRange
|
|
17
|
+
} from './types';
|
|
18
|
+
|
|
19
|
+
export interface BarcodeScannerConfiguration {
|
|
20
|
+
/** An optional array of barcode document formats that act as a detection filter. By default all supported document formats will be detected. */
|
|
21
|
+
acceptedDocumentFormats?: BarcodeDocumentFormat[];
|
|
22
|
+
|
|
23
|
+
/** The extension filter for EAN and UPC barcodes. */
|
|
24
|
+
barcodesExtensionFilter?: BarcodesExtensionFilter;
|
|
25
|
+
|
|
26
|
+
/** Background color of the detection overlay. */
|
|
27
|
+
cameraOverlayColor?: string;
|
|
28
|
+
|
|
29
|
+
/** Background color of the detection overlay. */
|
|
30
|
+
cameraModule?: CameraModule;
|
|
31
|
+
|
|
32
|
+
/** The relative initial zoom level of the camera in the range (0,1), where 0 is zoomed out and 1 is zoomed in. Default value is 0.0. */
|
|
33
|
+
cameraZoomFactor?: number;
|
|
34
|
+
|
|
35
|
+
/** Whether the cancel button is hidden or not. iOS only. */
|
|
36
|
+
cancelButtonHidden?: boolean;
|
|
37
|
+
|
|
38
|
+
/** String being displayed on the cancel button. */
|
|
39
|
+
cancelButtonTitle?: string;
|
|
40
|
+
|
|
41
|
+
/** The engine mode to be used for barcode scanning. The default value is NEXT_GEN. */
|
|
42
|
+
engineMode?: EngineMode;
|
|
43
|
+
|
|
44
|
+
/** Title of the button that opens the screen where the user can allow the usage of the camera by the app. */
|
|
45
|
+
enableCameraButtonTitle?: string;
|
|
46
|
+
|
|
47
|
+
/** 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. */
|
|
48
|
+
enableCameraExplanationText?: string;
|
|
49
|
+
|
|
50
|
+
/** Foreground color of the detection overlay. */
|
|
51
|
+
finderLineColor?: string;
|
|
52
|
+
|
|
53
|
+
/** Width of finder frame border. Default is 2. */
|
|
54
|
+
finderLineWidth?: number;
|
|
55
|
+
|
|
56
|
+
/** String being displayed as description. */
|
|
57
|
+
finderTextHint?: string;
|
|
58
|
+
|
|
59
|
+
/** Foreground color of the description label. */
|
|
60
|
+
finderTextHintColor?: string;
|
|
61
|
+
|
|
62
|
+
/** 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. */
|
|
63
|
+
finderAspectRatio?: AspectRatio;
|
|
64
|
+
|
|
65
|
+
/** Controls whether the flash toggle button is hidden or not. iOS only. */
|
|
66
|
+
flashButtonHidden?: boolean;
|
|
67
|
+
|
|
68
|
+
/** String being displayed on the flash button. iOS only. */
|
|
69
|
+
flashButtonTitle?: string;
|
|
70
|
+
|
|
71
|
+
/** Foreground color of the flash button when flash is off. */
|
|
72
|
+
flashButtonInactiveColor?: string;
|
|
73
|
+
|
|
74
|
+
/** Whether flash is toggled on or off. */
|
|
75
|
+
flashEnabled?: boolean;
|
|
76
|
+
|
|
77
|
+
/** Disables auto-focus and locks the lens at the specified focus lock lens position. Default value is false. iOS only. For Android, minFocusDistanceLock can be used. */
|
|
78
|
+
focusLockEnabled?: boolean;
|
|
79
|
+
|
|
80
|
+
/** The position of the lens. Values can be between 0.0f (minimum focusing distance) and 1.0f (maximum focusing distance). The default value is 0.0 iOS only. For Android, minFocusDistanceLock can be used. */
|
|
81
|
+
focusLockPosition?: number;
|
|
82
|
+
|
|
83
|
+
/** Whether touch-to-focus is enabled on camera preview. Enabled by default. Android only. */
|
|
84
|
+
touchToFocusEnabled?: boolean;
|
|
85
|
+
|
|
86
|
+
/** UI Interface orientation lock mode */
|
|
87
|
+
orientationLockMode?: OrientationLockMode;
|
|
88
|
+
|
|
89
|
+
/** 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. */
|
|
90
|
+
minimumTextLength?: number;
|
|
91
|
+
|
|
92
|
+
/** Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
|
|
93
|
+
maximumTextLength?: number;
|
|
94
|
+
|
|
95
|
+
/** Lock focus distance withing minimum possible range */
|
|
96
|
+
minFocusDistanceLock?: boolean;
|
|
97
|
+
|
|
98
|
+
/** 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. */
|
|
99
|
+
minimum1DBarcodesQuietZone?: number;
|
|
100
|
+
|
|
101
|
+
/** 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` */
|
|
102
|
+
stripCheckDigits?: boolean;
|
|
103
|
+
|
|
104
|
+
/** Whether scanner screen should make a sound on successful barcode or MRZ detection. */
|
|
105
|
+
successBeepEnabled?: boolean;
|
|
106
|
+
|
|
107
|
+
/** Background color of the top bar. */
|
|
108
|
+
topBarBackgroundColor?: string;
|
|
109
|
+
|
|
110
|
+
/** Foreground color of the cancel button. */
|
|
111
|
+
topBarButtonsColor?: string;
|
|
112
|
+
|
|
113
|
+
/** Accepted barcode formats */
|
|
114
|
+
barcodeFormats?: BarcodeFormat[];
|
|
115
|
+
|
|
116
|
+
/** Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE. Android only. */
|
|
117
|
+
useButtonsAllCaps?: boolean;
|
|
118
|
+
|
|
119
|
+
/** If `true`, replaces the cancel button in the top bar with a back arrow icon. The default value is FALSE. Android only. */
|
|
120
|
+
replaceCancelButtonWithIcon?: boolean;
|
|
121
|
+
|
|
122
|
+
/** Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only */
|
|
123
|
+
cameraPreviewMode?: CameraPreviewMode;
|
|
124
|
+
|
|
125
|
+
/** The range of valid camera zoom factors. Default value is (1.0; 12.0). */
|
|
126
|
+
cameraZoomRange?: ZoomRange;
|
|
127
|
+
|
|
128
|
+
/** Sets auto close timer in seconds. 0 = disabled and it is the default value. */
|
|
129
|
+
autoCancelTimeout?: number;
|
|
130
|
+
|
|
131
|
+
/** The GS1 handling mode. The default value is PARSE. */
|
|
132
|
+
gs1HandlingMode?: Gs1HandlingMode;
|
|
133
|
+
|
|
134
|
+
/** The checksum algorithm for MSI Plessey barcodes. The default value is MOD_10. */
|
|
135
|
+
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
136
|
+
|
|
137
|
+
/** 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. */
|
|
138
|
+
lowPowerMode?: boolean;
|
|
139
|
+
|
|
140
|
+
/** The expected density of QR codes in an image. */
|
|
141
|
+
codeDensity?: CodeDensity;
|
|
142
|
+
|
|
143
|
+
/** Scanning delay after scanner appearance in seconds. Defaults to 0 secs. */
|
|
144
|
+
initialScanDelay?: number;
|
|
145
|
+
|
|
146
|
+
/** Freezes a preview after a scan for a given amount of seconds. Defaults to 0 secs. Android only. */
|
|
147
|
+
delayAfterScan?: number;
|
|
148
|
+
|
|
149
|
+
/** When this property is set to true, the zoom can be activated by double tapping somewhere in the receivers view. iOS only. */
|
|
150
|
+
doubleTapToZoomEnabled?: boolean;
|
|
151
|
+
|
|
152
|
+
/** When this property is set to true, the zoom can be activated by a pinch gesture somewhere in the receivers view. iOS only. */
|
|
153
|
+
pinchToZoomEnabled?: boolean;
|
|
154
|
+
|
|
155
|
+
/** Defines, if zooming in or out should be animated. iOS only. */
|
|
156
|
+
shouldAnimateZooming?: boolean;
|
|
157
|
+
|
|
158
|
+
/** Display the region of interest. The default value is TRUE. */
|
|
159
|
+
viewFinderEnabled?: boolean;
|
|
160
|
+
|
|
161
|
+
/** The confirmation dialog configuration. */
|
|
162
|
+
confirmationDialogConfiguration?: ConfirmationDialogConfiguration;
|
|
163
|
+
|
|
164
|
+
/** The selection overlay configuration. */
|
|
165
|
+
overlayConfiguration?: SelectionOverlayConfiguration;
|
|
166
|
+
|
|
167
|
+
/** Filter barcodes results by regular expression. To accept scanned barcode, regular expression should match the entire barcode value */
|
|
168
|
+
barcodeValueFilter?: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface BatchBarcodeScannerConfiguration {
|
|
172
|
+
/** An optional array of barcode document formats that act as a detection filter. By default all supported document formats will be detected. */
|
|
173
|
+
acceptedDocumentFormats?: BarcodeDocumentFormat[];
|
|
174
|
+
|
|
175
|
+
/** The extension filter for EAN and UPC barcodes. */
|
|
176
|
+
barcodesExtensionFilter?: BarcodesExtensionFilter;
|
|
177
|
+
|
|
178
|
+
/** Background color of the detection overlay. */
|
|
179
|
+
cameraOverlayColor?: string;
|
|
180
|
+
|
|
181
|
+
/** Background color of the detection overlay. */
|
|
182
|
+
cameraModule?: CameraModule;
|
|
183
|
+
|
|
184
|
+
/** 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. */
|
|
185
|
+
cameraZoomFactor?: number;
|
|
186
|
+
|
|
187
|
+
/** The range of valid camera zoom factors. Default value is (1.0; 12.0). */
|
|
188
|
+
cameraZoomRange?: ZoomRange;
|
|
189
|
+
|
|
190
|
+
/** Whether the cancel button is hidden or not. iOS only. */
|
|
191
|
+
cancelButtonHidden?: boolean;
|
|
192
|
+
|
|
193
|
+
/** String being displayed on the cancel button. */
|
|
194
|
+
cancelButtonTitle?: string;
|
|
195
|
+
|
|
196
|
+
/** When this property is set to true, the zoom can be activated by double tapping somewhere in the receivers view. iOS only. */
|
|
197
|
+
doubleTapToZoomEnabled?: boolean;
|
|
198
|
+
|
|
199
|
+
/** When this property is set to true, the zoom can be activated by a pinch gesture somewhere in the receivers view. iOS only. */
|
|
200
|
+
pinchToZoomEnabled?: boolean;
|
|
201
|
+
|
|
202
|
+
/** Defines, if zooming in or out should be animated. iOS only. */
|
|
203
|
+
shouldAnimateZooming?: boolean;
|
|
204
|
+
|
|
205
|
+
/** The engine mode to be used for barcode scanning. The default value is NEXT_GEN. */
|
|
206
|
+
engineMode?: EngineMode;
|
|
207
|
+
|
|
208
|
+
/** Foreground color of the detection overlay. */
|
|
209
|
+
finderLineColor?: string;
|
|
210
|
+
|
|
211
|
+
/** Width of finder frame border. Default is 2. */
|
|
212
|
+
finderLineWidth?: number;
|
|
213
|
+
|
|
214
|
+
/** String being displayed as description. */
|
|
215
|
+
finderTextHint?: string;
|
|
216
|
+
|
|
217
|
+
/** Foreground color of the description label. */
|
|
218
|
+
finderTextHintColor?: string;
|
|
219
|
+
|
|
220
|
+
/** 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. */
|
|
221
|
+
finderAspectRatio?: AspectRatio;
|
|
222
|
+
|
|
223
|
+
/** Controls whether the flash toggle button is hidden or not. iOS only. */
|
|
224
|
+
flashButtonHidden?: boolean;
|
|
225
|
+
|
|
226
|
+
/** String being displayed on the flash button. iOS only. */
|
|
227
|
+
flashButtonTitle?: string;
|
|
228
|
+
|
|
229
|
+
/** Whether flash is toggled on or off. */
|
|
230
|
+
flashEnabled?: boolean;
|
|
231
|
+
|
|
232
|
+
/** Disables auto-focus and locks the lens at the specified focus lock lens position. The default value is false. iOS only. */
|
|
233
|
+
focusLockEnabled?: boolean;
|
|
234
|
+
|
|
235
|
+
/** The position of the lens. Values can be between 0.0f (minimum focusing distance) and 1.0f (maximum focusing distance). The default value is 0.0 iOS only. For Android, minFocusDistanceLock can be used. */
|
|
236
|
+
focusLockPosition?: number;
|
|
237
|
+
|
|
238
|
+
/** Whether touch-to-focus is enabled on camera preview. Enabled by default. Android only. */
|
|
239
|
+
touchToFocusEnabled?: boolean;
|
|
240
|
+
|
|
241
|
+
/** UI Interface orientation lock mode */
|
|
242
|
+
orientationLockMode?: OrientationLockMode;
|
|
243
|
+
|
|
244
|
+
/** 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. */
|
|
245
|
+
minimumTextLength?: number;
|
|
246
|
+
|
|
247
|
+
/** Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
|
|
248
|
+
maximumTextLength?: number;
|
|
249
|
+
|
|
250
|
+
/** 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. */
|
|
251
|
+
minimum1DBarcodesQuietZone?: number;
|
|
252
|
+
|
|
253
|
+
/** Lock focus distance withing minimum possible range */
|
|
254
|
+
minFocusDistanceLock?: boolean;
|
|
255
|
+
|
|
256
|
+
/** 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` */
|
|
257
|
+
stripCheckDigits?: boolean;
|
|
258
|
+
|
|
259
|
+
/** Whether scanner screen should make a sound on successful barcode or MRZ detection. */
|
|
260
|
+
successBeepEnabled?: boolean;
|
|
261
|
+
|
|
262
|
+
/** Background color of the top bar. */
|
|
263
|
+
topBarBackgroundColor?: string;
|
|
264
|
+
|
|
265
|
+
/** Foreground color of the cancel button. */
|
|
266
|
+
topBarButtonsColor?: string;
|
|
267
|
+
|
|
268
|
+
/** Foreground color of the top bar buttons when disabled. */
|
|
269
|
+
topBarButtonsInactiveColor?: string;
|
|
270
|
+
|
|
271
|
+
/** Accepted barcode formats */
|
|
272
|
+
barcodeFormats?: BarcodeFormat[];
|
|
273
|
+
|
|
274
|
+
/** Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE. Android only. */
|
|
275
|
+
useButtonsAllCaps?: boolean;
|
|
276
|
+
|
|
277
|
+
/** The GS1 handling mode. The default value is PARSE. */
|
|
278
|
+
gs1HandlingMode?: Gs1HandlingMode;
|
|
279
|
+
|
|
280
|
+
/** The checksum algorithm for MSI Plessey barcodes. The default value is MOD_10. */
|
|
281
|
+
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
282
|
+
|
|
283
|
+
/** 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. */
|
|
284
|
+
lowPowerMode?: boolean;
|
|
285
|
+
|
|
286
|
+
/** The color for barcodes count text */
|
|
287
|
+
barcodesCountText?: string;
|
|
288
|
+
|
|
289
|
+
/** The color for barcodes count text */
|
|
290
|
+
barcodesCountTextColor?: string;
|
|
291
|
+
|
|
292
|
+
/** Text of the button which clears the list of scanned barcodes. */
|
|
293
|
+
clearButtonTitle?: string;
|
|
294
|
+
|
|
295
|
+
/** The color of Submit button */
|
|
296
|
+
detailsActionColor?: string;
|
|
297
|
+
|
|
298
|
+
/** The color of bottom sheet */
|
|
299
|
+
detailsBackgroundColor?: string;
|
|
300
|
+
|
|
301
|
+
/** The color of text elements in bottom sheet */
|
|
302
|
+
detailsPrimaryColor?: string;
|
|
303
|
+
|
|
304
|
+
/** String being displayed on the delete button. iOS only. */
|
|
305
|
+
deleteButtonTitle?: string;
|
|
306
|
+
|
|
307
|
+
/** Title of the button that opens the screen where the user can allow the usage of the camera by the app. */
|
|
308
|
+
enableCameraButtonTitle?: string;
|
|
309
|
+
|
|
310
|
+
/** 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. */
|
|
311
|
+
enableCameraExplanationText?: string;
|
|
312
|
+
|
|
313
|
+
/** The text for the data fetching state of the barcode item in a list. Smth "Fetching info…" */
|
|
314
|
+
fetchingStateText?: string;
|
|
315
|
+
|
|
316
|
+
/** Text of the message that there are no barcodes scanned */
|
|
317
|
+
noBarcodesTitle?: string;
|
|
318
|
+
|
|
319
|
+
/** Text of the button which finishes the flow */
|
|
320
|
+
submitButtonTitle?: string;
|
|
321
|
+
|
|
322
|
+
/** The expected density of QR codes in an image. */
|
|
323
|
+
codeDensity?: CodeDensity;
|
|
324
|
+
|
|
325
|
+
/** If `true`, replaces the cancel button in the top bar with a back arrow icon. The default value is FALSE. Android only. */
|
|
326
|
+
replaceCancelButtonWithIcon?: boolean;
|
|
327
|
+
|
|
328
|
+
/** Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only */
|
|
329
|
+
cameraPreviewMode?: CameraPreviewMode;
|
|
330
|
+
|
|
331
|
+
/** Sets auto close timer in seconds. 0 = disabled and it is the default value. Android only */
|
|
332
|
+
autoCancelTimeout?: number;
|
|
333
|
+
|
|
334
|
+
/** Scanning delay after scanner appearance in seconds. Defaults to 0 secs. */
|
|
335
|
+
initialScanDelay?: number;
|
|
336
|
+
|
|
337
|
+
/** Display the region of interest. The default value is TRUE. */
|
|
338
|
+
viewFinderEnabled?: boolean;
|
|
339
|
+
|
|
340
|
+
/** The selection overay configuration. */
|
|
341
|
+
overlayConfiguration?: SelectionOverlayConfiguration;
|
|
342
|
+
|
|
343
|
+
/** Filter barcodes results by regular expression. To accept scanned barcode, regular expression should match the entire barcode value */
|
|
344
|
+
barcodeValueFilter?: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface ScanbotBarcodeSdkConfiguration {
|
|
348
|
+
/** Optional boolean flag to enable logging. See the "Logging" section below. */
|
|
349
|
+
loggingEnabled?: boolean;
|
|
350
|
+
|
|
351
|
+
/** Optional boolean flag that enables Scanbot SDK Core native logging (default is false, Android only). */
|
|
352
|
+
enableNativeLogging?: boolean;
|
|
353
|
+
|
|
354
|
+
/** Your license key for the Scanbot SDK. See the "License Key" section below. */
|
|
355
|
+
licenseKey?: string;
|
|
356
|
+
|
|
357
|
+
/** Optional directory as file URI to override the default storage base directory of the Scanbot SDK. Refer to the section "Storage" for more details. */
|
|
358
|
+
storageBaseDirectory?: string;
|
|
359
|
+
|
|
360
|
+
/** Optional file encryption mode, 'AES128' or 'AES256'. */
|
|
361
|
+
fileEncryptionMode?: FileEncryptionMode;
|
|
362
|
+
|
|
363
|
+
/** Optional file encryption password. Refer to the section "Storage Encryption" for more details. */
|
|
364
|
+
fileEncryptionPassword?: string;
|
|
365
|
+
|
|
366
|
+
/** If set to `true`, Camera X will be used for the RTU-UI components (Android only). Default is `true`. */
|
|
367
|
+
useCameraX?: boolean;
|
|
368
|
+
|
|
369
|
+
/** If set to `true`, GPU Acceleration will be enabled for Barcode Scanner, Document Scanner and Generic Document Recognizer (Android only). Default is `true`. */
|
|
370
|
+
allowGpuAcceleration?: boolean;
|
|
371
|
+
|
|
372
|
+
/** Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators (Android only) */
|
|
373
|
+
allowXnnpackAcceleration?: boolean;
|
|
374
|
+
}
|