react-native-scanbot-barcode-scanner-sdk 4.2.0 → 4.3.0-beta.1

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.
Files changed (64) hide show
  1. package/Libraries.txt +31 -31
  2. package/RNScanbotBarcodeSDK.podspec +1 -4
  3. package/android/build.gradle +6 -5
  4. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.kt +9 -7
  5. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerView.kt +114 -0
  6. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +56 -0
  7. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +256 -0
  8. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/JSONObject.kt +18 -2
  9. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt +3 -4
  10. package/android/src/newarch/ScanbotBarcodeScannerViewManagerSpec.kt +19 -0
  11. package/android/src/oldarch/ScanbotBarcodeScannerViewManagerSpec.kt +29 -0
  12. package/dist/components/barcode-camera-view/ScanbotBarcodeCameraView.d.ts +3 -0
  13. package/dist/components/barcode-camera-view/ScanbotBarcodeCameraView.js +122 -0
  14. package/dist/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +89 -0
  15. package/dist/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.js +2 -0
  16. package/dist/components/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +54 -0
  17. package/dist/components/spec/ScanbotBarcodeScannerViewNativeComponent.js +12 -0
  18. package/dist/configurations.d.ts +241 -0
  19. package/dist/configurations.js +2 -0
  20. package/dist/customConfigurations.d.ts +94 -0
  21. package/dist/customConfigurations.js +2 -0
  22. package/dist/customResults.d.ts +5 -0
  23. package/dist/customResults.js +2 -0
  24. package/dist/customTypes.d.ts +7 -0
  25. package/dist/customTypes.js +2 -0
  26. package/dist/index.d.ts +26 -0
  27. package/dist/index.js +34 -0
  28. package/dist/results.d.ts +29 -0
  29. package/dist/results.js +2 -0
  30. package/dist/types.d.ts +1194 -0
  31. package/dist/types.js +2 -0
  32. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.h +25 -0
  33. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +194 -0
  34. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.h +20 -0
  35. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +259 -0
  36. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +99 -0
  37. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +196 -0
  38. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewManager.mm +73 -0
  39. package/package.json +16 -21
  40. package/src/components/barcode-camera-view/ScanbotBarcodeCameraView.tsx +112 -0
  41. package/src/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +106 -0
  42. package/src/components/spec/ScanbotBarcodeScannerViewNativeComponent.ts +59 -0
  43. package/src/index.ts +58 -0
  44. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +0 -401
  45. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventEmitter.java +0 -78
  46. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventReceiver.java +0 -119
  47. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/ui/ScanbotViewWrapper.java +0 -26
  48. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.kt +0 -24
  49. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +0 -43
  50. package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -125
  51. package/android/src/old-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -114
  52. package/index.d.ts +0 -42
  53. package/index.js +0 -20
  54. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.h +0 -44
  55. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +0 -338
  56. package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraViewManager.mm +0 -71
  57. package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.h +0 -36
  58. package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.mm +0 -181
  59. package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.h +0 -28
  60. package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.mm +0 -89
  61. package/js/RTNScanbotBarcodeCameraViewNativeComponent.ts +0 -186
  62. package/src/components/barcode-camera-view/scanbot-barcode-camera-view-types.ts +0 -175
  63. package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +0 -270
  64. package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.ts +0 -7
@@ -0,0 +1,241 @@
1
+ import { AspectRatio, BarcodeDocumentFormat, BarcodeFormat, BarcodesExtensionFilter, CameraModule, CameraPreviewMode, CodeDensity, ConfirmationDialogConfiguration, EngineMode, FileEncryptionMode, Gs1HandlingMode, MSIPlesseyChecksumAlgorithm, OrientationLockMode, SelectionOverlayConfiguration, ZoomRange } from './types';
2
+ export interface BarcodeScannerConfiguration {
3
+ /** An optional array of barcode document formats that act as a detection filter. By default all supported document formats will be detected. */
4
+ acceptedDocumentFormats?: BarcodeDocumentFormat[];
5
+ /** The extension filter for EAN and UPC barcodes. */
6
+ barcodesExtensionFilter?: BarcodesExtensionFilter;
7
+ /** Background color of the detection overlay. */
8
+ cameraOverlayColor?: string;
9
+ /** Background color of the detection overlay. */
10
+ cameraModule?: CameraModule;
11
+ /** 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. */
12
+ cameraZoomFactor?: number;
13
+ /** Whether the cancel button is hidden or not. iOS only. */
14
+ cancelButtonHidden?: boolean;
15
+ /** String being displayed on the cancel button. */
16
+ cancelButtonTitle?: string;
17
+ /** The engine mode to be used for barcode scanning. The default value is NEXT_GEN. */
18
+ engineMode?: EngineMode;
19
+ /** Title of the button that opens the screen where the user can allow the usage of the camera by the app. */
20
+ enableCameraButtonTitle?: string;
21
+ /** 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. */
22
+ enableCameraExplanationText?: string;
23
+ /** Foreground color of the detection overlay. */
24
+ finderLineColor?: string;
25
+ /** Width of finder frame border. Default is 2. */
26
+ finderLineWidth?: number;
27
+ /** String being displayed as description. */
28
+ finderTextHint?: string;
29
+ /** Foreground color of the description label. */
30
+ finderTextHintColor?: string;
31
+ /** 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. */
32
+ finderAspectRatio?: AspectRatio;
33
+ /** Controls whether the flash toggle button is hidden or not. iOS only. */
34
+ flashButtonHidden?: boolean;
35
+ /** String being displayed on the flash button. iOS only. */
36
+ flashButtonTitle?: string;
37
+ /** Foreground color of the flash button when flash is off. */
38
+ flashButtonInactiveColor?: string;
39
+ /** Whether flash is toggled on or off. */
40
+ flashEnabled?: boolean;
41
+ /** 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. */
42
+ focusLockEnabled?: boolean;
43
+ /** 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. */
44
+ focusLockPosition?: number;
45
+ /** Whether touch-to-focus is enabled on camera preview. Enabled by default. Android only. */
46
+ touchToFocusEnabled?: boolean;
47
+ /** UI Interface orientation lock mode */
48
+ orientationLockMode?: OrientationLockMode;
49
+ /** 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. */
50
+ minimumTextLength?: number;
51
+ /** Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
52
+ maximumTextLength?: number;
53
+ /** Lock focus distance withing minimum possible range */
54
+ minFocusDistanceLock?: boolean;
55
+ /** 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. */
56
+ minimum1DBarcodesQuietZone?: number;
57
+ /** 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` */
58
+ stripCheckDigits?: boolean;
59
+ /** Whether scanner screen should make a sound on successful barcode or MRZ detection. */
60
+ successBeepEnabled?: boolean;
61
+ /** Background color of the top bar. */
62
+ topBarBackgroundColor?: string;
63
+ /** Foreground color of the cancel button. */
64
+ topBarButtonsColor?: string;
65
+ /** Accepted barcode formats */
66
+ barcodeFormats?: BarcodeFormat[];
67
+ /** Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE. Android only. */
68
+ useButtonsAllCaps?: boolean;
69
+ /** If `true`, replaces the cancel button in the top bar with a back arrow icon. The default value is FALSE. Android only. */
70
+ replaceCancelButtonWithIcon?: boolean;
71
+ /** Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only */
72
+ cameraPreviewMode?: CameraPreviewMode;
73
+ /** The range of valid camera zoom factors. Default value is (1.0; 12.0). */
74
+ cameraZoomRange?: ZoomRange;
75
+ /** Sets auto close timer in seconds. 0 = disabled and it is the default value. */
76
+ autoCancelTimeout?: number;
77
+ /** The GS1 handling mode. The default value is PARSE. */
78
+ gs1HandlingMode?: Gs1HandlingMode;
79
+ /** The checksum algorithm for MSI Plessey barcodes. The default value is MOD_10. */
80
+ msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
81
+ /** 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. */
82
+ lowPowerMode?: boolean;
83
+ /** The expected density of QR codes in an image. */
84
+ codeDensity?: CodeDensity;
85
+ /** Scanning delay after scanner appearance in seconds. Defaults to 0 secs. */
86
+ initialScanDelay?: number;
87
+ /** Freezes a preview after a scan for a given amount of seconds. Defaults to 0 secs. Android only. */
88
+ delayAfterScan?: number;
89
+ /** When this property is set to true, the zoom can be activated by double tapping somewhere in the receivers view. iOS only. */
90
+ doubleTapToZoomEnabled?: boolean;
91
+ /** When this property is set to true, the zoom can be activated by a pinch gesture somewhere in the receivers view. iOS only. */
92
+ pinchToZoomEnabled?: boolean;
93
+ /** Defines, if zooming in or out should be animated. iOS only. */
94
+ shouldAnimateZooming?: boolean;
95
+ /** Display the region of interest. The default value is TRUE. */
96
+ viewFinderEnabled?: boolean;
97
+ /** The confirmation dialog configuration. */
98
+ confirmationDialogConfiguration?: ConfirmationDialogConfiguration;
99
+ /** The selection overlay configuration. */
100
+ overlayConfiguration?: SelectionOverlayConfiguration;
101
+ /** Filter barcodes results by regular expression. To accept scanned barcode, regular expression should match the entire barcode value */
102
+ barcodeValueFilter?: string;
103
+ }
104
+ export interface BatchBarcodeScannerConfiguration {
105
+ /** An optional array of barcode document formats that act as a detection filter. By default all supported document formats will be detected. */
106
+ acceptedDocumentFormats?: BarcodeDocumentFormat[];
107
+ /** The extension filter for EAN and UPC barcodes. */
108
+ barcodesExtensionFilter?: BarcodesExtensionFilter;
109
+ /** Background color of the detection overlay. */
110
+ cameraOverlayColor?: string;
111
+ /** Background color of the detection overlay. */
112
+ cameraModule?: CameraModule;
113
+ /** 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. */
114
+ cameraZoomFactor?: number;
115
+ /** The range of valid camera zoom factors. Default value is (1.0; 12.0). */
116
+ cameraZoomRange?: ZoomRange;
117
+ /** Whether the cancel button is hidden or not. iOS only. */
118
+ cancelButtonHidden?: boolean;
119
+ /** String being displayed on the cancel button. */
120
+ cancelButtonTitle?: string;
121
+ /** When this property is set to true, the zoom can be activated by double tapping somewhere in the receivers view. iOS only. */
122
+ doubleTapToZoomEnabled?: boolean;
123
+ /** When this property is set to true, the zoom can be activated by a pinch gesture somewhere in the receivers view. iOS only. */
124
+ pinchToZoomEnabled?: boolean;
125
+ /** Defines, if zooming in or out should be animated. iOS only. */
126
+ shouldAnimateZooming?: boolean;
127
+ /** The engine mode to be used for barcode scanning. The default value is NEXT_GEN. */
128
+ engineMode?: EngineMode;
129
+ /** Foreground color of the detection overlay. */
130
+ finderLineColor?: string;
131
+ /** Width of finder frame border. Default is 2. */
132
+ finderLineWidth?: number;
133
+ /** String being displayed as description. */
134
+ finderTextHint?: string;
135
+ /** Foreground color of the description label. */
136
+ finderTextHintColor?: string;
137
+ /** 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. */
138
+ finderAspectRatio?: AspectRatio;
139
+ /** Controls whether the flash toggle button is hidden or not. iOS only. */
140
+ flashButtonHidden?: boolean;
141
+ /** String being displayed on the flash button. iOS only. */
142
+ flashButtonTitle?: string;
143
+ /** Whether flash is toggled on or off. */
144
+ flashEnabled?: boolean;
145
+ /** Disables auto-focus and locks the lens at the specified focus lock lens position. The default value is false. iOS only. */
146
+ focusLockEnabled?: boolean;
147
+ /** 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. */
148
+ focusLockPosition?: number;
149
+ /** Whether touch-to-focus is enabled on camera preview. Enabled by default. Android only. */
150
+ touchToFocusEnabled?: boolean;
151
+ /** UI Interface orientation lock mode */
152
+ orientationLockMode?: OrientationLockMode;
153
+ /** 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. */
154
+ minimumTextLength?: number;
155
+ /** Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
156
+ maximumTextLength?: number;
157
+ /** 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. */
158
+ minimum1DBarcodesQuietZone?: number;
159
+ /** Lock focus distance withing minimum possible range */
160
+ minFocusDistanceLock?: boolean;
161
+ /** 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` */
162
+ stripCheckDigits?: boolean;
163
+ /** Whether scanner screen should make a sound on successful barcode or MRZ detection. */
164
+ successBeepEnabled?: boolean;
165
+ /** Background color of the top bar. */
166
+ topBarBackgroundColor?: string;
167
+ /** Foreground color of the cancel button. */
168
+ topBarButtonsColor?: string;
169
+ /** Foreground color of the top bar buttons when disabled. */
170
+ topBarButtonsInactiveColor?: string;
171
+ /** Accepted barcode formats */
172
+ barcodeFormats?: BarcodeFormat[];
173
+ /** Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE. Android only. */
174
+ useButtonsAllCaps?: boolean;
175
+ /** The GS1 handling mode. The default value is PARSE. */
176
+ gs1HandlingMode?: Gs1HandlingMode;
177
+ /** The checksum algorithm for MSI Plessey barcodes. The default value is MOD_10. */
178
+ msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
179
+ /** 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. */
180
+ lowPowerMode?: boolean;
181
+ /** The color for barcodes count text */
182
+ barcodesCountText?: string;
183
+ /** The color for barcodes count text */
184
+ barcodesCountTextColor?: string;
185
+ /** Text of the button which clears the list of scanned barcodes. */
186
+ clearButtonTitle?: string;
187
+ /** The color of Submit button */
188
+ detailsActionColor?: string;
189
+ /** The color of bottom sheet */
190
+ detailsBackgroundColor?: string;
191
+ /** The color of text elements in bottom sheet */
192
+ detailsPrimaryColor?: string;
193
+ /** String being displayed on the delete button. iOS only. */
194
+ deleteButtonTitle?: string;
195
+ /** Title of the button that opens the screen where the user can allow the usage of the camera by the app. */
196
+ enableCameraButtonTitle?: string;
197
+ /** 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. */
198
+ enableCameraExplanationText?: string;
199
+ /** The text for the data fetching state of the barcode item in a list. Smth "Fetching info…" */
200
+ fetchingStateText?: string;
201
+ /** Text of the message that there are no barcodes scanned */
202
+ noBarcodesTitle?: string;
203
+ /** Text of the button which finishes the flow */
204
+ submitButtonTitle?: string;
205
+ /** The expected density of QR codes in an image. */
206
+ codeDensity?: CodeDensity;
207
+ /** If `true`, replaces the cancel button in the top bar with a back arrow icon. The default value is FALSE. Android only. */
208
+ replaceCancelButtonWithIcon?: boolean;
209
+ /** Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only */
210
+ cameraPreviewMode?: CameraPreviewMode;
211
+ /** Sets auto close timer in seconds. 0 = disabled and it is the default value. Android only */
212
+ autoCancelTimeout?: number;
213
+ /** Scanning delay after scanner appearance in seconds. Defaults to 0 secs. */
214
+ initialScanDelay?: number;
215
+ /** Display the region of interest. The default value is TRUE. */
216
+ viewFinderEnabled?: boolean;
217
+ /** The selection overay configuration. */
218
+ overlayConfiguration?: SelectionOverlayConfiguration;
219
+ /** Filter barcodes results by regular expression. To accept scanned barcode, regular expression should match the entire barcode value */
220
+ barcodeValueFilter?: string;
221
+ }
222
+ export interface ScanbotBarcodeSdkConfiguration {
223
+ /** Optional boolean flag to enable logging. See the "Logging" section below. */
224
+ loggingEnabled?: boolean;
225
+ /** Optional boolean flag that enables Scanbot SDK Core native logging (default is false, Android only). */
226
+ enableNativeLogging?: boolean;
227
+ /** Your license key for the Scanbot SDK. See the "License Key" section below. */
228
+ licenseKey?: string;
229
+ /** Optional directory as file URI to override the default storage base directory of the Scanbot SDK. Refer to the section "Storage" for more details. */
230
+ storageBaseDirectory?: string;
231
+ /** Optional file encryption mode, 'AES128' or 'AES256'. */
232
+ fileEncryptionMode?: FileEncryptionMode;
233
+ /** Optional file encryption password. Refer to the section "Storage Encryption" for more details. */
234
+ fileEncryptionPassword?: string;
235
+ /** If set to `true`, Camera X will be used for the RTU-UI components (Android only). Default is `true`. */
236
+ useCameraX?: boolean;
237
+ /** If set to `true`, GPU Acceleration will be enabled for Barcode Scanner, Document Scanner and Generic Document Recognizer (Android only). Default is `true`. */
238
+ allowGpuAcceleration?: boolean;
239
+ /** Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators (Android only) */
240
+ allowXnnpackAcceleration?: boolean;
241
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,94 @@
1
+ import { CompressFormat } from "./customTypes";
2
+ import { BarcodeDocumentFormat, BarcodeFormat, CodeDensity, EngineMode, Gs1HandlingMode, MSIPlesseyChecksumAlgorithm } from "./types";
3
+ interface InternalBarcodeDetectionCommonParameters {
4
+ /**
5
+ * Accepted barcode formats
6
+ */
7
+ barcodeFormats?: BarcodeFormat[];
8
+ /**
9
+ * An optional array of barcode document formats that act as a detection filter.
10
+ * By default all supported document formats will be detected.
11
+ */
12
+ acceptedDocumentFormats?: BarcodeDocumentFormat[];
13
+ /**
14
+ * Barcode scanner engine mode. Default is NEXT_GEN
15
+ */
16
+ engineMode?: EngineMode;
17
+ /**
18
+ * Optional minimum required text length of the detected barcode.
19
+ * The default is 0 (setting is turned off).
20
+ * NOTE: This feature works on ITF barcodes only.
21
+ */
22
+ minimumTextLength?: number;
23
+ /**
24
+ * Optional maximum required text length of the detected barcode.
25
+ * The default is 0 (setting is turned off).
26
+ * NOTE: This feature works on ITF barcodes only.
27
+ */
28
+ maximumTextLength?: number;
29
+ /**
30
+ * Optional minimum required quiet zone on the barcode.
31
+ * Measured in modules (the size of minimal bar on the barcode).
32
+ * The default is 10.
33
+ * NOTE: This feature works on ITF barcodes only.
34
+ */
35
+ minimum1DBarcodesQuietZone?: number;
36
+ /** The GS1 handling mode. The default value is PARSE. */
37
+ gs1HandlingMode?: Gs1HandlingMode;
38
+ /**
39
+ * With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
40
+ * Has no effect if both single and double digit MSI Plessey checksums are enabled.
41
+ * The default is `false`
42
+ */
43
+ stripCheckDigits?: boolean;
44
+ /**
45
+ * The checksum algorithm for MSI Plessey barcodes.
46
+ * The default value is Mod10.
47
+ */
48
+ msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
49
+ /**
50
+ * 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.
51
+ * */
52
+ lowPowerMode?: boolean;
53
+ /**
54
+ * The expected density of QR codes in an image.
55
+ */
56
+ codeDensity?: CodeDensity;
57
+ }
58
+ export interface DetectBarcodesOnImageArguments extends InternalBarcodeDetectionCommonParameters {
59
+ /**
60
+ * The input image file URI
61
+ */
62
+ imageFileUri: string;
63
+ }
64
+ interface PdfExtractorArguments {
65
+ /**
66
+ * The location of the PDF file
67
+ */
68
+ pdfFilePath: string;
69
+ /**
70
+ * The quality that each extracted image should have.
71
+ * This tweaks the compression, affecting the final image file size.
72
+ * (100: maximum quality, 0: minimum quality)
73
+ *
74
+ * Default value is 90
75
+ */
76
+ quality?: number;
77
+ /**
78
+ * Integer scaling factor applied to the PDF media box frame while extracting.
79
+ * Affects the output image quality.
80
+ * In most cases the recommended value is 2 or higher.
81
+ *
82
+ * Default value is 2.
83
+ */
84
+ scaling?: number;
85
+ }
86
+ export interface ExtractImagesFromPdfArguments extends PdfExtractorArguments {
87
+ /**
88
+ * Compress format used for extracted images. Android only.
89
+ *
90
+ * Default value is JPEG.
91
+ */
92
+ compressFormat?: CompressFormat;
93
+ }
94
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { Status } from "./customTypes";
2
+ export interface ResultWrapper<T> {
3
+ status: Status;
4
+ data?: T;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export type Status = "OK" | "CANCELED";
2
+ /** Compress format */
3
+ export type CompressFormat =
4
+ /** JPEG image format */
5
+ 'JPEG'
6
+ /** PNG image format */
7
+ | 'PNG';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { BarcodeScannerConfiguration, BatchBarcodeScannerConfiguration, ScanbotBarcodeSdkConfiguration } from "./configurations";
2
+ import { ResultWrapper } from "./customResults";
3
+ import { BarcodeScannerResult, BatchBarcodeScannerResult, GetLicenseInfoResult } from "./results";
4
+ import { DetectBarcodesOnImageArguments, ExtractImagesFromPdfArguments } from "./customConfigurations";
5
+ import { ScanbotBarcodeCameraView } from './components/barcode-camera-view/ScanbotBarcodeCameraView';
6
+ import { ScanbotBarcodeCameraViewProperties, ScanbotBarcodeCameraViewHandle } from './components/barcode-camera-view/ScanbotBarcodeCameraViewProperties';
7
+ export interface ScanbotBarcodeSdk {
8
+ initializeSdk(config: ScanbotBarcodeSdkConfiguration): Promise<ResultWrapper<string>>;
9
+ getLicenseInfo(): Promise<ResultWrapper<GetLicenseInfoResult>>;
10
+ cleanup(): Promise<ResultWrapper<string>>;
11
+ startBarcodeScanner(config: BarcodeScannerConfiguration): Promise<ResultWrapper<BarcodeScannerResult>>;
12
+ closeBarcodeScanner(): Promise<ResultWrapper<undefined>>;
13
+ startBatchBarcodeScanner(config: BatchBarcodeScannerConfiguration): Promise<ResultWrapper<BatchBarcodeScannerResult>>;
14
+ closeBatchBarcodeScanner(): Promise<ResultWrapper<undefined>>;
15
+ detectBarcodesOnImage(args: DetectBarcodesOnImageArguments): Promise<ResultWrapper<BarcodeScannerResult>>;
16
+ extractImagesFromPDF(args: ExtractImagesFromPdfArguments): Promise<ResultWrapper<string[]>>;
17
+ }
18
+ declare const ScanbotBarcodeSDK: ScanbotBarcodeSdk;
19
+ export default ScanbotBarcodeSDK;
20
+ export * from './types';
21
+ export * from './customTypes';
22
+ export * from './results';
23
+ export * from './customResults';
24
+ export * from './configurations';
25
+ export * from './customConfigurations';
26
+ export { ScanbotBarcodeCameraView, ScanbotBarcodeCameraViewProperties, ScanbotBarcodeCameraViewHandle };
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ScanbotBarcodeCameraView = void 0;
18
+ /*
19
+ Scanbot Barcode Scanner SDK React Native Plugin
20
+ Copyright (c) 2024 Scanbot SDK GmbH. All rights reserved.
21
+ https://scanbot.io/sdk
22
+ */
23
+ var react_native_1 = require("react-native");
24
+ var ScanbotBarcodeCameraView_1 = require("./components/barcode-camera-view/ScanbotBarcodeCameraView");
25
+ Object.defineProperty(exports, "ScanbotBarcodeCameraView", { enumerable: true, get: function () { return ScanbotBarcodeCameraView_1.ScanbotBarcodeCameraView; } });
26
+ var ScanbotBarcodeSdk = react_native_1.NativeModules.ScanbotBarcodeSdk;
27
+ var ScanbotBarcodeSDK = ScanbotBarcodeSdk;
28
+ exports.default = ScanbotBarcodeSDK;
29
+ __exportStar(require("./types"), exports);
30
+ __exportStar(require("./customTypes"), exports);
31
+ __exportStar(require("./results"), exports);
32
+ __exportStar(require("./customResults"), exports);
33
+ __exportStar(require("./configurations"), exports);
34
+ __exportStar(require("./customConfigurations"), exports);
@@ -0,0 +1,29 @@
1
+ import { BarcodeResultField, DetectBarcodesOnImagesField, LicenseStatus } from './types';
2
+ export interface BarcodeScannerResult {
3
+ /** The array of detected barcodes */
4
+ barcodes?: BarcodeResultField[];
5
+ }
6
+ export interface BatchBarcodeScannerResult extends BarcodeScannerResult {
7
+ }
8
+ export interface DetectBarcodesOnImageResult {
9
+ /** The detected barcodes */
10
+ barcodes: BarcodeResultField[];
11
+ }
12
+ export interface DetectBarcodesOnImagesResult {
13
+ /** An array for which each element has a imageUri and the list of detected barcodes */
14
+ results: DetectBarcodesOnImagesField[];
15
+ }
16
+ export interface ExtractImagesFromPdfResult {
17
+ /** The URIs of the extracted images */
18
+ imageFilesUrls: string[];
19
+ }
20
+ export interface GetLicenseInfoResult {
21
+ /** True if the license is valid, false otherwise */
22
+ isLicenseValid: boolean;
23
+ /** The license status */
24
+ licenseStatus: LicenseStatus;
25
+ /** Detailed license status message for development and debug purposes */
26
+ licenseStatusMessage?: string;
27
+ /** The license expiration date in milliseconds */
28
+ licenseExpirationDate?: number;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });