react-native-scanbot-barcode-scanner-sdk 3.1.0-beta9 → 3.2.0-beta2

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 (31) hide show
  1. package/RNScanbotBarcodeSDK.podspec +1 -1
  2. package/android/.gradle/{7.0-rc-1 → 6.2}/fileChanges/last-build.bin +0 -0
  3. package/android/.gradle/6.2/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/{7.0-rc-1/dependencies-accessors → 6.2}/gc.properties +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  7. package/android/.gradle/checksums/checksums.lock +0 -0
  8. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  9. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  10. package/android/build.gradle +1 -1
  11. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ObjectMapper.java +5 -0
  12. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java +40 -55
  13. package/android/src/main/res/drawable/ic_baseline_arrow_back_24.xml +10 -0
  14. package/ios/.DS_Store +0 -0
  15. package/ios/ScanbotBarcodeSdk.m +10 -0
  16. package/ios/ScanbotBarcodeSdk.xcodeproj/xcuserdata/mayankpatil.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  17. package/ios/ScanbotBarcodeSdk.xcworkspace/xcuserdata/mayankpatil.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  18. package/ios/Utils/BarcodeMapping.h +19 -1
  19. package/package.json +1 -1
  20. package/src/configuration.ts +69 -52
  21. package/src/enum.ts +5 -2
  22. package/android/.gradle/7.0-rc-1/dependencies-accessors/dependencies-accessors.lock +0 -0
  23. package/android/.gradle/7.0-rc-1/fileHashes/fileHashes.lock +0 -0
  24. package/android/.gradle/7.0-rc-1/gc.properties +0 -0
  25. package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  26. package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
  27. package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
  28. package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
  29. package/android/.gradle/7.1.1/gc.properties +0 -0
  30. package/android/.gradle/configuration-cache/gc.properties +0 -0
  31. package/android/local.properties +0 -8
@@ -2,7 +2,7 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
- ScanbotBarcodeScannerSDKVersion = '3.1.1'
5
+ ScanbotBarcodeScannerSDKVersion = '3.2.1'
6
6
 
7
7
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
8
8
 
@@ -1,2 +1,2 @@
1
- #Mon Jan 31 14:23:43 CET 2022
2
- gradle.version=7.1.1
1
+ #Mon May 23 15:11:17 CEST 2022
2
+ gradle.version=6.2
@@ -15,7 +15,7 @@ def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
15
15
  def DEFAULT_MIN_SDK_VERSION = 21
16
16
  def DEFAULT_TARGET_SDK_VERSION = 29
17
17
 
18
- def sdkVersion = '3.1.0'
18
+ def sdkVersion = '3.2.1'
19
19
 
20
20
  def safeExtGet(prop, fallback) {
21
21
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
@@ -63,6 +63,11 @@ public final class ObjectMapper {
63
63
  continue;
64
64
  }
65
65
 
66
+ // The default FRONT camera module should be FRONT_MIRRORED on Android
67
+ if ("cameraModule".equals(prop) && "FRONT".equals(value)) {
68
+ value = "FRONT_MIRRORED";
69
+ }
70
+
66
71
  final String setterName = "set" + prop.substring(0, 1).toUpperCase() + prop.substring(1);
67
72
 
68
73
  if (methodMap.containsKey(setterName)) {
@@ -10,6 +10,7 @@ import android.content.Intent;
10
10
  import android.graphics.Bitmap;
11
11
  import android.net.Uri;
12
12
  import android.provider.MediaStore;
13
+
13
14
  import com.facebook.react.bridge.ActivityEventListener;
14
15
  import com.facebook.react.bridge.Arguments;
15
16
  import com.facebook.react.bridge.Promise;
@@ -20,8 +21,10 @@ import com.facebook.react.bridge.ReactMethod;
20
21
  import com.facebook.react.bridge.ReadableMap;
21
22
  import com.facebook.react.bridge.WritableArray;
22
23
  import com.facebook.react.bridge.WritableMap;
24
+
23
25
  import org.jetbrains.annotations.Contract;
24
26
  import org.jetbrains.annotations.NotNull;
27
+
25
28
  import java.io.File;
26
29
  import java.io.IOException;
27
30
  import java.util.ArrayList;
@@ -29,6 +32,7 @@ import java.util.HashMap;
29
32
  import java.util.Map;
30
33
  import java.util.concurrent.ExecutorService;
31
34
  import java.util.concurrent.Executors;
35
+
32
36
  import io.scanbot.sap.SdkLicenseInfo;
33
37
  import io.scanbot.sdk.barcode.ScanbotBarcodeDetector;
34
38
  import io.scanbot.sdk.barcode.entity.BarcodeDocumentFormat;
@@ -47,6 +51,7 @@ import io.scanbot.sdk.ui.view.barcode.configuration.BarcodeScannerConfiguration;
47
51
  import io.scanbot.sdk.ui.view.base.configuration.CameraOrientationMode;
48
52
  import kotlin.Unit;
49
53
  import kotlin.jvm.functions.Function1;
54
+
50
55
  import android.app.Activity;
51
56
 
52
57
 
@@ -132,8 +137,7 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
132
137
  } else {
133
138
  ResponseUtils.errorMessageJson(descriptionFromLicenseStatus(licenseInfo.getStatus()), promise);
134
139
  }
135
- }
136
- catch (Exception ex) {
140
+ } catch (Exception ex) {
137
141
  promise.reject(ex);
138
142
  }
139
143
  }
@@ -153,8 +157,7 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
153
157
  result.putString("licenseStatus", licenseInfo.getStatus().name());
154
158
  result.putString("licenseStatusMessage", descriptionFromLicenseStatus(licenseInfo.getStatus()));
155
159
  promise.resolve(result);
156
- }
157
- catch (Exception ex) {
160
+ } catch (Exception ex) {
158
161
  promise.reject(ex);
159
162
  }
160
163
  }
@@ -237,35 +240,13 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
237
240
 
238
241
  safeMap(options, configuration, promise);
239
242
 
240
- CameraOrientationMode orientationMode = JSONUtils.extractCameraOrientationMode(options);
241
- if (orientationMode != null) {
242
- configuration.setOrientationLockMode(orientationMode);
243
- }
244
-
245
- final ArrayList<BarcodeFormat> formats = JSONUtils.extractBarcodeFormats(options);
246
- if (!formats.isEmpty()) {
247
- configuration.setBarcodeFormatsFilter(formats);
248
- }
249
-
250
- final ArrayList<BarcodeDocumentFormat> documentFormats = JSONUtils.extractBarcodeDocumentFormats(options);
251
- if (!documentFormats.isEmpty()) {
252
- configuration.setAcceptedDocumentFormats(documentFormats);
253
- }
254
-
255
- final BarcodeScannerAdditionalConfiguration additionalConfiguration =
256
- JSONUtils.extractBarcodeScannerAdditionalConfiguration(options);
257
- if (additionalConfiguration != null) {
258
- configuration.setAdditionalDetectionParameters(additionalConfiguration);
259
- }
260
-
261
- configuration.setEngineMode(JSONUtils.extractEngineMode(options));
243
+ this.setCustomBarcodeScannerConfiguration(options, configuration);
262
244
 
263
245
  final Intent intent = BarcodeScannerActivity.newIntent(this.getReactApplicationContext(), configuration);
264
246
  activityCallbackPromise = promise;
265
247
  context.addActivityEventListener(this);
266
248
  context.startActivityForResult(intent, REQUEST_SB_BARCODE_SCANNER, null);
267
- }
268
- catch (final Exception e) {
249
+ } catch (final Exception e) {
269
250
  promise.reject("Error starting barcode scanner.", e);
270
251
  }
271
252
  }
@@ -286,31 +267,7 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
286
267
 
287
268
  ObjectMapper.map(configuration, nativeConfig);
288
269
 
289
- // Additional Parameters
290
- final BarcodeScannerAdditionalConfiguration additionalConfiguration =
291
- JSONUtils.extractBarcodeScannerAdditionalConfiguration(configuration);
292
- if(additionalConfiguration != null) {
293
- nativeConfig.setAdditionalDetectionParameters(additionalConfiguration);
294
- }
295
-
296
- CameraOrientationMode orientationMode = JSONUtils.extractCameraOrientationMode(configuration);
297
- if (orientationMode != null) {
298
- nativeConfig.setOrientationLockMode(orientationMode);
299
- }
300
-
301
- // Barcode Format Filters
302
- ArrayList<BarcodeFormat> formats = JSONUtils.extractBarcodeFormats(configuration);
303
- if (!formats.isEmpty()) {
304
- nativeConfig.setBarcodeFormatsFilter(formats);
305
- }
306
-
307
- // Document Format Filters
308
- ArrayList<BarcodeDocumentFormat> documentFormats = JSONUtils.extractBarcodeDocumentFormats(configuration);
309
- if (!documentFormats.isEmpty()) {
310
- nativeConfig.setAcceptedDocumentFormats(documentFormats);
311
- }
312
-
313
- nativeConfig.setEngineMode(JSONUtils.extractEngineMode(configuration));
270
+ this.setCustomBarcodeScannerConfiguration(configuration, nativeConfig);
314
271
 
315
272
  Intent startIntent = BatchBarcodeScannerActivity.newIntent(context, nativeConfig, null);
316
273
 
@@ -322,6 +279,35 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
322
279
  }
323
280
  }
324
281
 
282
+ private void setCustomBarcodeScannerConfiguration(final ReadableMap options, BarcodeScannerConfiguration configuration) {
283
+ CameraOrientationMode orientationMode = JSONUtils.extractCameraOrientationMode(options);
284
+ if (orientationMode != null) {
285
+ configuration.setOrientationLockMode(orientationMode);
286
+ }
287
+
288
+ final ArrayList<BarcodeFormat> formats = JSONUtils.extractBarcodeFormats(options);
289
+ if (!formats.isEmpty()) {
290
+ configuration.setBarcodeFormatsFilter(formats);
291
+ }
292
+
293
+ final ArrayList<BarcodeDocumentFormat> documentFormats = JSONUtils.extractBarcodeDocumentFormats(options);
294
+ if (!documentFormats.isEmpty()) {
295
+ configuration.setAcceptedDocumentFormats(documentFormats);
296
+ }
297
+
298
+ final BarcodeScannerAdditionalConfiguration additionalConfiguration =
299
+ JSONUtils.extractBarcodeScannerAdditionalConfiguration(options);
300
+ if (additionalConfiguration != null) {
301
+ configuration.setAdditionalDetectionParameters(additionalConfiguration);
302
+ }
303
+
304
+ configuration.setEngineMode(JSONUtils.extractEngineMode(options));
305
+
306
+ if (options.hasKey("replaceCancelButtonWithIcon") && options.getBoolean("replaceCancelButtonWithIcon")) {
307
+ configuration.setCancelButtonIcon(R.drawable.ic_baseline_arrow_back_24);
308
+ }
309
+ }
310
+
325
311
  @ReactMethod
326
312
  public void closeBatchBarcodeScanner(final Promise promise) {
327
313
  final ReactContext context = getReactApplicationContext();
@@ -345,8 +331,7 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
345
331
  debugLog("Cleaning plugin storage folder ...");
346
332
  StorageUtils.cleanupPluginStorageDirectory(getReactApplicationContext());
347
333
  ResponseUtils.successMessageJson("Cleanup successfully done.", promise);
348
- }
349
- catch (final Exception e) {
334
+ } catch (final Exception e) {
350
335
  ResponseUtils.errorMessageJson(e.getLocalizedMessage(), promise);
351
336
  }
352
337
  }
@@ -0,0 +1,10 @@
1
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+ android:width="24dp"
3
+ android:height="24dp"
4
+ android:viewportWidth="24"
5
+ android:viewportHeight="24"
6
+ android:tint="?attr/colorControlNormal">
7
+ <path
8
+ android:fillColor="@android:color/white"
9
+ android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
10
+ </vector>
package/ios/.DS_Store ADDED
Binary file
@@ -149,6 +149,11 @@ RCT_EXPORT_METHOD(startBarcodeScanner:(NSDictionary*)configuration
149
149
 
150
150
  SBSDKUIBarcodeScannerConfiguration* config = [[SBSDKUIBarcodeScannerConfiguration alloc] initWithUIConfiguration:uiConfig textConfiguration:textConfig behaviorConfiguration:behaviorConfig];
151
151
 
152
+ SBSDKUICameraConfiguration* cameraConfiguration = extractCameraConfiguration(configuration);
153
+ if (cameraConfiguration) {
154
+ config.cameraConfiguration.camera = cameraConfiguration.camera;
155
+ }
156
+
152
157
  bool shouldWaitForGeneratedImage = behaviorConfig.barcodeImageGenerationType != SBSDKBarcodeImageGenerationTypeNone;
153
158
  BarcodeScannerPromiseProxy* delegate = [[BarcodeScannerPromiseProxy alloc] initWithResolver: resolve
154
159
  shouldWaitForGeneratedImage: shouldWaitForGeneratedImage];
@@ -211,6 +216,11 @@ RCT_EXPORT_METHOD(startBatchBarcodeScanner:(NSDictionary*)configuration
211
216
  NSArray* machineCodeTypes = extractBarcodeTypesFromConfiguration(configuration);
212
217
  NSArray* acceptedDocumentTypes = extractBarcodeDocumentTypesFromConfiguration(configuration);
213
218
 
219
+ SBSDKUICameraConfiguration* cameraConfiguration = extractCameraConfiguration(configuration);
220
+ if (cameraConfiguration) {
221
+ config.cameraConfiguration.camera = cameraConfiguration.camera;
222
+ }
223
+
214
224
  BatchBarcodeScannerPromiseProxy* delegate = [[BatchBarcodeScannerPromiseProxy alloc] initWithResolver:resolve];
215
225
 
216
226
  SBSDKUIBarcodesBatchScannerViewController* viewController = NULL;
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>ScanbotBarcodeSdk.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -32,11 +32,12 @@ static inline SBSDKBarcodeDocumentType* barcodeDocumentTypeFromString(NSString*
32
32
  if ([string isEqualToString:@"AAMVA"]) return SBSDKBarcodeDocumentTypeAAMVA;
33
33
  if ([string isEqualToString:@"ID_CARD_PDF_417"]) return SBSDKBarcodeDocumentTypeIDCardPDF417;
34
34
  if ([string isEqualToString:@"SEPA"]) return SBSDKBarcodeDocumentTypeSEPA;
35
- if ([string isEqualToString:@"DISABILITY_CERTIFICATE"]) return SBSDKBarcodeDocumentTypeDisabilityCertificate;
35
+ if ([string isEqualToString:@"MEDICAL_CERTIFICATE"]) return SBSDKBarcodeDocumentTypeMedicalCertificate;
36
36
  if ([string isEqualToString:@"BOARDING_PASS"]) return SBSDKBarcodeDocumentTypeBoardingPass;
37
37
  if ([string isEqualToString:@"DE_MEDICAL_PLAN"]) return SBSDKBarcodeDocumentTypeMedicalPlan;
38
38
  if ([string isEqualToString:@"VCARD"]) return SBSDKBarcodeDocumentTypeVCard;
39
39
  if ([string isEqualToString:@"SWISS_QR"]) return SBSDKBarcodeDocumentTypeSwissQR;
40
+ if ([string isEqualToString:@"GS1"]) return SBSDKBarcodeDocumentTyeGS1;
40
41
  return nil;
41
42
  }
42
43
 
@@ -138,4 +139,21 @@ static inline SBSDKBarcodeMSIPlesseyChecksumAlgorithm extractPlesseyChecksumAlgo
138
139
  return SBSDKBarcodeMSIPlesseyChecksumAlgorithmMod10;
139
140
  }
140
141
 
142
+ static inline SBSDKUICameraConfiguration* extractCameraConfiguration(NSDictionary* configuration) {
143
+ SBSDKUICameraConfiguration* cameraConfiguration = [[SBSDKUICameraConfiguration alloc] init];
144
+
145
+ NSString* cameraModule = [configuration objectForKey:@"cameraModule"];
146
+ if(!cameraModule) {
147
+ return nil;
148
+ }
149
+
150
+ if ([cameraModule isEqualToString:@"FRONT"]) {
151
+ cameraConfiguration.camera = SBSDKCameraDevice.defaultFrontFacingCamera;
152
+ } else if ([cameraModule isEqualToString:@"BACK"]) {
153
+ cameraConfiguration.camera = SBSDKCameraDevice.defaultBackFacingCamera;
154
+ }
155
+
156
+ return cameraConfiguration;
157
+ }
158
+
141
159
  #endif /* BarcodeMapping_h */
package/package.json CHANGED
@@ -1,7 +1,7 @@
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-beta9",
4
+ "version": "3.2.0-beta2",
5
5
  "description": "React Native plugin for the Scanbot Barcode Scanner SDK on Android and iOS",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -9,18 +9,19 @@ import {
9
9
  BarcodeFormat,
10
10
  BarcodeImageGenerationType,
11
11
  UIInterfaceOrientationMask,
12
- EngineMode
12
+ EngineMode,
13
+ CameraModule
13
14
  } from "./enum";
14
15
  import { MSIPlesseyChecksumAlgorithm } from "./enum";
15
16
 
16
17
  export interface BarcodeScannerConfiguration {
17
18
  /**
18
- * An optional array of barcode document formats that act as a detection filter.
19
+ * An optional array of barcode document formats that acts as a detection filter.
19
20
  * By default all supported document formats will be detected.
20
21
  */
21
22
  acceptedDocumentFormats?: BarcodeDocumentFormat[];
22
23
  /**
23
- * Allowed orientations for automatic interface rotations. *
24
+ * Allowed orientations for automatic interface rotations.
24
25
  */
25
26
  allowedInterfaceOrientations?: UIInterfaceOrientationMask;
26
27
  /**
@@ -40,11 +41,11 @@ export interface BarcodeScannerConfiguration {
40
41
  */
41
42
  finderLineColor?: string;
42
43
  /**
43
- * Width of finder frame border. Default is 2.
44
+ * Width of the finder frame border. Default is 2.
44
45
  */
45
46
  finderLineWidth?: number;
46
47
  /**
47
- * String being displayed as description.
48
+ * String being displayed as the description label.
48
49
  */
49
50
  finderTextHint?: string;
50
51
  /**
@@ -52,8 +53,8 @@ export interface BarcodeScannerConfiguration {
52
53
  */
53
54
  finderTextHintColor?: string;
54
55
  /**
55
- * Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
56
- * Default is 1 - it is a square frame, which is good for QR capturing.
56
+ * Aspect ratio of the finder frame (width \ height), which is used to build the actual finder frame.
57
+ * Default is 1 - which is a square frame (good for QR capturing).
57
58
  */
58
59
  finderAspectRatio?: FinderAspectRatio;
59
60
  /**
@@ -61,11 +62,11 @@ export interface BarcodeScannerConfiguration {
61
62
  */
62
63
  flashButtonTitle?: string;
63
64
  /**
64
- * Foreground color of the flash button when flash is off.
65
+ * Foreground color of the flash button when the flash is off.
65
66
  */
66
67
  flashButtonInactiveColor?: string;
67
68
  /**
68
- * Whether flash is toggled on or off.
69
+ * Whether the flash is toggled on or off.
69
70
  */
70
71
  flashEnabled?: boolean;
71
72
  /**
@@ -82,13 +83,13 @@ export interface BarcodeScannerConfiguration {
82
83
  maximumTextLength?: number,
83
84
  /**
84
85
  * Optional minimum required quiet zone on the barcode.
85
- * Measured in modules (the size of minimal bar on the barcode).
86
+ * Measured in modules (the size of narrowest bar in the barcode).
86
87
  * The default is 10.
87
88
  * NOTE: This feature works on ITF and MSI Plessey barcodes only.
88
89
  */
89
90
  minimum1DBarcodesQuietZone?: number
90
91
  /**
91
- * Whether scanner screen should make a sound on successful barcode or MRZ detection.
92
+ * Whether a sound should be played on successful barcode detection.
92
93
  */
93
94
  successBeepEnabled?: boolean;
94
95
  /**
@@ -100,12 +101,12 @@ export interface BarcodeScannerConfiguration {
100
101
  */
101
102
  topBarButtonsColor?: string;
102
103
  /**
103
- * Accepted barcode formats
104
+ * Accepted barcode formats.
104
105
  */
105
106
  barcodeFormats?: BarcodeFormat[];
106
107
  /**
107
- * Specifies the way of barcode images generation or disables this generation at all.
108
- * Use, if you want to receive a full sized image with barcodes. Defaults to NONE.
108
+ * Specifies the way a barcode image is generated or disables this generation altogether.
109
+ * Use if you want to receive a full sized image with barcodes. Defaults to NONE.
109
110
  */
110
111
  barcodeImageGenerationType?: BarcodeImageGenerationType;
111
112
  /**
@@ -120,48 +121,57 @@ export interface BarcodeScannerConfiguration {
120
121
  cameraZoomFactor?: number;
121
122
  /**
122
123
  * The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
123
- * To use legacy recognizer, please specify LEGACY
124
+ * To use the legacy recognizer, please specify LEGACY.
124
125
  */
125
126
  engineMode?: EngineMode;
126
127
  /**
127
128
  * When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
128
- * Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
129
+ * Turn it off if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
129
130
  * The default value is `true`.
130
131
  * NOTE: Currently works for CODE128 barcodes only!
131
132
  */
132
133
  gs1DecodingEnabled?: boolean;
133
134
  /**
134
- * The checksum algorithms for MSI Plessey barcodes.
135
+ * The checksum algorithm for MSI Plessey barcodes.
135
136
  * The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
136
137
  */
137
138
  msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
138
139
  /**
139
- * With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
140
+ * With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
140
141
  * Has no effect if both single and double digit MSI Plessey checksums are enabled.
141
- * The default is `false`
142
+ * The default is `false`.
142
143
  */
143
144
  stripCheckDigits?: boolean;
144
-
145
145
  /**
146
- * 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.
147
- * The default is `false`
146
+ * The preferred camera module (default: BACK).
147
+ */
148
+ cameraModule?: CameraModule;
149
+ /**
150
+ * If `true`, enables the mode which slightly decreases the scanning quality and the energy consumption, thus increasing the scanning speed.
151
+ * The default is `false`.
148
152
  * Android only.
149
153
  */
150
154
  lowPowerMode?: boolean;
155
+ /**
156
+ * If `true`, replaces the cancel button in the top bar with a back arrow icon
157
+ * The default is `false`.
158
+ * Android only.
159
+ */
160
+ replaceCancelButtonWithIcon?: boolean;
151
161
  }
152
162
 
153
163
  export interface BatchBarcodeScannerConfiguration {
154
164
  /**
155
- * An optional array of barcode document formats that act as a detection filter.
165
+ * An optional array of barcode document formats that acts as a detection filter.
156
166
  * By default all supported document formats will be detected.
157
167
  */
158
168
  acceptedDocumentFormats?: BarcodeDocumentFormat[];
159
169
  /**
160
- * Allowed orientations for automatic interface rotations. *
170
+ * Allowed orientations for automatic interface rotations.
161
171
  */
162
172
  allowedInterfaceOrientations?: UIInterfaceOrientationMask;
163
173
  /**
164
- * String used for displaying amount of scanned barcodes. Use %d for number formatting symbol.
174
+ * String used for displaying the numer of scanned barcodes. Use %d for number formatting symbol.
165
175
  */
166
176
  barcodesCountText?: string;
167
177
  /**
@@ -173,7 +183,7 @@ export interface BatchBarcodeScannerConfiguration {
173
183
  */
174
184
  cameraOverlayColor?: string;
175
185
  /**
176
- * Whether the cancel button is hidden or not. (iOS Only)
186
+ * Whether the cancel button is hidden or not. (iOS only).
177
187
  */
178
188
  cancelButtonHidden?: boolean;
179
189
  /**
@@ -206,12 +216,12 @@ export interface BatchBarcodeScannerConfiguration {
206
216
  */
207
217
  detailsPrimaryColor?: string;
208
218
  /**
209
- * String used to show process of fetching mapped data for barcodes.
219
+ * String used to show the process of fetching mapped data for barcodes.
210
220
  */
211
221
  fetchingStateText?: string;
212
222
  /**
213
- * Aspect ratio of finder frame (width \ height), which is used to build actual finder frame.
214
- * Default is 1 - it is a square frame, which is good for QR capturing.
223
+ * Aspect ratio of the finder frame (width \ height), which is used to build the actual finder frame.
224
+ * Default is 1 - which is a square frame (good for QR capturing).
215
225
  */
216
226
  finderAspectRatio?: FinderAspectRatio;
217
227
  /**
@@ -219,11 +229,11 @@ export interface BatchBarcodeScannerConfiguration {
219
229
  */
220
230
  finderLineColor?: string;
221
231
  /**
222
- * Width of finder frame border. Default is 2.
232
+ * Width of the finder frame border. Default is 2.
223
233
  */
224
234
  finderLineWidth?: number;
225
235
  /**
226
- * String being displayed as description.
236
+ * String being displayed as the description label.
227
237
  */
228
238
  finderTextHint?: string;
229
239
  /**
@@ -231,7 +241,7 @@ export interface BatchBarcodeScannerConfiguration {
231
241
  */
232
242
  finderTextHintColor?: string;
233
243
  /**
234
- * Whether flash is toggled on or off.
244
+ * Whether the flash is toggled on or off.
235
245
  */
236
246
  flashEnabled?: boolean;
237
247
  /**
@@ -243,7 +253,7 @@ export interface BatchBarcodeScannerConfiguration {
243
253
  */
244
254
  submitButtonTitle?: string;
245
255
  /**
246
- * Whether scanner screen should make a sound on successful barcode or MRZ detection.
256
+ * Whether a sound should be played on successful barcode detection.
247
257
  */
248
258
  successBeepEnabled?: boolean;
249
259
  /**
@@ -255,11 +265,11 @@ export interface BatchBarcodeScannerConfiguration {
255
265
  */
256
266
  topBarButtonsColor?: string;
257
267
  /**
258
- * Foreground color of the flash button when flash is off.
268
+ * Foreground color of the flash button when the flash is off.
259
269
  */
260
270
  topBarButtonsInactiveColor?: string;
261
271
  /**
262
- * Accepted barcode formats
272
+ * Accepted barcode formats.
263
273
  */
264
274
  barcodeFormats?: BarcodeFormat[];
265
275
  /**
@@ -281,54 +291,61 @@ export interface BatchBarcodeScannerConfiguration {
281
291
  maximumTextLength?: number;
282
292
  /**
283
293
  * Optional minimum required quiet zone on the barcode.
284
- * Measured in modules (the size of minimal bar on the barcode).
294
+ * Measured in modules (the size of narrowest bar in the barcode).
285
295
  * The default is 10.
286
296
  * NOTE: This feature works on ITF and MSI Plessey barcodes only.
287
297
  */
288
298
  minimum1DBarcodesQuietZone?: number;
289
-
290
299
  /**
291
300
  * The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
292
- * To use legacy recognizer, please specify LEGACY
301
+ * To use the legacy recognizer, please specify LEGACY.
293
302
  */
294
303
  engineMode?: EngineMode;
295
304
 
296
305
  /**
297
306
  * When set to `true`, the scanner assumes that the barcode can be a GS1 barcode.
298
- * Turn it off, if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
307
+ * Turn it off if you don't want to see decoded FNC1 characters ("]C1" and ASCII char 29).
299
308
  * The default value is `true`.
300
309
  * NOTE: Currently works for CODE128 barcodes only!
301
310
  */
302
311
  gs1DecodingEnabled?: boolean;
303
312
 
304
313
  /**
305
- * The checksum algorithms for MSI Plessey barcodes.
314
+ * The checksum algorithm for MSI Plessey barcodes.
306
315
  * The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
307
316
  */
308
317
  msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
309
-
310
318
  /**
311
- * With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
319
+ * With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
312
320
  * Has no effect if both single and double digit MSI Plessey checksums are enabled.
313
- * The default is `false`
321
+ * The default is `false`.
314
322
  */
315
323
  stripCheckDigits?: boolean;
316
-
317
324
  /**
318
- * 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.
319
- * The default is `false`
325
+ * The preferred camera module (default: BACK).
326
+ */
327
+ cameraModule?: CameraModule;
328
+ /**
329
+ * If `true`, enables the mode which slightly decreases the scanning quality and the energy consumption, thus increasing the scanning speed.
330
+ * The default is `false`.
320
331
  * Android only.
321
332
  */
322
333
  lowPowerMode?: boolean;
334
+ /**
335
+ * If `true`, replaces the cancel button in the top bar with a back arrow icon
336
+ * The default is `false`.
337
+ * Android only.
338
+ */
339
+ replaceCancelButtonWithIcon?: boolean;
323
340
  }
324
341
 
325
342
  interface InternalBarcodeDetectionCommonParameters {
326
343
  /**
327
- * Accepted barcode formats
344
+ * Accepted barcode formats.
328
345
  */
329
346
  barcodeFormats?: BarcodeFormat[];
330
347
  /**
331
- * An optional array of barcode document formats that act as a detection filter.
348
+ * An optional array of barcode document formats that acts as a detection filter.
332
349
  * By default all supported document formats will be detected.
333
350
  */
334
351
  acceptedDocumentFormats?: BarcodeDocumentFormat[];
@@ -346,15 +363,15 @@ interface InternalBarcodeDetectionCommonParameters {
346
363
  maximumTextLength?: number;
347
364
  /**
348
365
  * Optional minimum required quiet zone on the barcode.
349
- * Measured in modules (the size of minimal bar on the barcode).
366
+ * Measured in modules (the size of narrowest bar in the barcode).
350
367
  * The default is 10.
351
368
  * NOTE: This feature works on ITF and MSI Plessey barcodes only.
352
369
  */
353
370
  minimum1DBarcodesQuietZone?: number;
354
371
  /**
355
- * With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes.
372
+ * With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
356
373
  * Has no effect if both single and double digit MSI Plessey checksums are enabled.
357
- * The default is `false`
374
+ * The default is `false`.
358
375
  */
359
376
  stripCheckDigits?: boolean;
360
377
  }
@@ -362,7 +379,7 @@ interface InternalBarcodeDetectionCommonParameters {
362
379
  export interface DetectBarcodesOnImageArguments
363
380
  extends InternalBarcodeDetectionCommonParameters {
364
381
  /**
365
- * The input image file URI
382
+ * The input image file URI.
366
383
  */
367
384
  imageFileUri: string;
368
385
  }
package/src/enum.ts CHANGED
@@ -38,11 +38,12 @@ export type BarcodeDocumentFormat =
38
38
  "AAMVA" |
39
39
  "BOARDING_PASS" |
40
40
  "DE_MEDICAL_PLAN" |
41
- "DISABILITY_CERTIFICATE" |
41
+ "MEDICAL_CERTIFICATE" |
42
42
  "ID_CARD_PDF_417" |
43
43
  "SEPA" |
44
44
  "SWISS_QR" |
45
- "VCARD";
45
+ "VCARD" |
46
+ "GS1" ;
46
47
 
47
48
  export type BarcodeFormat =
48
49
  "AZTEC" |
@@ -74,3 +75,5 @@ export type MSIPlesseyChecksumAlgorithm =
74
75
  "Mod1110IBM" |
75
76
  "Mod1110NCR"
76
77
  ;
78
+
79
+ export type CameraModule = 'FRONT' | 'BACK';
File without changes
File without changes
File without changes
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Tue Jan 18 13:44:25 CET 2022
8
- sdk.dir=/Users/rutkaybiyik/Library/Android/sdk