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
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
//
|
|
4
|
-
// Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
|
|
5
|
-
// https://scanbot.io/sdk
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
static NSString *const pluginStorageSubDirectory = @"sbsdk-plugin-storage";
|
|
9
|
-
|
|
10
|
-
@interface ScanbotStorageUtils : NSObject
|
|
11
|
-
|
|
12
|
-
+ (int) defaultImageQuality;
|
|
13
|
-
|
|
14
|
-
+ (NSURL *)pluginStorageDirectoryURL;
|
|
15
|
-
+ (NSString *)pluginStorageDirectoryPath;
|
|
16
|
-
+ (BOOL)pluginStorageDirectoryExists;
|
|
17
|
-
+ (NSString *)generateFileName:(NSString *)extension;
|
|
18
|
-
+ (NSString *)generatePluginStorageFilePath:(NSString*)extension;
|
|
19
|
-
+ (NSError *)removeAllFilesFromPluginStorageDirectory;
|
|
20
|
-
|
|
21
|
-
+ (UIImage *)loadImage:(NSString *)imageFilePath;
|
|
22
|
-
+ (BOOL)saveImage:(NSString *)imageFilePath image:(UIImage *)image quality:(CGFloat)quality;
|
|
23
|
-
+ (BOOL)imageFileExists:(NSString *)imageFileUri;
|
|
24
|
-
|
|
25
|
-
@end
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
//
|
|
4
|
-
// Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
|
|
5
|
-
// https://scanbot.io/sdk
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "ScanbotStorageUtils.h"
|
|
9
|
-
#import "LoggingUtils.h"
|
|
10
|
-
|
|
11
|
-
@implementation ScanbotStorageUtils
|
|
12
|
-
|
|
13
|
-
+ (int)defaultImageQuality {
|
|
14
|
-
return 90;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
+ (NSURL *)pluginStorageDirectoryURL {
|
|
18
|
-
return [NSURL fileURLWithPath: [ScanbotStorageUtils pluginStorageDirectoryPath] isDirectory:YES];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
+ (NSString *)pluginStorageDirectoryPath {
|
|
22
|
-
NSString* pluginStorageDirectoryPath;
|
|
23
|
-
|
|
24
|
-
NSString* customStorageBaseDirectoryUrl = [SharedConfiguration defaultConfiguration].configuration.storageBaseDirectory;
|
|
25
|
-
if (customStorageBaseDirectoryUrl) {
|
|
26
|
-
NSString* customStorageBaseDirectoryPath = [NSURL URLWithString: customStorageBaseDirectoryUrl].path;
|
|
27
|
-
pluginStorageDirectoryPath = [NSString stringWithFormat:@"%@/%@", customStorageBaseDirectoryPath, pluginStorageSubDirectory];
|
|
28
|
-
} else {
|
|
29
|
-
NSString* defaultStorageBaseDirectory = [ScanbotStorageUtils scanbotSDKApplicationSupportFolder].path;
|
|
30
|
-
pluginStorageDirectoryPath = [NSString stringWithFormat:@"%@/%@", defaultStorageBaseDirectory, pluginStorageSubDirectory];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[ScanbotStorageUtils recreateFolderIfNeeded:pluginStorageDirectoryPath];
|
|
34
|
-
return pluginStorageDirectoryPath;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
+ (BOOL)pluginStorageDirectoryExists {
|
|
38
|
-
return [[NSFileManager defaultManager] fileExistsAtPath:[ScanbotStorageUtils pluginStorageDirectoryPath]];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
+ (NSURL *)applicationSupportFolderURL {
|
|
42
|
-
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
|
43
|
-
return [NSURL fileURLWithPath:(NSString *)paths.firstObject isDirectory:YES];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
+ (NSURL *)scanbotSDKApplicationSupportFolder {
|
|
47
|
-
NSURL *url = [ScanbotStorageUtils applicationSupportFolderURL];
|
|
48
|
-
return [url URLByAppendingPathComponent:@"io.scanbot.sdk" isDirectory:YES];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
+ (void)recreateFolderIfNeeded:(NSString *)folderPath {
|
|
52
|
-
if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath]) {
|
|
53
|
-
[[NSFileManager defaultManager] createDirectoryAtPath:folderPath
|
|
54
|
-
withIntermediateDirectories:YES
|
|
55
|
-
attributes:nil
|
|
56
|
-
error:nil];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
+ (NSString *)generateFileName:(NSString *)extension {
|
|
61
|
-
NSUUID *UUID = [NSUUID UUID];
|
|
62
|
-
NSString *stringUUID = [[UUID UUIDString] lowercaseString];
|
|
63
|
-
return [NSString stringWithFormat:@"%@.%@", stringUUID, extension];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
+ (NSString *)generatePluginStorageFilePath:(NSString *)extension {
|
|
67
|
-
NSString *pluginStoragePath = [ScanbotStorageUtils pluginStorageDirectoryPath];
|
|
68
|
-
return [NSString stringWithFormat:@"%@/%@", pluginStoragePath, [ScanbotStorageUtils generateFileName:extension]];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
+ (UIImage *)loadImage:(NSString *)imageFilePath {
|
|
72
|
-
NSData *data = [NSData dataWithContentsOfFile:imageFilePath];
|
|
73
|
-
if (!data) {
|
|
74
|
-
data = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageFilePath]];
|
|
75
|
-
}
|
|
76
|
-
if (data) {
|
|
77
|
-
return [UIImage imageWithData:data];
|
|
78
|
-
} else {
|
|
79
|
-
SBSDKLogger(@"Loading image from path %@ failed.", imageFilePath);
|
|
80
|
-
return nil;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
+ (BOOL)saveImage:(NSString *)imageFilePath image:(UIImage *)image quality:(CGFloat)quality {
|
|
85
|
-
NSData *imageData = UIImageJPEGRepresentation(image, quality);
|
|
86
|
-
return [imageData writeToFile:imageFilePath atomically:YES];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
+ (NSError *)removeAllFilesFromPluginStorageDirectory {
|
|
90
|
-
NSString *pluginStoragePath = [ScanbotStorageUtils pluginStorageDirectoryPath];
|
|
91
|
-
NSFileManager *fileManager = [NSFileManager new];
|
|
92
|
-
NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtPath:pluginStoragePath];
|
|
93
|
-
NSError *err = nil;
|
|
94
|
-
BOOL result;
|
|
95
|
-
|
|
96
|
-
NSString *fileName;
|
|
97
|
-
while (fileName = [enumerator nextObject]) {
|
|
98
|
-
result = [fileManager removeItemAtPath:[pluginStoragePath stringByAppendingPathComponent:fileName] error:&err];
|
|
99
|
-
if (!result && err) {
|
|
100
|
-
SBSDKLogger(@"Cleanup encountered an error: %@", err);
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return err;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
+ (BOOL)imageFileExists:(NSString *)imageFileUri {
|
|
108
|
-
return [[NSFileManager defaultManager] fileExistsAtPath:[NSURL URLWithString:imageFileUri].path];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@end
|
package/src/configuration.ts
DELETED
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
|
|
4
|
-
https://scanbot.io/sdk
|
|
5
|
-
*/
|
|
6
|
-
import { FinderAspectRatio, SelectionOverlayConfiguration } from "./model";
|
|
7
|
-
import {
|
|
8
|
-
BarcodeDocumentFormat,
|
|
9
|
-
BarcodeFormat,
|
|
10
|
-
BarcodeImageGenerationType,
|
|
11
|
-
UIInterfaceOrientationMask,
|
|
12
|
-
EngineMode,
|
|
13
|
-
CameraModule,
|
|
14
|
-
BarcodeFilter,
|
|
15
|
-
CodeDensity,
|
|
16
|
-
CameraPreviewMode,
|
|
17
|
-
} from "./enum";
|
|
18
|
-
import { MSIPlesseyChecksumAlgorithm } from "./enum";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* An interface that contains all the Barcode Scanning configurations.
|
|
22
|
-
*/
|
|
23
|
-
export interface BarcodeScannerConfiguration extends InternalBarcodeDetectionCommonParameters, BarcodeAdditionalParameters {
|
|
24
|
-
/**
|
|
25
|
-
* iOS only: String being displayed on the flash button
|
|
26
|
-
*/
|
|
27
|
-
flashButtonTitle?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Foreground color of the flash button when the flash is off.
|
|
30
|
-
*/
|
|
31
|
-
flashButtonInactiveColor?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Specifies the way a barcode image is generated or disables this generation altogether.
|
|
34
|
-
* Use if you want to receive a full sized image with barcodes. Defaults to NONE.
|
|
35
|
-
*
|
|
36
|
-
* Note: This property has no effect if overlayConfiguration.overlayEnabled is set to `true`
|
|
37
|
-
* With the tracking overlay enabled, barcode images cannot be generated.
|
|
38
|
-
*/
|
|
39
|
-
barcodeImageGenerationType?: BarcodeImageGenerationType;
|
|
40
|
-
/**
|
|
41
|
-
* Freezes a preview after a scan for a given amount of seconds. Defaults to 0 secs. Android only.
|
|
42
|
-
*/
|
|
43
|
-
delayAfterScan?: number;
|
|
44
|
-
/*
|
|
45
|
-
* Sets auto close timer in seconds. 0 = disabled and it is the default value.
|
|
46
|
-
*/
|
|
47
|
-
autoCancelTimeout?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* An interface that contains all the Batch Barcode Scanning configurations.
|
|
52
|
-
*/
|
|
53
|
-
export interface BatchBarcodeScannerConfiguration extends InternalBarcodeDetectionCommonParameters, BarcodeAdditionalParameters {
|
|
54
|
-
/**
|
|
55
|
-
* String used for displaying the numer of scanned barcodes. Use %d for number formatting symbol.
|
|
56
|
-
*/
|
|
57
|
-
barcodesCountText?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Text color of the barcodes count label.
|
|
60
|
-
*/
|
|
61
|
-
barcodesCountTextColor?: string;
|
|
62
|
-
/**
|
|
63
|
-
* String being displayed on the clear button.
|
|
64
|
-
*/
|
|
65
|
-
clearButtonTitle?: string;
|
|
66
|
-
/**
|
|
67
|
-
* String being displayed on the delete button.
|
|
68
|
-
*/
|
|
69
|
-
deleteButtonTitle?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Foreground color of the top bar buttons on the details screen.
|
|
72
|
-
*/
|
|
73
|
-
detailsActionColor?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Background color of the details screen.
|
|
76
|
-
*/
|
|
77
|
-
detailsBackgroundColor?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Text color in the details barcodes list. Also affects image background, separator and progress spinner.
|
|
80
|
-
*/
|
|
81
|
-
detailsPrimaryColor?: string;
|
|
82
|
-
/**
|
|
83
|
-
* String used to show the process of fetching mapped data for barcodes.
|
|
84
|
-
*/
|
|
85
|
-
fetchingStateText?: string;
|
|
86
|
-
/**
|
|
87
|
-
* String to show that no barcodes were scanned yet.
|
|
88
|
-
*/
|
|
89
|
-
noBarcodesTitle?: string;
|
|
90
|
-
/**
|
|
91
|
-
* String being displayed on the submit button.
|
|
92
|
-
*/
|
|
93
|
-
submitButtonTitle?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Foreground color of the flash button when the flash is off.
|
|
96
|
-
*/
|
|
97
|
-
topBarButtonsInactiveColor?: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* An interface that contains parameters for Detection of barcodes from images.
|
|
103
|
-
*/
|
|
104
|
-
export interface DetectBarcodesOnImageArguments
|
|
105
|
-
extends InternalBarcodeDetectionCommonParameters {
|
|
106
|
-
/**
|
|
107
|
-
* The input image file URI.
|
|
108
|
-
*/
|
|
109
|
-
imageFileUri: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* An interface that contains Common parameters for barcodes detection and filtering.
|
|
114
|
-
*/
|
|
115
|
-
interface InternalBarcodeDetectionCommonParameters {
|
|
116
|
-
/**
|
|
117
|
-
* An optional array of barcode document formats that acts as a detection filter.
|
|
118
|
-
* By default all supported document formats will be detected.
|
|
119
|
-
*/
|
|
120
|
-
acceptedDocumentFormats?: BarcodeDocumentFormat[];
|
|
121
|
-
/**
|
|
122
|
-
* Allowed orientations for automatic interface rotations.
|
|
123
|
-
*/
|
|
124
|
-
allowedInterfaceOrientations?: UIInterfaceOrientationMask;
|
|
125
|
-
/**
|
|
126
|
-
* Background color of the detection overlay.
|
|
127
|
-
*/
|
|
128
|
-
cameraOverlayColor?: string;
|
|
129
|
-
/**
|
|
130
|
-
* Whether the cancel button is hidden or not.
|
|
131
|
-
*/
|
|
132
|
-
cancelButtonHidden?: boolean;
|
|
133
|
-
/**
|
|
134
|
-
* String being displayed on the cancel button.
|
|
135
|
-
*/
|
|
136
|
-
cancelButtonTitle?: string;
|
|
137
|
-
/**
|
|
138
|
-
* Foreground color of the detection overlay.
|
|
139
|
-
*/
|
|
140
|
-
finderLineColor?: string;
|
|
141
|
-
/**
|
|
142
|
-
* Width of the finder frame border. Default is 2.
|
|
143
|
-
*/
|
|
144
|
-
finderLineWidth?: number;
|
|
145
|
-
/**
|
|
146
|
-
* String being displayed as the description label.
|
|
147
|
-
*/
|
|
148
|
-
finderTextHint?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Foreground color of the description label.
|
|
151
|
-
*/
|
|
152
|
-
finderTextHintColor?: string;
|
|
153
|
-
/**
|
|
154
|
-
* Aspect ratio of the finder frame (width \ height), which is used to build the actual finder frame.
|
|
155
|
-
* Default is 1 - which is a square frame (good for QR capturing).
|
|
156
|
-
*/
|
|
157
|
-
finderAspectRatio?: FinderAspectRatio;
|
|
158
|
-
/**
|
|
159
|
-
* Whether the flash is toggled on or off.
|
|
160
|
-
*/
|
|
161
|
-
flashEnabled?: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* 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.
|
|
164
|
-
*/
|
|
165
|
-
focusLockEnabled?: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* iOS Only: Whether the flash button should be visible or not in the UI.
|
|
168
|
-
*/
|
|
169
|
-
flashButtonHidden?: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Accepted barcode formats.
|
|
172
|
-
*/
|
|
173
|
-
barcodeFormats?: BarcodeFormat[];
|
|
174
|
-
/**
|
|
175
|
-
* Use a filter to determine which type of barcode can be detected; see `BarcodeFilter`
|
|
176
|
-
*/
|
|
177
|
-
barcodeFilter?: BarcodeFilter;
|
|
178
|
-
/**
|
|
179
|
-
* Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE.
|
|
180
|
-
* Android only.
|
|
181
|
-
*/
|
|
182
|
-
useButtonsAllCaps?: boolean;
|
|
183
|
-
/**
|
|
184
|
-
* The preferred camera module (default: BACK).
|
|
185
|
-
*/
|
|
186
|
-
cameraModule?: CameraModule;
|
|
187
|
-
/**
|
|
188
|
-
* Background color of the top bar.
|
|
189
|
-
*/
|
|
190
|
-
topBarBackgroundColor?: string;
|
|
191
|
-
/**
|
|
192
|
-
* Foreground color of the top bar buttons on the scanning screen.
|
|
193
|
-
*/
|
|
194
|
-
topBarButtonsColor?: string;
|
|
195
|
-
/**
|
|
196
|
-
* The relative initial zoom level of the camera in the range [0,1], where 0 is zoomed out and 1 is zoomed in.
|
|
197
|
-
* The default value is 0.
|
|
198
|
-
*/
|
|
199
|
-
cameraZoomFactor?: number;
|
|
200
|
-
/**
|
|
201
|
-
* The engine mode of the barcode recognizer. Defaults to NEXT_GEN.
|
|
202
|
-
* To use the legacy recognizer, please specify LEGACY.
|
|
203
|
-
*/
|
|
204
|
-
engineMode?: EngineMode;
|
|
205
|
-
/**
|
|
206
|
-
* Whether a sound should be played on successful barcode detection.
|
|
207
|
-
*/
|
|
208
|
-
successBeepEnabled?: boolean;
|
|
209
|
-
/**
|
|
210
|
-
* If `true`, replaces the cancel button in the top bar with a back arrow icon
|
|
211
|
-
* The default is `false`.
|
|
212
|
-
* Android only.
|
|
213
|
-
*/
|
|
214
|
-
replaceCancelButtonWithIcon?: boolean;
|
|
215
|
-
/**
|
|
216
|
-
* The configuration for barcode overlays.
|
|
217
|
-
*/
|
|
218
|
-
overlayConfiguration?: SelectionOverlayConfiguration;
|
|
219
|
-
/**
|
|
220
|
-
* Set `true` to enable showing the area of interest on camera preview. Enabled by default.
|
|
221
|
-
*/
|
|
222
|
-
viewFinderEnabled?: boolean
|
|
223
|
-
/**
|
|
224
|
-
* Title of the button that opens the screen where the user can allow the usage of the camera by the app.
|
|
225
|
-
* */
|
|
226
|
-
enableCameraButtonTitle?: string;
|
|
227
|
-
/**
|
|
228
|
-
* 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.
|
|
229
|
-
* */
|
|
230
|
-
enableCameraExplanationText?: string;
|
|
231
|
-
/**
|
|
232
|
-
* The position of the lens. Values can be between 0.0f (minimum focusing distance) and 1.0f (maximum focusing distance).
|
|
233
|
-
* The value will be clamped to (0.0f, 1.0f). The default value is 0.0. iOS only. For Android, minFocusDistanceLock can be used.
|
|
234
|
-
* */
|
|
235
|
-
focusLockPosition?: number;
|
|
236
|
-
/*
|
|
237
|
-
* Lock focus distance withing minimum possible range. Android only.
|
|
238
|
-
*/
|
|
239
|
-
minFocusDistanceLock?: boolean;
|
|
240
|
-
/*
|
|
241
|
-
* Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only
|
|
242
|
-
*/
|
|
243
|
-
cameraPreviewMode?: CameraPreviewMode;
|
|
244
|
-
/*
|
|
245
|
-
* The range of valid camera zoom factors.
|
|
246
|
-
* For iOS it ranges between 1.0 to 12.0. Default value is (1.0; 12.0).
|
|
247
|
-
* For Android it ranges between 0.0 to 1.0.
|
|
248
|
-
*/
|
|
249
|
-
cameraZoomRange?: ZoomRange;
|
|
250
|
-
/*
|
|
251
|
-
* Scanning delay after scanner appearance in seconds. Defaults to 0 secs.
|
|
252
|
-
*/
|
|
253
|
-
initialScanDelay?: number;
|
|
254
|
-
/*
|
|
255
|
-
* When this property is set to true, the zoom can be activated by double tapping somewhere in the receivers view. iOS only.
|
|
256
|
-
*/
|
|
257
|
-
doubleTapToZoomEnabled?: boolean;
|
|
258
|
-
/*
|
|
259
|
-
* When this property is set to true, the zoom can be activated by a pinch gesture somewhere in the receivers view. iOS only.
|
|
260
|
-
*/
|
|
261
|
-
pinchToZoomEnabled?: boolean;
|
|
262
|
-
/*
|
|
263
|
-
* Defines, if zooming in or out should be animated. iOS only.
|
|
264
|
-
*/
|
|
265
|
-
shouldAnimateZooming?: boolean;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* An interface that contains additional parameters for barcodes detection and filtering.
|
|
270
|
-
*/
|
|
271
|
-
export interface BarcodeAdditionalParameters {
|
|
272
|
-
/**
|
|
273
|
-
* If `true`, enables the mode which slightly decreases the scanning quality and the energy consumption, thus increasing the scanning speed.
|
|
274
|
-
* The default is `false`.
|
|
275
|
-
* Android only.
|
|
276
|
-
*/
|
|
277
|
-
lowPowerMode?: boolean;
|
|
278
|
-
/**
|
|
279
|
-
* Optional minimum required text length of the detected barcode.
|
|
280
|
-
* The default is 0 (setting is turned off).
|
|
281
|
-
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
282
|
-
*/
|
|
283
|
-
minimumTextLength?: number;
|
|
284
|
-
/**
|
|
285
|
-
* Optional maximum required text length of the detected barcode.
|
|
286
|
-
* The default is 0 (setting is turned off).
|
|
287
|
-
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
288
|
-
*/
|
|
289
|
-
maximumTextLength?: number;
|
|
290
|
-
/**
|
|
291
|
-
* Optional minimum required quiet zone on the barcode.
|
|
292
|
-
* Measured in modules (the size of narrowest bar in the barcode).
|
|
293
|
-
* The default is 10.
|
|
294
|
-
* NOTE: This feature works on ITF and MSI Plessey barcodes only.
|
|
295
|
-
*/
|
|
296
|
-
minimum1DBarcodesQuietZone?: number;
|
|
297
|
-
/**
|
|
298
|
-
* With this option enabled, the scanner removes check digits for UPC, EAN and MSI Plessey codes.
|
|
299
|
-
* Has no effect if both single and double digit MSI Plessey checksums are enabled.
|
|
300
|
-
* The default is `false`.
|
|
301
|
-
*/
|
|
302
|
-
stripCheckDigits?: boolean;
|
|
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
|
-
* The checksum algorithm for MSI Plessey barcodes.
|
|
312
|
-
* The default value is [MSIPlesseyChecksumAlgorithm.Mod10].
|
|
313
|
-
*/
|
|
314
|
-
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
315
|
-
/**
|
|
316
|
-
* Low density. Finds up to 6 QR codes in one image or video frame. This is the default value.
|
|
317
|
-
* High density. Finds up to 24 QR codes in one image or video frame.
|
|
318
|
-
*/
|
|
319
|
-
codeDensity?: CodeDensity;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/** Defines a range for zooming */
|
|
323
|
-
export interface ZoomRange {
|
|
324
|
-
/** The minimum zoom scale. Defaults to 1.0. */
|
|
325
|
-
minZoom: number;
|
|
326
|
-
/** The maximum zoom scale. Defaults to 3.0. */
|
|
327
|
-
maxZoom: number;
|
|
328
|
-
}
|
package/src/enum.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Scanbot Barcode Scanner SDK React Native Plugin
|
|
3
|
-
Copyright (c) 2023 Scanbot SDK GmbH. All rights reserved.
|
|
4
|
-
https://scanbot.io/sdk
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export type Status = "OK" | "CANCELED";
|
|
8
|
-
|
|
9
|
-
/** The SDK license status */
|
|
10
|
-
export type LicenseStatus =
|
|
11
|
-
/** License is valid and accepted. */
|
|
12
|
-
| 'Okay'
|
|
13
|
-
/** No license set yet. The SDK is in trial mode. */
|
|
14
|
-
| 'Trial'
|
|
15
|
-
/** No license set yet. The SDKs trial mode is over. */
|
|
16
|
-
| 'Expired'
|
|
17
|
-
/** No license active. The set license does not cover the current operating system. */
|
|
18
|
-
| 'WrongOS'
|
|
19
|
-
/** No license active. The set license was unreadable or has an invalid format. */
|
|
20
|
-
| 'Corrupted'
|
|
21
|
-
/** No license active. The set licenses does not cover the current apps bundle identifier. */
|
|
22
|
-
| 'AppIDMismatch'
|
|
23
|
-
/** No license set yet. The SDKs trial mode is over. */
|
|
24
|
-
| 'NotSet'
|
|
25
|
-
/** License status is unknown. */
|
|
26
|
-
| 'Unknown';
|
|
27
|
-
|
|
28
|
-
export type CameraImageFormat = "JPG" | "PNG";
|
|
29
|
-
export type DocumentDetectorMode = "EDGE_BASED" | "ML_BASED";
|
|
30
|
-
export type FileEncryptionMode = "AES128" | "AES256";
|
|
31
|
-
|
|
32
|
-
export type UIInterfaceOrientationMask =
|
|
33
|
-
"ALL" |
|
|
34
|
-
"PORTRAIT" |
|
|
35
|
-
"LANDSCAPE";
|
|
36
|
-
|
|
37
|
-
export type BarcodeImageGenerationType =
|
|
38
|
-
"NONE" |
|
|
39
|
-
"VIDEO_FRAME" |
|
|
40
|
-
"CAPTURED_IMAGE";
|
|
41
|
-
|
|
42
|
-
export type BarcodeDocumentFormat =
|
|
43
|
-
"AAMVA" |
|
|
44
|
-
"BOARDING_PASS" |
|
|
45
|
-
"DE_MEDICAL_PLAN" |
|
|
46
|
-
"MEDICAL_CERTIFICATE" |
|
|
47
|
-
"ID_CARD_PDF_417" |
|
|
48
|
-
"SEPA" |
|
|
49
|
-
"SWISS_QR" |
|
|
50
|
-
"VCARD" |
|
|
51
|
-
"GS1" ;
|
|
52
|
-
|
|
53
|
-
export type BarcodeFormat =
|
|
54
|
-
"AZTEC" |
|
|
55
|
-
"CODABAR" |
|
|
56
|
-
"CODE_39" |
|
|
57
|
-
"CODE_93" |
|
|
58
|
-
"CODE_128" |
|
|
59
|
-
"DATA_MATRIX" |
|
|
60
|
-
"EAN_8" |
|
|
61
|
-
"EAN_13" |
|
|
62
|
-
"ITF" |
|
|
63
|
-
"PDF_417" |
|
|
64
|
-
"QR_CODE" |
|
|
65
|
-
"RSS_14" |
|
|
66
|
-
"RSS_EXPANDED" |
|
|
67
|
-
"UPC_A" |
|
|
68
|
-
"UPC_E" |
|
|
69
|
-
"UNKNOWN" |
|
|
70
|
-
"IATA_2_OF_5" |
|
|
71
|
-
"INDUSTRIAL_2_OF_5" |
|
|
72
|
-
"MSI_PLESSEY" |
|
|
73
|
-
"CODE_25" |
|
|
74
|
-
"MICRO_QR_CODE";
|
|
75
|
-
|
|
76
|
-
export type EngineMode = "LEGACY" | "NEXT_GEN";
|
|
77
|
-
|
|
78
|
-
export type MSIPlesseyChecksumAlgorithm =
|
|
79
|
-
"None" |
|
|
80
|
-
"Mod10" |
|
|
81
|
-
"Mod11IBM" |
|
|
82
|
-
"Mod11NCR" |
|
|
83
|
-
"Mod1010" |
|
|
84
|
-
"Mod1110IBM" |
|
|
85
|
-
"Mod1110NCR";
|
|
86
|
-
|
|
87
|
-
export type CameraModule = 'FRONT' | 'BACK';
|
|
88
|
-
|
|
89
|
-
export type BarcodeFilter =
|
|
90
|
-
'WithExtension' |
|
|
91
|
-
'WithEAN2Extension' |
|
|
92
|
-
'WithEAN5Extension';
|
|
93
|
-
|
|
94
|
-
export type CodeDensity = 'LOW' | 'HIGH';
|
|
95
|
-
|
|
96
|
-
export type BarcodeOverlayFormat = 'NONE' |
|
|
97
|
-
'CODE' |
|
|
98
|
-
'CODE_AND_TYPE';
|
|
99
|
-
|
|
100
|
-
/** Represents camera preview modes */
|
|
101
|
-
export type CameraPreviewMode =
|
|
102
|
-
/** In this mode camera preview frames will be downscaled to the layout view size - full preview frame content will be visible, but unused edges could be appeared in the preview layout. */
|
|
103
|
-
'FIT_IN' |
|
|
104
|
-
/** In this mode camera preview frames fill the layout view - the preview frames may contain additional content on the edges that was not visible in the preview layout. */
|
|
105
|
-
'FILL_IN';
|
|
106
|
-
|
package/src/model.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { BarcodeOverlayFormat, CameraImageFormat, LicenseStatus } from "./enum";
|
|
2
|
-
|
|
3
|
-
export interface InitializationOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The Scanbot SDK License Key
|
|
6
|
-
*/
|
|
7
|
-
licenseKey: string;
|
|
8
|
-
/**
|
|
9
|
-
* If 'true' it enables logging.
|
|
10
|
-
* Consider switching logging OFF in production builds for security and performance reasons!
|
|
11
|
-
*/
|
|
12
|
-
loggingEnabled?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Enables Scanbot SDK Core native logging (default is false; Android only)
|
|
15
|
-
*/
|
|
16
|
-
enableNativeLogging?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The quality of stored images, from (1 to 100). Defaults to 80.
|
|
19
|
-
*/
|
|
20
|
-
storageImageQuality?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The preferred format for stored images.
|
|
23
|
-
*/
|
|
24
|
-
storageImageFormat?: CameraImageFormat;
|
|
25
|
-
/**
|
|
26
|
-
* Optional custom storage path.
|
|
27
|
-
*/
|
|
28
|
-
storageBaseDirectory?: string;
|
|
29
|
-
/**
|
|
30
|
-
* If set to `false`, GPU Acceleration will be disabled for Barcode Scanner,
|
|
31
|
-
* Document Scanner and Generic Document Recognizer (Android Only).
|
|
32
|
-
* Default is `true`.
|
|
33
|
-
*/
|
|
34
|
-
allowGpuAcceleration?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* If set to `true`, Camera X will be used for the RTU-UI components (Android Only)
|
|
37
|
-
* Default is `false`.
|
|
38
|
-
*/
|
|
39
|
-
useCameraX?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides
|
|
42
|
-
* highly optimized implementations of floating-point neural network operators (Android only)
|
|
43
|
-
* Default is `true`.
|
|
44
|
-
*/
|
|
45
|
-
allowXnnpackAcceleration?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface LicenseInfo {
|
|
49
|
-
isLicenseValid: boolean;
|
|
50
|
-
licenseStatus: LicenseStatus;
|
|
51
|
-
licenseExpirationDate?: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface FinderAspectRatio {
|
|
55
|
-
width: number;
|
|
56
|
-
height: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The Selection Overlay configuration interface for setting overlay over the barcode while ongoing detection.
|
|
61
|
-
*/
|
|
62
|
-
export interface SelectionOverlayConfiguration {
|
|
63
|
-
/**
|
|
64
|
-
* Displays an augmented reality view that draws the frames, content and type text
|
|
65
|
-
* of the found barcodes when it finds them. Defaults to NO.
|
|
66
|
-
*/
|
|
67
|
-
overlayEnabled: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* The text format for the results overlays.
|
|
70
|
-
* The default text format on iOS is 'CODE' and on Android is 'CODE_AND_TYPE'
|
|
71
|
-
*/
|
|
72
|
-
overlayTextFormat?: BarcodeOverlayFormat;
|
|
73
|
-
/**
|
|
74
|
-
* The color for the results overlays polygons.
|
|
75
|
-
*/
|
|
76
|
-
polygonColor: string;
|
|
77
|
-
/**
|
|
78
|
-
* The text color for the results overlays.
|
|
79
|
-
*/
|
|
80
|
-
textColor: string;
|
|
81
|
-
/**
|
|
82
|
-
* The text background color for the results overlays.
|
|
83
|
-
*/
|
|
84
|
-
textContainerColor: string;
|
|
85
|
-
/**
|
|
86
|
-
* The highlighted color for the results overlays polygons.
|
|
87
|
-
*/
|
|
88
|
-
highlightedPolygonColor?: string;
|
|
89
|
-
/**
|
|
90
|
-
* The highlighted color for the results overlays polygons.
|
|
91
|
-
*/
|
|
92
|
-
highlightedTextColor?: string;
|
|
93
|
-
/**
|
|
94
|
-
* The highlighted color for the results overlays polygons.
|
|
95
|
-
*/
|
|
96
|
-
highlightedTextContainerColor?: string;
|
|
97
|
-
/**
|
|
98
|
-
* If enabled, newly detected barcodes will be automatically selected.
|
|
99
|
-
* Otherwise the user has to tap on a barcode on the selection overlay to select it.
|
|
100
|
-
* Has no effect with disabled overlay.
|
|
101
|
-
* Defaults to false.
|
|
102
|
-
*/
|
|
103
|
-
automaticSelectionEnabled?: boolean;
|
|
104
|
-
}
|