dynamsoft-capture-vision-react-native 1.0.0 → 1.1.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.
Files changed (31) hide show
  1. package/README.md +91 -60
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/dynamsoft/reactlibrary/Constants.java +23 -0
  4. package/android/src/main/java/com/dynamsoft/reactlibrary/RNDCECameraView.java +5 -26
  5. package/android/src/main/java/com/dynamsoft/reactlibrary/RNDCECameraViewManager.java +94 -42
  6. package/android/src/main/java/com/dynamsoft/reactlibrary/RNDynamsoftBarcodeReaderModule.java +32 -3
  7. package/android/src/main/java/com/dynamsoft/reactlibrary/RNDynamsoftCaptrueVisionPackage.java +13 -2
  8. package/dynamsoft-capture-vision-react-native.podspec +2 -2
  9. package/ios/RNDynamsoftCaptureVision/DYSCameraView.h +30 -26
  10. package/ios/RNDynamsoftCaptureVision/DYSCameraView.m +113 -71
  11. package/ios/RNDynamsoftCaptureVision/DYSCameraViewManager.h +17 -17
  12. package/ios/RNDynamsoftCaptureVision/DYSCameraViewManager.m +79 -77
  13. package/ios/RNDynamsoftCaptureVision/RCTDynamsoftBarcodeReader.h +14 -14
  14. package/ios/RNDynamsoftCaptureVision/RCTDynamsoftBarcodeReader.m +233 -223
  15. package/ios/RNDynamsoftCaptureVision/StaticClass.h +26 -26
  16. package/ios/RNDynamsoftCaptureVision/StaticClass.m +21 -21
  17. package/js/BarcodeResult.d.ts +25 -0
  18. package/js/BarcodeResult.js +3 -0
  19. package/js/BarcodeSettings.d.ts +52 -100
  20. package/js/BarcodeSettings.js +55 -56
  21. package/js/BasicStructures.d.ts +20 -0
  22. package/js/BasicStructures.js +3 -0
  23. package/js/CameraSettings.d.ts +11 -0
  24. package/js/CameraSettings.js +9 -0
  25. package/js/DynamsoftBarcodeReader.d.ts +4 -3
  26. package/js/DynamsoftBarcodeReader.js +60 -59
  27. package/js/DynamsoftCameraView.d.ts +31 -7
  28. package/js/DynamsoftCameraView.js +90 -83
  29. package/js/index.d.ts +3 -0
  30. package/js/index.js +23 -3
  31. package/package.json +8 -1
@@ -1,223 +1,233 @@
1
- //
2
- // RCTDynamsoftBarcodeReader.m
3
- // RCTDynamsoftBarcodeReader
4
- //
5
- // Created by dynamsoft on 2022/3/16.
6
- //
7
-
8
- #import "RCTDynamsoftBarcodeReader.h"
9
- #import <React/RCTLog.h>
10
- #import "StaticClass.h"
11
-
12
- @interface RCTDynamsoftBarcodeReader() <DBRLicenseVerificationListener, DBRTextResultListener>
13
-
14
- @end
15
-
16
- @implementation RCTDynamsoftBarcodeReader
17
- {
18
- bool hasListeners;
19
- RCTPromiseResolveBlock licenseResolve;
20
- RCTPromiseRejectBlock licenseReject;
21
- }
22
-
23
- - (instancetype)init {
24
- self = [super init];
25
- if (self) {
26
-
27
- }
28
- return self;
29
- }
30
-
31
- + (BOOL)requiresMainQueueSetup{
32
- return YES;
33
- }
34
-
35
- - (NSArray<NSString *> *)supportedEvents
36
- {
37
- return @[@"resultEvent"];
38
- }
39
-
40
- -(void)startObserving {
41
- hasListeners = YES;
42
- [[StaticClass instance].dbr setDBRTextResultListener:self];
43
- }
44
-
45
- -(void)stopObserving {
46
- hasListeners = NO;
47
- }
48
-
49
- RCT_EXPORT_MODULE(RNDynamsoftBarcodeReader)
50
-
51
- RCT_EXPORT_METHOD(initLicense:(NSString *)license
52
- resolver: (RCTPromiseResolveBlock)resolve
53
- rejecter: (RCTPromiseRejectBlock)reject)
54
- {
55
- licenseResolve = resolve;
56
- licenseReject = reject;
57
- [DynamsoftBarcodeReader initLicense:license verificationDelegate:self];
58
- }
59
-
60
- RCT_EXPORT_METHOD(createInstance) {
61
- [StaticClass instance].dbr = [DynamsoftBarcodeReader new];
62
- }
63
-
64
- RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getVersion) {
65
- return [DynamsoftBarcodeReader getVersion];
66
- }
67
-
68
- RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getInternalVersion) {
69
- return @"1.0.0";
70
- }
71
-
72
- RCT_EXPORT_METHOD(getSettings:(RCTPromiseResolveBlock)resolve
73
- rejecter: (RCTPromiseRejectBlock)reject)
74
- {
75
- NSError *error = [NSError new];
76
- iPublicRuntimeSettings *settings = [[StaticClass instance].dbr getRuntimeSettings:&error];
77
- if (error.code != 0) {
78
- resolve(@(NO));
79
- }else{
80
- NSDictionary *barcode = @{
81
- @"barcodeFormatIds" : [NSNumber numberWithInteger:settings.barcodeFormatIds],
82
- @"barcodeFormatIds_2" : [NSNumber numberWithInteger:settings.barcodeFormatIds_2],
83
- @"expectedBarcodeCount" : [NSNumber numberWithInteger:settings.expectedBarcodesCount],
84
- @"timeout" : [NSNumber numberWithInteger:settings.timeout]
85
- };
86
- resolve(barcode);
87
- }
88
- }
89
-
90
- RCT_EXPORT_METHOD(resetSettings:(RCTPromiseResolveBlock)resolve
91
- rejecter: (RCTPromiseRejectBlock)reject)
92
- {
93
- NSError *error = [NSError new];
94
- [[StaticClass instance].dbr resetRuntimeSettings:&error];
95
- if (error.code != 0) {
96
- resolve(@(NO));
97
- }else{
98
- resolve(@(YES));
99
- }
100
- }
101
-
102
- RCT_EXPORT_METHOD(outputSettings:(RCTPromiseResolveBlock)resolve
103
- rejecter: (RCTPromiseRejectBlock)reject)
104
- {
105
- resolve([[StaticClass instance].dbr outputSettingsToString:@"" error:nil]);
106
- }
107
-
108
- RCT_EXPORT_METHOD(updateSettingsFromString:(NSString *)settings
109
- resolver: (RCTPromiseResolveBlock)resolve
110
- rejecter: (RCTPromiseRejectBlock)reject)
111
- {
112
- NSError *error = [NSError new];
113
- [[StaticClass instance].dbr initRuntimeSettingsWithString:settings conflictMode:EnumConflictModeOverwrite error:&error];
114
- if (error.code != 0) {
115
- resolve(@(NO));
116
- }else{
117
- resolve(@(YES));
118
- }
119
- }
120
-
121
- RCT_EXPORT_METHOD(updateSettingsFromDictionary:(NSDictionary *)dic
122
- resolver: (RCTPromiseResolveBlock)resolve
123
- rejecter: (RCTPromiseRejectBlock)reject)
124
- {
125
- if (dic) {
126
- NSError *error = [NSError new];
127
- NSNumber *barcodeFormatIds = [dic valueForKey:@"barcodeFormatIds"];
128
- NSNumber *barcodeFormatIds_2 = [dic valueForKey:@"barcodeFormatIds_2"];
129
- NSNumber *expectedBarcodeCount = [dic valueForKey:@"expectedBarcodeCount"];
130
- NSNumber *timeout = [dic valueForKey:@"timeout"];
131
- iPublicRuntimeSettings *setting = [[StaticClass instance].dbr getRuntimeSettings:nil];
132
- setting.barcodeFormatIds = barcodeFormatIds.integerValue;
133
- setting.barcodeFormatIds_2 = barcodeFormatIds_2.integerValue;
134
- setting.expectedBarcodesCount = expectedBarcodeCount.integerValue;
135
- setting.timeout = timeout.integerValue;
136
-
137
- [[StaticClass instance].dbr updateRuntimeSettings:setting error:&error];
138
- if (error.code != 0) {
139
- resolve(@(NO));
140
- }else{
141
- resolve(@(YES));
142
- }
143
- }else{
144
- resolve(@(NO));
145
- }
146
- }
147
-
148
- RCT_EXPORT_METHOD(updateSettingsFromNumber:(nonnull NSNumber *)number
149
- resolver: (RCTPromiseResolveBlock)resolve
150
- rejecter: (RCTPromiseRejectBlock)reject)
151
- {
152
- if (number) {
153
- if (number.integerValue < 0 || number.integerValue > 6) {
154
- resolve(@(NO));
155
- return;
156
- }
157
- [[StaticClass instance].dbr updateRuntimeSettings:(EnumPresetTemplate)number.integerValue];
158
- resolve(@(YES));
159
- }else{
160
- resolve(@(NO));
161
- }
162
- }
163
-
164
- RCT_EXPORT_METHOD(startBarcodeScanning) {
165
- [[StaticClass instance].dbr setCameraEnhancer:[StaticClass instance].dce];
166
- [[StaticClass instance].dbr startScanning];
167
- }
168
-
169
- RCT_EXPORT_METHOD(stopBarcodeScanning) {
170
- [[StaticClass instance].dbr stopScanning];
171
- }
172
-
173
- - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError * _Nullable)error {
174
- if(isSuccess){
175
- licenseResolve(@(YES));
176
- }else{
177
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject:error.userInfo options:0 error:nil];
178
- NSString *msg = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
179
- NSError *err = [NSError errorWithDomain:@"com.dynamsoft.license.error" code:error.code userInfo:nil];
180
- NSString *code = [NSString stringWithFormat:@"%ld",(long)error.code];
181
- licenseReject(code, msg, err);
182
- }
183
- }
184
-
185
- - (void)textResultCallback:(NSInteger)frameId imageData:(iImageData * _Nonnull)imageData results:(NSArray<iTextResult *> * _Nullable)results {
186
- if (results.count > 0) {
187
- NSMutableArray* barcodes = [NSMutableArray array];
188
- NSString* formatString = @"all";
189
- for (iTextResult* res in results) {
190
- if (res.barcodeFormat_2 != EnumBarcodeFormat2NULL) {
191
- formatString = res.barcodeFormatString_2;
192
- }else{
193
- formatString = res.barcodeFormatString;
194
- }
195
- NSMutableArray* points = [NSMutableArray array];
196
- for (int i = 0; i < 4; i++) {
197
- NSDictionary *point = @{
198
- @"x": [NSNumber numberWithFloat:[res.localizationResult.resultPoints[i] CGPointValue].x],
199
- @"y": [NSNumber numberWithFloat:[res.localizationResult.resultPoints[i] CGPointValue].y]
200
- };
201
- [points addObject:point];
202
- }
203
- NSDictionary *quad = @{
204
- @"points" : points
205
- };
206
- NSDictionary *location = @{
207
- @"angle" : [NSNumber numberWithInteger:res.localizationResult.angle],
208
- @"location" : quad
209
- };
210
- NSDictionary *barcode = @{
211
- @"barcodeText" : res.barcodeText,
212
- @"barcodeFormatString" : formatString,
213
- @"barcodeLocation" : location
214
- };
215
- [barcodes addObject:barcode];
216
- }
217
- if (hasListeners) {
218
- [self sendEventWithName:@"resultEvent" body:[barcodes copy]];
219
- }
220
- }
221
- }
222
-
223
- @end
1
+ //
2
+ // RCTDynamsoftBarcodeReader.m
3
+ // RCTDynamsoftBarcodeReader
4
+ //
5
+ // Created by dynamsoft on 2022/3/16.
6
+ //
7
+
8
+ #import "RCTDynamsoftBarcodeReader.h"
9
+ #import <React/RCTLog.h>
10
+ #import "StaticClass.h"
11
+
12
+ @interface RCTDynamsoftBarcodeReader() <DBRLicenseVerificationListener, DBRTextResultListener>
13
+
14
+ @end
15
+
16
+ @implementation RCTDynamsoftBarcodeReader
17
+ {
18
+ bool hasListeners;
19
+ RCTPromiseResolveBlock licenseResolve;
20
+ RCTPromiseRejectBlock licenseReject;
21
+ }
22
+
23
+ - (instancetype)init {
24
+ self = [super init];
25
+ if (self) {
26
+
27
+ }
28
+ return self;
29
+ }
30
+
31
+ + (BOOL)requiresMainQueueSetup{
32
+ return YES;
33
+ }
34
+
35
+ - (NSDictionary *)constantsToExport
36
+ {
37
+ return @{
38
+ @"TorchState": @{
39
+ @"off": @0,
40
+ @"on": @1
41
+ },
42
+ };
43
+ }
44
+
45
+ - (NSArray<NSString *> *)supportedEvents
46
+ {
47
+ return @[@"resultEvent"];
48
+ }
49
+
50
+ -(void)startObserving {
51
+ hasListeners = YES;
52
+ [[StaticClass instance].dbr setDBRTextResultListener:self];
53
+ }
54
+
55
+ -(void)stopObserving {
56
+ hasListeners = NO;
57
+ }
58
+
59
+ RCT_EXPORT_MODULE(RNDynamsoftBarcodeReader)
60
+
61
+ RCT_EXPORT_METHOD(initLicense:(NSString *)license
62
+ resolver: (RCTPromiseResolveBlock)resolve
63
+ rejecter: (RCTPromiseRejectBlock)reject)
64
+ {
65
+ licenseResolve = resolve;
66
+ licenseReject = reject;
67
+ [DynamsoftBarcodeReader initLicense:license verificationDelegate:self];
68
+ }
69
+
70
+ RCT_EXPORT_METHOD(createInstance) {
71
+ [StaticClass instance].dbr = [DynamsoftBarcodeReader new];
72
+ }
73
+
74
+ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getVersion) {
75
+ return [DynamsoftBarcodeReader getVersion];
76
+ }
77
+
78
+ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getInternalVersion) {
79
+ return @"1.0.0";
80
+ }
81
+
82
+ RCT_EXPORT_METHOD(getSettings:(RCTPromiseResolveBlock)resolve
83
+ rejecter: (RCTPromiseRejectBlock)reject)
84
+ {
85
+ NSError *error = [NSError new];
86
+ iPublicRuntimeSettings *settings = [[StaticClass instance].dbr getRuntimeSettings:&error];
87
+ if (error.code != 0) {
88
+ resolve(@(NO));
89
+ }else{
90
+ NSDictionary *barcode = @{
91
+ @"barcodeFormatIds" : [NSNumber numberWithInteger:settings.barcodeFormatIds],
92
+ @"barcodeFormatIds_2" : [NSNumber numberWithInteger:settings.barcodeFormatIds_2],
93
+ @"expectedBarcodeCount" : [NSNumber numberWithInteger:settings.expectedBarcodesCount],
94
+ @"timeout" : [NSNumber numberWithInteger:settings.timeout]
95
+ };
96
+ resolve(barcode);
97
+ }
98
+ }
99
+
100
+ RCT_EXPORT_METHOD(resetSettings:(RCTPromiseResolveBlock)resolve
101
+ rejecter: (RCTPromiseRejectBlock)reject)
102
+ {
103
+ NSError *error = [NSError new];
104
+ [[StaticClass instance].dbr resetRuntimeSettings:&error];
105
+ if (error.code != 0) {
106
+ resolve(@(NO));
107
+ }else{
108
+ resolve(@(YES));
109
+ }
110
+ }
111
+
112
+ RCT_EXPORT_METHOD(outputSettings:(RCTPromiseResolveBlock)resolve
113
+ rejecter: (RCTPromiseRejectBlock)reject)
114
+ {
115
+ resolve([[StaticClass instance].dbr outputSettingsToString:@"" error:nil]);
116
+ }
117
+
118
+ RCT_EXPORT_METHOD(updateSettingsFromString:(NSString *)settings
119
+ resolver: (RCTPromiseResolveBlock)resolve
120
+ rejecter: (RCTPromiseRejectBlock)reject)
121
+ {
122
+ NSError *error = [NSError new];
123
+ [[StaticClass instance].dbr initRuntimeSettingsWithString:settings conflictMode:EnumConflictModeOverwrite error:&error];
124
+ if (error.code != 0) {
125
+ resolve(@(NO));
126
+ }else{
127
+ resolve(@(YES));
128
+ }
129
+ }
130
+
131
+ RCT_EXPORT_METHOD(updateSettingsFromDictionary:(NSDictionary *)dic
132
+ resolver: (RCTPromiseResolveBlock)resolve
133
+ rejecter: (RCTPromiseRejectBlock)reject)
134
+ {
135
+ if (dic) {
136
+ NSError *error = [NSError new];
137
+ NSNumber *barcodeFormatIds = [dic valueForKey:@"barcodeFormatIds"];
138
+ NSNumber *barcodeFormatIds_2 = [dic valueForKey:@"barcodeFormatIds_2"];
139
+ NSNumber *expectedBarcodeCount = [dic valueForKey:@"expectedBarcodeCount"];
140
+ NSNumber *timeout = [dic valueForKey:@"timeout"];
141
+ iPublicRuntimeSettings *setting = [[StaticClass instance].dbr getRuntimeSettings:nil];
142
+ setting.barcodeFormatIds = barcodeFormatIds.integerValue;
143
+ setting.barcodeFormatIds_2 = barcodeFormatIds_2.integerValue;
144
+ setting.expectedBarcodesCount = expectedBarcodeCount.integerValue;
145
+ setting.timeout = timeout.integerValue;
146
+
147
+ [[StaticClass instance].dbr updateRuntimeSettings:setting error:&error];
148
+ if (error.code != 0) {
149
+ resolve(@(NO));
150
+ }else{
151
+ resolve(@(YES));
152
+ }
153
+ }else{
154
+ resolve(@(NO));
155
+ }
156
+ }
157
+
158
+ RCT_EXPORT_METHOD(updateSettingsFromNumber:(nonnull NSNumber *)number
159
+ resolver: (RCTPromiseResolveBlock)resolve
160
+ rejecter: (RCTPromiseRejectBlock)reject)
161
+ {
162
+ if (number) {
163
+ if (number.integerValue < 0 || number.integerValue > 6) {
164
+ resolve(@(NO));
165
+ return;
166
+ }
167
+ [[StaticClass instance].dbr updateRuntimeSettings:(EnumPresetTemplate)number.integerValue];
168
+ resolve(@(YES));
169
+ }else{
170
+ resolve(@(NO));
171
+ }
172
+ }
173
+
174
+ RCT_EXPORT_METHOD(startBarcodeScanning) {
175
+ [[StaticClass instance].dbr setCameraEnhancer:[StaticClass instance].dce];
176
+ [[StaticClass instance].dbr startScanning];
177
+ }
178
+
179
+ RCT_EXPORT_METHOD(stopBarcodeScanning) {
180
+ [[StaticClass instance].dbr stopScanning];
181
+ }
182
+
183
+ - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError * _Nullable)error {
184
+ if(isSuccess){
185
+ licenseResolve(@(YES));
186
+ }else{
187
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:error.userInfo options:0 error:nil];
188
+ NSString *msg = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
189
+ NSError *err = [NSError errorWithDomain:@"com.dynamsoft.license.error" code:error.code userInfo:nil];
190
+ NSString *code = [NSString stringWithFormat:@"%ld",(long)error.code];
191
+ licenseReject(code, msg, err);
192
+ }
193
+ }
194
+
195
+ - (void)textResultCallback:(NSInteger)frameId imageData:(iImageData * _Nonnull)imageData results:(NSArray<iTextResult *> * _Nullable)results {
196
+ if (results.count > 0) {
197
+ NSMutableArray* barcodes = [NSMutableArray array];
198
+ NSString* formatString = @"all";
199
+ for (iTextResult* res in results) {
200
+ if (res.barcodeFormat_2 != EnumBarcodeFormat2NULL) {
201
+ formatString = res.barcodeFormatString_2;
202
+ }else{
203
+ formatString = res.barcodeFormatString;
204
+ }
205
+ NSMutableArray* points = [NSMutableArray array];
206
+ for (int i = 0; i < 4; i++) {
207
+ NSDictionary *point = @{
208
+ @"x": [NSNumber numberWithFloat:[res.localizationResult.resultPoints[i] CGPointValue].x],
209
+ @"y": [NSNumber numberWithFloat:[res.localizationResult.resultPoints[i] CGPointValue].y]
210
+ };
211
+ [points addObject:point];
212
+ }
213
+ NSDictionary *quad = @{
214
+ @"points" : points
215
+ };
216
+ NSDictionary *location = @{
217
+ @"angle" : [NSNumber numberWithInteger:res.localizationResult.angle],
218
+ @"location" : quad
219
+ };
220
+ NSDictionary *barcode = @{
221
+ @"barcodeText" : res.barcodeText,
222
+ @"barcodeFormatString" : formatString,
223
+ @"barcodeLocation" : location
224
+ };
225
+ [barcodes addObject:barcode];
226
+ }
227
+ if (hasListeners) {
228
+ [self sendEventWithName:@"resultEvent" body:[barcodes copy]];
229
+ }
230
+ }
231
+ }
232
+
233
+ @end
@@ -1,26 +1,26 @@
1
- //
2
- // StaticClass.h
3
- // RCTDynamsoftBarcodeReader
4
- //
5
- // Created by dynamsoft on 2022/3/23.
6
- //
7
-
8
- #import <Foundation/Foundation.h>
9
- #import <DynamsoftBarcodeReader/DynamsoftBarcodeReader.h>
10
- #import <DynamsoftCameraEnhancer/DynamsoftCameraEnhancerSDK.h>
11
-
12
- NS_ASSUME_NONNULL_BEGIN
13
-
14
- @interface StaticClass : NSObject
15
-
16
- @property (nonatomic, strong) DynamsoftBarcodeReader *dbr;
17
-
18
- @property (nonatomic, strong) DynamsoftCameraEnhancer *dce;
19
-
20
- @property (nonatomic, strong) DCECameraView *view;
21
-
22
- + (StaticClass *)instance;
23
-
24
- @end
25
-
26
- NS_ASSUME_NONNULL_END
1
+ //
2
+ // StaticClass.h
3
+ // RCTDynamsoftBarcodeReader
4
+ //
5
+ // Created by dynamsoft on 2022/3/23.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <DynamsoftBarcodeReader/DynamsoftBarcodeReader.h>
10
+ #import <DynamsoftCameraEnhancer/DynamsoftCameraEnhancerSDK.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface StaticClass : NSObject
15
+
16
+ @property (nonatomic, strong) DynamsoftBarcodeReader *dbr;
17
+
18
+ @property (nonatomic, strong) DynamsoftCameraEnhancer *dce;
19
+
20
+ @property (nonatomic, strong) DCECameraView *view;
21
+
22
+ + (StaticClass *)instance;
23
+
24
+ @end
25
+
26
+ NS_ASSUME_NONNULL_END
@@ -1,21 +1,21 @@
1
- //
2
- // StaticClass.m
3
- // RCTDynamsoftBarcodeReader
4
- //
5
- // Created by dynamsoft on 2022/3/23.
6
- //
7
-
8
- #import "StaticClass.h"
9
-
10
- @implementation StaticClass
11
-
12
- + (StaticClass *)instance{
13
- static StaticClass *instance = nil;
14
- static dispatch_once_t onceToken;
15
- dispatch_once(&onceToken, ^{
16
- instance = [super allocWithZone:NULL];
17
- });
18
- return instance;
19
- }
20
-
21
- @end
1
+ //
2
+ // StaticClass.m
3
+ // RCTDynamsoftBarcodeReader
4
+ //
5
+ // Created by dynamsoft on 2022/3/23.
6
+ //
7
+
8
+ #import "StaticClass.h"
9
+
10
+ @implementation StaticClass
11
+
12
+ + (StaticClass *)instance{
13
+ static StaticClass *instance = nil;
14
+ static dispatch_once_t onceToken;
15
+ dispatch_once(&onceToken, ^{
16
+ instance = [super allocWithZone:NULL];
17
+ });
18
+ return instance;
19
+ }
20
+
21
+ @end
@@ -0,0 +1,25 @@
1
+ import { Quadrilateral } from "./BasicStructures";
2
+ export interface BarcodeResult {
3
+ /**
4
+ * The barcode text.
5
+ */
6
+ barcodeText: string;
7
+ /**
8
+ * Barcode type in string.
9
+ */
10
+ barcodeFormatString: string;
11
+ /**
12
+ * The corresponding localization result.
13
+ */
14
+ barcodeLocation: BarcodeLocationResult;
15
+ }
16
+ export interface BarcodeLocationResult {
17
+ /**
18
+ * The angle of a barcode. Values range from 0 to 360.
19
+ */
20
+ angle: number;
21
+ /**
22
+ * The quadrilateral
23
+ */
24
+ quadrilateral: Quadrilateral;
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BarcodeResult.js.map