react-native-scanbot-barcode-scanner-sdk 3.1.0-alpha2 → 3.1.0-alpha3

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/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "react-native-scanbot-barcode-scanner-sdk",
3
3
  "title": "Scanbot Barcode Scanner SDK for React Native",
4
- "version": "3.1.0-alpha2",
4
+ "version": "3.1.0-alpha3",
5
5
  "description": "React Native plugin for the Scanbot Barcode Scanner SDK on Android and iOS",
6
6
  "main": "index.js",
7
7
  "files": [
8
8
  "src/*.js",
9
+ "src/*.ts",
9
10
  "src/components/**/*.ts",
10
11
  "src/components/**/*.tsx",
11
12
  "src/components/**/*.js",
@@ -0,0 +1,316 @@
1
+ /*
2
+ Scanbot Barcode Scanner SDK React Native Plugin
3
+ Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ https://scanbot.io/sdk
5
+ */
6
+ import { FinderAspectRatio } from "./model";
7
+ import {
8
+ BarcodeDocumentFormat,
9
+ BarcodeFormat,
10
+ BarcodeImageGenerationType,
11
+ UIInterfaceOrientationMask,
12
+ EngineMode
13
+ } from "./enum";
14
+ import { MSIPlesseyChecksumAlgorithm } from "react-native-scanbot-barcode-scanner-sdk/src/enum";
15
+
16
+ export interface BarcodeScannerConfiguration
17
+ {
18
+ /**
19
+ * An optional array of barcode document formats that act as a detection filter.
20
+ * By default all supported document formats will be detected.
21
+ */
22
+ acceptedDocumentFormats?: BarcodeDocumentFormat[];
23
+ /**
24
+ * Allowed orientations for automatic interface rotations. *
25
+ */
26
+ allowedInterfaceOrientations?: UIInterfaceOrientationMask;
27
+ /**
28
+ * Background color of the detection overlay.
29
+ */
30
+ cameraOverlayColor?: string;
31
+ /**
32
+ * Whether the cancel button is hidden or not.
33
+ */
34
+ cancelButtonHidden?: boolean;
35
+ /**
36
+ * String being displayed on the cancel button.
37
+ */
38
+ cancelButtonTitle?: string;
39
+ /**
40
+ * Foreground color of the detection overlay.
41
+ */
42
+ finderLineColor?: string;
43
+ /**
44
+ * Width of finder frame border. Default is 2.
45
+ */
46
+ finderLineWidth?: number;
47
+ /**
48
+ * String being displayed as description.
49
+ */
50
+ finderTextHint?: string;
51
+ /**
52
+ * Foreground color of the description label.
53
+ */
54
+ finderTextHintColor?: string;
55
+ /**
56
+ * Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
57
+ * Default is 1 - it is a square frame, which is good for QR capturing.
58
+ */
59
+ finderAspectRatio?: FinderAspectRatio;
60
+ /**
61
+ * String being displayed on the flash button.
62
+ */
63
+ flashButtonTitle?: string;
64
+ /**
65
+ * Foreground color of the flash button when flash is off.
66
+ */
67
+ flashButtonInactiveColor?: string;
68
+ /**
69
+ * Whether flash is toggled on or off.
70
+ */
71
+ flashEnabled?: boolean;
72
+ /**
73
+ * Optional minimum required text length of the detected barcode.
74
+ * The default is 0 (setting is turned off).
75
+ * NOTE: This feature works on ITF barcodes only.
76
+ */
77
+ minimumTextLength?: number,
78
+ /**
79
+ * Optional maximum required text length of the detected barcode.
80
+ * The default is 0 (setting is turned off).
81
+ * NOTE: This feature works on ITF barcodes only.
82
+ */
83
+ maximumTextLength?: number,
84
+ /**
85
+ * Optional minimum required quiet zone on the barcode.
86
+ * Measured in modules (the size of minimal bar on the barcode).
87
+ * The default is 10.
88
+ * NOTE: This feature works on ITF barcodes only.
89
+ */
90
+ minimum1DBarcodesQuietZone?: number
91
+ /**
92
+ * Whether scanner screen should make a sound on successful barcode or MRZ detection.
93
+ */
94
+ successBeepEnabled?: boolean;
95
+ /**
96
+ * Background color of the top bar.
97
+ */
98
+ topBarBackgroundColor?: string;
99
+ /**
100
+ * Foreground color of the cancel button.
101
+ */
102
+ topBarButtonsColor?: string;
103
+ /**
104
+ * Accepted barcode formats
105
+ */
106
+ barcodeFormats?: BarcodeFormat[];
107
+ /**
108
+ * Specifies the way of barcode images generation or disables this generation at all.
109
+ * Use, if you want to receive a full sized image with barcodes. Defaults to NONE.
110
+ */
111
+ barcodeImageGenerationType?: BarcodeImageGenerationType;
112
+ /**
113
+ * Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
114
+ * Android only.
115
+ */
116
+ useButtonsAllCaps?: boolean;
117
+ /**
118
+ * With this option, the scanner assumes that the barcode can be a GS1 barcode, and modify the behavior as needed.
119
+ * You can set it to 'false', if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
120
+ * The default is 'true'.
121
+ * NOTE: Currently works for CODE128 barcodes only!
122
+ */
123
+ enableGS1Decoding?: boolean
124
+ /**
125
+ * The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
126
+ * The default value is 0.
127
+ */
128
+ cameraZoomFactor?: number;
129
+
130
+ /**
131
+ * The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
132
+ * To use legacy recognizer, please specify LEGACY
133
+ */
134
+ engineMode?: EngineMode;
135
+
136
+ /**
137
+ * When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
138
+ * Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
139
+ * The default value is `true`.
140
+ * NOTE: Currently works for CODE128 barcodes only!
141
+ */
142
+ gs1DecodingEnabled?: boolean,
143
+
144
+ /**
145
+ * The checksum algorithms for MSI Plessey barcodes.
146
+ * The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
147
+ */
148
+ msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm,
149
+ }
150
+
151
+ export interface BatchBarcodeScannerConfiguration
152
+ {
153
+ /**
154
+ * An optional array of barcode document formats that act as a detection filter.
155
+ * By default all supported document formats will be detected.
156
+ *
157
+ * NOTE: Android only.
158
+ */
159
+ acceptedDocumentFormats?: BarcodeDocumentFormat[];
160
+ /**
161
+ * Allowed orientations for automatic interface rotations. *
162
+ */
163
+ allowedInterfaceOrientations?: UIInterfaceOrientationMask;
164
+ /**
165
+ * String used for displaying amount of scanned barcodes. Use %d for number formatting symbol.
166
+ */
167
+ barcodesCountText?: string;
168
+ /**
169
+ * Text color of the barcodes count label.
170
+ */
171
+ barcodesCountTextColor?: string;
172
+ /**
173
+ * Background color of the detection overlay.
174
+ */
175
+ cameraOverlayColor?: string;
176
+ /**
177
+ * Whether the cancel button is hidden or not.
178
+ */
179
+ cancelButtonHidden?: boolean;
180
+ /**
181
+ * String being displayed on the cancel button.
182
+ */
183
+ cancelButtonTitle?: string;
184
+ /**
185
+ * String being displayed on the clear button.
186
+ */
187
+ clearButtonTitle?: string;
188
+ /**
189
+ * String being displayed on the delete button.
190
+ */
191
+ deleteButtonTitle?: string;
192
+ /**
193
+ * Foreground color of the top bar buttons on the details screen.
194
+ */
195
+ detailsActionColor?: string;
196
+ /**
197
+ * Background color of the details screen.
198
+ */
199
+ detailsBackgroundColor?: string;
200
+ /**
201
+ * Text color in the details barcodes list. Also affects image background, separator and progress spinner.
202
+ */
203
+ detailsPrimaryColor?: string;
204
+ /**
205
+ * String used to show process of fetching mapped data for barcodes.
206
+ */
207
+ fetchingStateText?: string;
208
+ /**
209
+ * Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
210
+ * Default is 1 - it is a square frame, which is good for QR capturing.
211
+ */
212
+ finderAspectRatio?: FinderAspectRatio;
213
+ /**
214
+ * Foreground color of the detection overlay.
215
+ */
216
+ finderLineColor?: string;
217
+ /**
218
+ * Width of finder frame border. Default is 2.
219
+ */
220
+ finderLineWidth?: number;
221
+ /**
222
+ * String being displayed as description.
223
+ */
224
+ finderTextHint?: string;
225
+ /**
226
+ * Foreground color of the description label.
227
+ */
228
+ finderTextHintColor?: string;
229
+ /**
230
+ * Whether flash is toggled on or off.
231
+ */
232
+ flashEnabled?: boolean;
233
+ /**
234
+ * String to show that no barcodes were scanned yet.
235
+ */
236
+ noBarcodesTitle?: string;
237
+ /**
238
+ * Enables or disables the barcode detection.
239
+ */
240
+ recognitionEnabled?: boolean;
241
+ /**
242
+ * String being displayed on the submit button.
243
+ */
244
+ submitButtonTitle?: string;
245
+ /**
246
+ * Whether scanner screen should make a sound on successful barcode or MRZ detection.
247
+ */
248
+ successBeepEnabled?: boolean;
249
+ /**
250
+ * Background color of the top bar.
251
+ */
252
+ topBarBackgroundColor?: string;
253
+ /**
254
+ * Foreground color of the top bar buttons on the scanning screen.
255
+ */
256
+ topBarButtonsColor?: string;
257
+ /**
258
+ * Foreground color of the flash button when flash is off.
259
+ */
260
+ topBarButtonsInactiveColor?: string;
261
+ /**
262
+ * Accepted barcode formats
263
+ */
264
+ barcodeFormats?: BarcodeFormat[];
265
+ /**
266
+ * Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
267
+ * Android only.
268
+ */
269
+ useButtonsAllCaps?: boolean;
270
+ /**
271
+ * Optional minimum required text length of the detected barcode.
272
+ * The default is 0 (setting is turned off).
273
+ * NOTE: This feature works on ITF barcodes only.
274
+ */
275
+ minimumTextLength?: number,
276
+ /**
277
+ * Optional maximum required text length of the detected barcode.
278
+ * The default is 0 (setting is turned off).
279
+ * NOTE: This feature works on ITF barcodes only.
280
+ */
281
+ maximumTextLength?: number,
282
+ /**
283
+ * Optional minimum required quiet zone on the barcode.
284
+ * Measured in modules (the size of minimal bar on the barcode).
285
+ * The default is 10.
286
+ * NOTE: This feature works on ITF barcodes only.
287
+ */
288
+ minimum1DBarcodesQuietZone?: number
289
+ /**
290
+ * With this option, the scanner assumes that the barcode can be a GS1 barcode, and modify the behavior as needed.
291
+ * You can set it to 'false', if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
292
+ * The default is 'true'.
293
+ * NOTE: Currently works for CODE128 barcodes only!
294
+ */
295
+ enableGS1Decoding?: boolean
296
+
297
+ /**
298
+ * The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
299
+ * To use legacy recognizer, please specify LEGACY
300
+ */
301
+ engineMode?: EngineMode;
302
+
303
+ /**
304
+ * When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
305
+ * Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
306
+ * The default value is `true`.
307
+ * NOTE: Currently works for CODE128 barcodes only!
308
+ */
309
+ gs1DecodingEnabled?: boolean,
310
+
311
+ /**
312
+ * The checksum algorithms for MSI Plessey barcodes.
313
+ * The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
314
+ */
315
+ msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm,
316
+ }
package/src/enum.ts ADDED
@@ -0,0 +1,76 @@
1
+ /*
2
+ Scanbot Barcode Scanner SDK React Native Plugin
3
+ Copyright (c) 2020 doo GmbH. All rights reserved.
4
+ https://scanbot.io/sdk
5
+ */
6
+
7
+ export type Status = "OK" | "CANCELED";
8
+
9
+ export type LicenseStatus =
10
+ "Okay" |
11
+ "Trial" |
12
+ "Expired" |
13
+ "WrongOS" |
14
+ "Corrupted" |
15
+ "AppIDMismatch" |
16
+ "NotSet" |
17
+ "Unknown";
18
+
19
+ export type CameraImageFormat = "JPG" | "PNG";
20
+ export type DocumentDetectorMode = "EDGE_BASED" | "ML_BASED";
21
+ export type FileEncryptionMode = "AES128" | "AES256";
22
+
23
+ export type UIInterfaceOrientationMask =
24
+ "PORTRAIT"
25
+ | "LANDSCAPE_LEFT"
26
+ | "LANDSCAPE_RIGHT"
27
+ | "PORTRAIT_UPSIDE_DOWN"
28
+ | "LANDSCAPE"
29
+ | "ALL"
30
+ | "ALL_BUT_UPSIDE_DOWN";
31
+
32
+ export type BarcodeImageGenerationType =
33
+ "NONE"
34
+ | "VIDEO_FRAME"
35
+ | "CAPTURED_IMAGE";
36
+
37
+ export type BarcodeDocumentFormat =
38
+ "AAMVA" |
39
+ "BOARDING_PASS" |
40
+ "DE_MEDICAL_PLAN" |
41
+ "DISABILITY_CERTIFICATE" |
42
+ "ID_CARD_PDF_417" |
43
+ "SEPA" |
44
+ "SWISS_QR" |
45
+ "VCARD";
46
+
47
+ export type BarcodeFormat =
48
+ "AZTEC" |
49
+ "CODABAR" |
50
+ "CODE_39" |
51
+ "CODE_93" |
52
+ "CODE_128" |
53
+ "DATA_MATRIX" |
54
+ "EAN_8" |
55
+ "EAN_13" |
56
+ "ITF" |
57
+ "PDF_417" |
58
+ "QR_CODE" |
59
+ "RSS_14" |
60
+ "RSS_EXPANDED" |
61
+ "UPC_A" |
62
+ "UPC_E" |
63
+ "UNKNOWN" |
64
+ "MSI_PLESSEY";
65
+
66
+ export type EngineMode = "LEGACY" | "NEXT_GEN";
67
+
68
+ export type MSIPlesseyChecksumAlgorithm =
69
+ "None" |
70
+ "Mod10" |
71
+ "Mod11IBM" |
72
+ "Mod11NCR" |
73
+ "Mod1010" |
74
+ "Mod1110IBM" |
75
+ "Mod1110NCR"
76
+ ;
package/src/model.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { CameraImageFormat, DocumentDetectorMode, FileEncryptionMode, LicenseStatus } from "./enum";
2
+
3
+ export interface InitializationOptions {
4
+ licenseKey: string;
5
+ loggingEnabled?: boolean;
6
+ storageImageQuality?: number;
7
+ storageImageFormat?: CameraImageFormat;
8
+ storageBaseDirectory?: string;
9
+ }
10
+
11
+ export interface LicenseInfo {
12
+ isLicenseValid: boolean;
13
+ licenseStatus: LicenseStatus;
14
+ licenseExpirationDate?: number;
15
+ }
16
+
17
+ export interface FinderAspectRatio {
18
+ width: number;
19
+ height: number;
20
+ }
package/src/result.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { BarcodeFormat, Status } from "./enum";
2
+
3
+ export interface BarcodeResultField {
4
+ /**
5
+ * The barcode format.
6
+ */
7
+ type: BarcodeFormat;
8
+
9
+ /**
10
+ * The raw text encoded in the barcode.
11
+ */
12
+ text: string;
13
+ }
14
+
15
+ export interface BarcodeResult {
16
+ status: Status;
17
+ barcodes?: BarcodeResultField[];
18
+ }
19
+
20
+ export type BarcodeScannerResult = BarcodeResult & {
21
+ imageFileUri?: string
22
+ }
23
+
24
+ export type BatchBarcodeScannerResult = BarcodeResult;