dynamsoft-capture-vision-react-native 3.4.1200 → 3.4.3000
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 +5 -5
- package/README.md +62 -66
- package/android/README.md +14 -14
- package/android/build.gradle +167 -163
- package/android/gradle.properties +20 -20
- package/android/settings.gradle +5 -5
- package/android/src/main/AndroidManifest.xml +6 -6
- package/android/src/main/AndroidManifest_noPackage.xml +5 -5
- package/android/src/main/cpp/CMakeLists.txt +21 -21
- package/android/src/main/cpp/ImgHO.cpp +94 -94
- package/android/src/main/cpp/ImgHO.h +34 -34
- package/android/src/main/cpp/JsiCore.cpp +296 -296
- package/android/src/main/cpp/JsiCore.h +51 -51
- package/android/src/main/cpp/JsiCvr.cpp +332 -332
- package/android/src/main/cpp/JsiCvr.h +54 -54
- package/android/src/main/cpp/JsiDbr.cpp +283 -283
- package/android/src/main/cpp/JsiDbr.h +26 -26
- package/android/src/main/cpp/JsiDce.cpp +59 -59
- package/android/src/main/cpp/JsiDce.h +17 -17
- package/android/src/main/cpp/JsiDcp.cpp +51 -51
- package/android/src/main/cpp/JsiDcp.h +31 -31
- package/android/src/main/cpp/JsiDdn.cpp +50 -50
- package/android/src/main/cpp/JsiDdn.h +28 -28
- package/android/src/main/cpp/JsiDlr.cpp +60 -60
- package/android/src/main/cpp/JsiDlr.h +26 -26
- package/android/src/main/cpp/JsiUtility.cpp +604 -604
- package/android/src/main/cpp/JsiUtility.h +26 -26
- package/android/src/main/cpp/RawBuffer.cpp +23 -23
- package/android/src/main/cpp/RawBuffer.h +24 -24
- package/android/src/main/cpp/android_log.h +14 -14
- package/android/src/main/dysJniLibs/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/debug/arm64-v8a/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/debug/armeabi-v7a/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/debug/x86/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/debug/x86_64/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/release/arm64-v8a/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/release/armeabi-v7a/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/release/x86/librn_dys.so +3 -0
- package/android/src/main/dysJniLibsFor86/release/x86_64/librn_dys.so +3 -0
- package/android/src/main/java/com/dynamsoft/reactnativelib/CVRModule.kt +137 -137
- package/android/src/main/java/com/dynamsoft/reactnativelib/CameraViewManager.kt +62 -62
- package/android/src/main/java/com/dynamsoft/reactnativelib/DCEModule.kt +125 -125
- package/android/src/main/java/com/dynamsoft/reactnativelib/DynamsoftBaseModule.kt +8 -8
- package/android/src/main/java/com/dynamsoft/reactnativelib/ISAModule.kt +73 -73
- package/android/src/main/java/com/dynamsoft/reactnativelib/ImageEditorViewManager.kt +14 -14
- package/android/src/main/java/com/dynamsoft/reactnativelib/ImageEditorViewModule.kt +35 -35
- package/android/src/main/java/com/dynamsoft/reactnativelib/ImageManagerModule.kt +15 -15
- package/android/src/main/java/com/dynamsoft/reactnativelib/LicenseModule.kt +29 -29
- package/android/src/main/java/com/dynamsoft/reactnativelib/MultiCrossFilterModule.kt +83 -83
- package/android/src/main/java/com/dynamsoft/reactnativelib/ReactNativeDcvPackage.kt +32 -32
- package/android/src/main/java/com/dynamsoft/reactnativelib/VersionsModule.kt +41 -41
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/Basic.kt +44 -44
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForCore.kt +50 -50
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForCvr.kt +129 -129
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDBR.kt +157 -157
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDCE.kt +110 -110
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDCP.kt +49 -49
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDDN.kt +85 -85
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDLR.kt +72 -72
- package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ImageUtil.kt +58 -58
- package/android/src/main/java/com/dynamsoft/reactnativelib/core/ImageSourceAdapterModuleImpl.kt +120 -120
- package/android/src/main/java/com/dynamsoft/reactnativelib/cvr/CaptureVisionRouterModuleImpl.kt +306 -306
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraEnhancerModuleImpl.kt +247 -247
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraLifeCycleOwner.java +14 -14
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraViewManagerImpl.kt +77 -77
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewManagerImpl.kt +15 -15
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewModuleImpl.kt +110 -110
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNCameraView.kt +20 -20
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNImageEditorView.kt +19 -19
- package/android/src/main/java/com/dynamsoft/reactnativelib/license/LicenseModuleImpl.kt +39 -39
- package/android/src/main/java/com/dynamsoft/reactnativelib/utility/ImageManagerModuleImpl.kt +120 -120
- package/android/src/main/java/com/dynamsoft/reactnativelib/utility/MultiCrossFilterModuleImpl.kt +111 -111
- package/app.plugin.js +21 -21
- package/dynamsoft-capture-vision-react-native.podspec +24 -24
- package/ios/CPP/DSImageData+HostObject.h +18 -18
- package/ios/CPP/DSImageData+HostObject.mm +38 -38
- package/ios/CPP/ImageDataHostObject.cpp +87 -87
- package/ios/CPP/ImageDataHostObject.hpp +35 -35
- package/ios/CPP/MutableRawBuffer.cpp +23 -23
- package/ios/CPP/MutableRawBuffer.hpp +23 -23
- package/ios/CPP/RNDynamsoft+JSI.h +22 -22
- package/ios/CPP/RNDynamsoft+JSI.mm +303 -303
- package/ios/CPP/RNDynamsoft+Json.h +93 -93
- package/ios/CPP/RNDynamsoft+Json.m +733 -733
- package/ios/CPP/YeetJSIUtils.h +56 -56
- package/ios/CPP/YeetJSIUtils.mm +208 -208
- package/ios/RNDynamsoftCameraView.h +31 -31
- package/ios/RNDynamsoftCameraView.m +108 -108
- package/ios/RNDynamsoftCameraViewManager.h +14 -14
- package/ios/RNDynamsoftCameraViewManager.m +195 -195
- package/ios/RNDynamsoftCaptureVisionRouter.h +18 -18
- package/ios/RNDynamsoftCaptureVisionRouter.mm +532 -532
- package/ios/RNDynamsoftImageEditorView.h +17 -17
- package/ios/RNDynamsoftImageEditorView.m +25 -25
- package/ios/RNDynamsoftImageEditorViewManager.h +14 -14
- package/ios/RNDynamsoftImageEditorViewManager.mm +183 -183
- package/ios/RNDynamsoftImageManager.h +14 -14
- package/ios/RNDynamsoftImageManager.mm +369 -369
- package/ios/RNDynamsoftImageSourceAdapter.h +19 -19
- package/ios/RNDynamsoftImageSourceAdapter.mm +255 -255
- package/ios/RNDynamsoftLicense.h +14 -14
- package/ios/RNDynamsoftLicense.m +62 -62
- package/ios/RNDynamsoftMultiCrossFilter.h +14 -14
- package/ios/RNDynamsoftMultiCrossFilter.m +145 -145
- package/ios/RNDynamsoftVersions.h +13 -13
- package/ios/RNDynamsoftVersions.m +27 -27
- package/package.json +48 -48
- package/src/NativeDynamsoftVersionsModule.tsx +20 -20
- package/src/VersionsModule.tsx +7 -7
- package/src/core/CapturedResultBase.tsx +18 -18
- package/src/core/CapturedResultItem.tsx +23 -23
- package/src/core/CoreModule.tsx +9 -9
- package/src/core/DSRect.tsx +29 -29
- package/src/core/EnumCaptureResultItemType.tsx +52 -52
- package/src/core/EnumColourChannelUsageType.tsx +26 -26
- package/src/core/EnumCrossVerificationStatus.tsx +46 -46
- package/src/core/EnumGrayscaleEnhancementMode.tsx +46 -46
- package/src/core/EnumGrayscaleTransformationMode.tsx +35 -35
- package/src/core/EnumImageFileFormat.tsx +6 -6
- package/src/core/EnumPixelFormat.tsx +53 -53
- package/src/core/ImageData.tsx +87 -87
- package/src/core/ImageSourceAdapter.tsx +160 -160
- package/src/core/NativeDynamsoftImageSourceAdapterModule.tsx +29 -29
- package/src/core/Point.tsx +13 -13
- package/src/core/Quadrilateral.tsx +12 -12
- package/src/core/index.tsx +18 -18
- package/src/cvr/CaptureVisionRouter.tsx +683 -683
- package/src/cvr/CaptureVisionRouterModule.tsx +9 -9
- package/src/cvr/CapturedResult.tsx +123 -123
- package/src/cvr/CapturedResultFilter.tsx +13 -13
- package/src/cvr/CapturedResultReceiver.tsx +71 -71
- package/src/cvr/EnumPresetTemplate.tsx +81 -81
- package/src/cvr/NativeDynamsoftCaptureVisionRouterModule.tsx +25 -25
- package/src/cvr/SimplifiedCaptureVisionSettings.tsx +61 -61
- package/src/cvr/index.tsx +11 -11
- package/src/dbr/BarcodeDetails.tsx +51 -51
- package/src/dbr/BarcodeReaderModule.tsx +9 -9
- package/src/dbr/BarcodeResultItem.tsx +65 -65
- package/src/dbr/DecodedBarcodesResult.tsx +14 -14
- package/src/dbr/ECISegment.tsx +23 -23
- package/src/dbr/EnumBarcodeFormat.tsx +112 -112
- package/src/dbr/EnumDeblurMode.tsx +29 -29
- package/src/dbr/EnumLocalizationMode.tsx +27 -27
- package/src/dbr/EnumQRCodeErrorCorrectionLevel.tsx +6 -6
- package/src/dbr/SimplifiedBarcodeReaderSettings.tsx +80 -80
- package/src/dbr/index.tsx +9 -9
- package/src/dce/CameraEnhancer.tsx +254 -254
- package/src/dce/CameraEnhancerModule.tsx +9 -9
- package/src/dce/CameraView.tsx +100 -100
- package/src/dce/DynamsoftCameraViewNativeComponent.ts +96 -96
- package/src/dce/DynamsoftImageEditorViewNativeComponent.ts +9 -9
- package/src/dce/EnumCameraPosition.tsx +25 -25
- package/src/dce/EnumDrawingLayerId.tsx +17 -17
- package/src/dce/EnumEnhancedFeatures.tsx +24 -24
- package/src/dce/EnumFocusMode.tsx +6 -6
- package/src/dce/EnumResolution.tsx +8 -8
- package/src/dce/EnumTorchState.tsx +10 -10
- package/src/dce/FeedBack.tsx +28 -28
- package/src/dce/ImageEditorView.tsx +131 -131
- package/src/dce/NativeDynamsoftCameraViewModule.tsx +47 -47
- package/src/dce/NativeDynamsoftImageEditorViewModule.ts +9 -9
- package/src/dce/index.tsx +13 -13
- package/src/dcp/CodeParserDedicatorModule.tsx +9 -9
- package/src/dcp/CodeParserModule.tsx +9 -9
- package/src/dcp/EnumMappingStatus.tsx +14 -14
- package/src/dcp/EnumValidationStatus.tsx +14 -14
- package/src/dcp/ParsedResult.tsx +14 -14
- package/src/dcp/ParsedResultItem.tsx +50 -50
- package/src/dcp/index.tsx +8 -8
- package/src/ddn/DeskewedImageResultItem.tsx +40 -40
- package/src/ddn/DetectedQuadResultItem.tsx +31 -31
- package/src/ddn/DocumentNormalizerModule.tsx +9 -9
- package/src/ddn/EnhancedImageResultItem.tsx +20 -20
- package/src/ddn/EnumImageColourMode.tsx +14 -14
- package/src/ddn/ProcessedDocumentResult.tsx +27 -27
- package/src/ddn/SimplifiedDocumentNormalizerSettings.tsx +65 -65
- package/src/ddn/index.tsx +11 -11
- package/src/dip/ImageProcessingModule.tsx +9 -9
- package/src/dip/index.tsx +1 -1
- package/src/dlr/CharacterResult.tsx +28 -28
- package/src/dlr/LabelRecognizerModule.tsx +9 -9
- package/src/dlr/RecognizedTextLinesResult.tsx +19 -19
- package/src/dlr/SimplifiedLabelRecognizerSettings.tsx +33 -33
- package/src/dlr/TextLineResultItem.tsx +41 -41
- package/src/dlr/index.tsx +8 -8
- package/src/index.tsx +13 -13
- package/src/license/LicenseManager.tsx +49 -49
- package/src/license/LicenseModule.tsx +9 -9
- package/src/license/NativeDynamsoftLicenseModule.tsx +7 -7
- package/src/license/index.tsx +7 -7
- package/src/utility/CrossVerificationCriteria.tsx +11 -11
- package/src/utility/EnumFilterType.tsx +5 -5
- package/src/utility/ImageManager.tsx +348 -348
- package/src/utility/MultiFrameResultCrossFilter.tsx +183 -183
- package/src/utility/NativeDynamsoftImageManagerModule.tsx +7 -7
- package/src/utility/NativeDynamsoftMultiCrossFilterModule.tsx +18 -18
- package/src/utility/UtilityModule.tsx +9 -9
- package/src/utility/index.tsx +4 -4
- package/android/.gitignore +0 -4
package/ios/CPP/YeetJSIUtils.h
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#import <Foundation/Foundation.h>
|
|
6
|
-
#import <jsi/jsi.h>
|
|
7
|
-
#import <React/RCTBridgeModule.h>
|
|
8
|
-
#include "ImageDataHostObject.hpp"
|
|
9
|
-
#import <DynamsoftCaptureVisionBundle/DSImageData.h>
|
|
10
|
-
|
|
11
|
-
using namespace facebook;
|
|
12
|
-
/**
|
|
13
|
-
* All static helper functions are ObjC++ specific.
|
|
14
|
-
*/
|
|
15
|
-
jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value);
|
|
16
|
-
jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value);
|
|
17
|
-
jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value);
|
|
18
|
-
jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value);
|
|
19
|
-
jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value);
|
|
20
|
-
jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value);
|
|
21
|
-
std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value);
|
|
22
|
-
|
|
23
|
-
id convertJSIValueToObjCObject(
|
|
24
|
-
jsi::Runtime &runtime,
|
|
25
|
-
const jsi::Value &value);
|
|
26
|
-
NSString* convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value);
|
|
27
|
-
NSArray* convertJSIArrayToNSArray(
|
|
28
|
-
jsi::Runtime &runtime,
|
|
29
|
-
const jsi::Array &value);
|
|
30
|
-
NSDictionary *convertJSIObjectToNSDictionary(
|
|
31
|
-
jsi::Runtime &runtime,
|
|
32
|
-
const jsi::Object &value);
|
|
33
|
-
RCTResponseSenderBlock convertJSIFunctionToCallback(
|
|
34
|
-
jsi::Runtime &runtime,
|
|
35
|
-
const jsi::Function &value);
|
|
36
|
-
|
|
37
|
-
NSData* convertArrayBufferToNSData(jsi::Runtime &runtime, const jsi::ArrayBuffer &buffer);
|
|
38
|
-
|
|
39
|
-
jsi::ArrayBuffer converNSDataToArrayBuffer(jsi::Runtime &runtime, NSData *data);
|
|
40
|
-
|
|
41
|
-
struct Promise {
|
|
42
|
-
Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject);
|
|
43
|
-
|
|
44
|
-
void resolve(const jsi::Value &result);
|
|
45
|
-
void reject(const std::string &error);
|
|
46
|
-
|
|
47
|
-
jsi::Runtime &runtime_;
|
|
48
|
-
jsi::Function resolve_;
|
|
49
|
-
jsi::Function reject_;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
using PromiseSetupFunctionType =
|
|
53
|
-
std::function<void(jsi::Runtime &rt, std::shared_ptr<Promise>)>;
|
|
54
|
-
jsi::Value createPromiseAsJSIValue(
|
|
55
|
-
jsi::Runtime &rt,
|
|
56
|
-
const PromiseSetupFunctionType func);
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#import <Foundation/Foundation.h>
|
|
6
|
+
#import <jsi/jsi.h>
|
|
7
|
+
#import <React/RCTBridgeModule.h>
|
|
8
|
+
#include "ImageDataHostObject.hpp"
|
|
9
|
+
#import <DynamsoftCaptureVisionBundle/DSImageData.h>
|
|
10
|
+
|
|
11
|
+
using namespace facebook;
|
|
12
|
+
/**
|
|
13
|
+
* All static helper functions are ObjC++ specific.
|
|
14
|
+
*/
|
|
15
|
+
jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value);
|
|
16
|
+
jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value);
|
|
17
|
+
jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value);
|
|
18
|
+
jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value);
|
|
19
|
+
jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value);
|
|
20
|
+
jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value);
|
|
21
|
+
std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value);
|
|
22
|
+
|
|
23
|
+
id convertJSIValueToObjCObject(
|
|
24
|
+
jsi::Runtime &runtime,
|
|
25
|
+
const jsi::Value &value);
|
|
26
|
+
NSString* convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value);
|
|
27
|
+
NSArray* convertJSIArrayToNSArray(
|
|
28
|
+
jsi::Runtime &runtime,
|
|
29
|
+
const jsi::Array &value);
|
|
30
|
+
NSDictionary *convertJSIObjectToNSDictionary(
|
|
31
|
+
jsi::Runtime &runtime,
|
|
32
|
+
const jsi::Object &value);
|
|
33
|
+
RCTResponseSenderBlock convertJSIFunctionToCallback(
|
|
34
|
+
jsi::Runtime &runtime,
|
|
35
|
+
const jsi::Function &value);
|
|
36
|
+
|
|
37
|
+
NSData* convertArrayBufferToNSData(jsi::Runtime &runtime, const jsi::ArrayBuffer &buffer);
|
|
38
|
+
|
|
39
|
+
jsi::ArrayBuffer converNSDataToArrayBuffer(jsi::Runtime &runtime, NSData *data);
|
|
40
|
+
|
|
41
|
+
struct Promise {
|
|
42
|
+
Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject);
|
|
43
|
+
|
|
44
|
+
void resolve(const jsi::Value &result);
|
|
45
|
+
void reject(const std::string &error);
|
|
46
|
+
|
|
47
|
+
jsi::Runtime &runtime_;
|
|
48
|
+
jsi::Function resolve_;
|
|
49
|
+
jsi::Function reject_;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
using PromiseSetupFunctionType =
|
|
53
|
+
std::function<void(jsi::Runtime &rt, std::shared_ptr<Promise>)>;
|
|
54
|
+
jsi::Value createPromiseAsJSIValue(
|
|
55
|
+
jsi::Runtime &rt,
|
|
56
|
+
const PromiseSetupFunctionType func);
|
package/ios/CPP/YeetJSIUtils.mm
CHANGED
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#include "YeetJSIUtils.h"
|
|
6
|
-
#import <React/RCTConvert.h>
|
|
7
|
-
#import <React/RCTBridgeModule.h>
|
|
8
|
-
//#import <ReactCommon/TurboModuleUtils.h>
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* All helper functions are ObjC++ specific.
|
|
12
|
-
*/
|
|
13
|
-
jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value)
|
|
14
|
-
{
|
|
15
|
-
return jsi::Value((bool)[value boolValue]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value)
|
|
19
|
-
{
|
|
20
|
-
return jsi::Value([value doubleValue]);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
|
|
24
|
-
{
|
|
25
|
-
return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value)
|
|
29
|
-
{
|
|
30
|
-
if ([value isKindOfClass:[NSString class]]) {
|
|
31
|
-
return convertNSStringToJSIString(runtime, (NSString *)value);
|
|
32
|
-
} else if ([value isKindOfClass:[NSNumber class]]) {
|
|
33
|
-
if ([value isKindOfClass:[@YES class]]) {
|
|
34
|
-
return convertNSNumberToJSIBoolean(runtime, (NSNumber *)value);
|
|
35
|
-
}
|
|
36
|
-
return convertNSNumberToJSINumber(runtime, (NSNumber *)value);
|
|
37
|
-
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
|
38
|
-
return convertNSDictionaryToJSIObject(runtime, (NSDictionary *)value);
|
|
39
|
-
} else if ([value isKindOfClass:[NSArray class]]) {
|
|
40
|
-
return convertNSArrayToJSIArray(runtime, (NSArray *)value);
|
|
41
|
-
} else if (value == (id)kCFNull) {
|
|
42
|
-
return jsi::Value::null();
|
|
43
|
-
}
|
|
44
|
-
return jsi::Value::undefined();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
|
|
48
|
-
{
|
|
49
|
-
jsi::Object result = jsi::Object(runtime);
|
|
50
|
-
for (NSString *k in value) {
|
|
51
|
-
result.setProperty(runtime, [k UTF8String], convertObjCObjectToJSIValue(runtime, value[k]));
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value)
|
|
57
|
-
{
|
|
58
|
-
jsi::Array result = jsi::Array(runtime, value.count);
|
|
59
|
-
for (size_t i = 0; i < value.count; i++) {
|
|
60
|
-
result.setValueAtIndex(runtime, i, convertObjCObjectToJSIValue(runtime, value[i]));
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value)
|
|
66
|
-
{
|
|
67
|
-
std::vector<jsi::Value> result;
|
|
68
|
-
for (size_t i = 0; i < value.count; i++) {
|
|
69
|
-
result.emplace_back(convertObjCObjectToJSIValue(runtime, value[i]));
|
|
70
|
-
}
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
id convertJSIValueToObjCObject(
|
|
75
|
-
jsi::Runtime &runtime,
|
|
76
|
-
const jsi::Value &value)
|
|
77
|
-
{
|
|
78
|
-
if (value.isUndefined() || value.isNull()) {
|
|
79
|
-
return nil;
|
|
80
|
-
}
|
|
81
|
-
if (value.isBool()) {
|
|
82
|
-
return @(value.getBool());
|
|
83
|
-
}
|
|
84
|
-
if (value.isNumber()) {
|
|
85
|
-
return @(value.getNumber());
|
|
86
|
-
}
|
|
87
|
-
if (value.isString()) {
|
|
88
|
-
return convertJSIStringToNSString(runtime, value.getString(runtime));
|
|
89
|
-
}
|
|
90
|
-
if (value.isObject()) {
|
|
91
|
-
jsi::Object o = value.getObject(runtime);
|
|
92
|
-
if (o.isArray(runtime)) {
|
|
93
|
-
return convertJSIArrayToNSArray(runtime, o.getArray(runtime));
|
|
94
|
-
}
|
|
95
|
-
if (o.isFunction(runtime)) {
|
|
96
|
-
return convertJSIFunctionToCallback(runtime, std::move(o.getFunction(runtime)));
|
|
97
|
-
}
|
|
98
|
-
return convertJSIObjectToNSDictionary(runtime, o);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
throw std::runtime_error("Unsupported jsi::jsi::Value kind");
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
NSString *convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value)
|
|
105
|
-
{
|
|
106
|
-
return [NSString stringWithUTF8String:value.utf8(runtime).c_str()];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
NSArray *convertJSIArrayToNSArray(
|
|
110
|
-
jsi::Runtime &runtime,
|
|
111
|
-
const jsi::Array &value)
|
|
112
|
-
{
|
|
113
|
-
size_t size = value.size(runtime);
|
|
114
|
-
NSMutableArray *result = [NSMutableArray new];
|
|
115
|
-
for (size_t i = 0; i < size; i++) {
|
|
116
|
-
// Insert kCFNull when it's `undefined` value to preserve the indices.
|
|
117
|
-
[result
|
|
118
|
-
addObject:convertJSIValueToObjCObject(runtime, value.getValueAtIndex(runtime, i)) ?: (id)kCFNull];
|
|
119
|
-
}
|
|
120
|
-
return [result copy];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
NSDictionary *convertJSIObjectToNSDictionary(
|
|
124
|
-
jsi::Runtime &runtime,
|
|
125
|
-
const jsi::Object &value)
|
|
126
|
-
{
|
|
127
|
-
jsi::Array propertyNames = value.getPropertyNames(runtime);
|
|
128
|
-
size_t size = propertyNames.size(runtime);
|
|
129
|
-
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
130
|
-
for (size_t i = 0; i < size; i++) {
|
|
131
|
-
jsi::String name = propertyNames.getValueAtIndex(runtime, i).getString(runtime);
|
|
132
|
-
NSString *k = convertJSIStringToNSString(runtime, name);
|
|
133
|
-
id v = convertJSIValueToObjCObject(runtime, value.getProperty(runtime, name));
|
|
134
|
-
if (v) {
|
|
135
|
-
result[k] = v;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return [result copy];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
RCTResponseSenderBlock convertJSIFunctionToCallback(
|
|
142
|
-
jsi::Runtime &runtime,
|
|
143
|
-
const jsi::Function &value)
|
|
144
|
-
{
|
|
145
|
-
__block auto cb = value.getFunction(runtime);
|
|
146
|
-
|
|
147
|
-
return ^(NSArray *responses) {
|
|
148
|
-
cb.call(runtime, convertNSArrayToJSIArray(runtime, responses), 2);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
NSData* convertArrayBufferToNSData(jsi::Runtime &runtime, const jsi::ArrayBuffer &buffer) {
|
|
153
|
-
return [NSData dataWithBytes:buffer.data(runtime)
|
|
154
|
-
length:buffer.size(runtime)];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
jsi::ArrayBuffer converNSDataToArrayBuffer(jsi::Runtime &runtime, NSData *data) {
|
|
158
|
-
size_t length = [data length];
|
|
159
|
-
const void *bytes = [data bytes];
|
|
160
|
-
|
|
161
|
-
jsi::ArrayBuffer arrayBuffer = runtime.global()
|
|
162
|
-
.getPropertyAsFunction(runtime, "ArrayBuffer")
|
|
163
|
-
.callAsConstructor(runtime, (double)length)
|
|
164
|
-
.getObject(runtime)
|
|
165
|
-
.getArrayBuffer(runtime);
|
|
166
|
-
|
|
167
|
-
memcpy(arrayBuffer.data(runtime), bytes, length);
|
|
168
|
-
|
|
169
|
-
return arrayBuffer;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
Promise::Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject)
|
|
173
|
-
: runtime_(rt), resolve_(std::move(resolve)), reject_(std::move(reject)) {}
|
|
174
|
-
|
|
175
|
-
void Promise::resolve(const jsi::Value &result) {
|
|
176
|
-
resolve_.call(runtime_, result);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
void Promise::reject(const std::string &message) {
|
|
180
|
-
jsi::Object error(runtime_);
|
|
181
|
-
error.setProperty(
|
|
182
|
-
runtime_, "message", jsi::String::createFromUtf8(runtime_, message));
|
|
183
|
-
reject_.call(runtime_, error);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
jsi::Value createPromiseAsJSIValue(
|
|
187
|
-
jsi::Runtime &rt,
|
|
188
|
-
const PromiseSetupFunctionType func) {
|
|
189
|
-
jsi::Function JSPromise = rt.global().getPropertyAsFunction(rt, "Promise");
|
|
190
|
-
jsi::Function fn = jsi::Function::createFromHostFunction(
|
|
191
|
-
rt,
|
|
192
|
-
jsi::PropNameID::forAscii(rt, "fn"),
|
|
193
|
-
2,
|
|
194
|
-
[func](
|
|
195
|
-
jsi::Runtime &rt2,
|
|
196
|
-
const jsi::Value &thisVal,
|
|
197
|
-
const jsi::Value *args,
|
|
198
|
-
size_t count) {
|
|
199
|
-
jsi::Function resolve = args[0].getObject(rt2).getFunction(rt2);
|
|
200
|
-
jsi::Function reject = args[1].getObject(rt2).getFunction(rt2);
|
|
201
|
-
auto wrapper = std::make_shared<Promise>(
|
|
202
|
-
rt2, std::move(resolve), std::move(reject));
|
|
203
|
-
func(rt2, wrapper);
|
|
204
|
-
return jsi::Value::undefined();
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
return JSPromise.callAsConstructor(rt, fn);
|
|
208
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include "YeetJSIUtils.h"
|
|
6
|
+
#import <React/RCTConvert.h>
|
|
7
|
+
#import <React/RCTBridgeModule.h>
|
|
8
|
+
//#import <ReactCommon/TurboModuleUtils.h>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* All helper functions are ObjC++ specific.
|
|
12
|
+
*/
|
|
13
|
+
jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value)
|
|
14
|
+
{
|
|
15
|
+
return jsi::Value((bool)[value boolValue]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value)
|
|
19
|
+
{
|
|
20
|
+
return jsi::Value([value doubleValue]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
|
|
24
|
+
{
|
|
25
|
+
return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value)
|
|
29
|
+
{
|
|
30
|
+
if ([value isKindOfClass:[NSString class]]) {
|
|
31
|
+
return convertNSStringToJSIString(runtime, (NSString *)value);
|
|
32
|
+
} else if ([value isKindOfClass:[NSNumber class]]) {
|
|
33
|
+
if ([value isKindOfClass:[@YES class]]) {
|
|
34
|
+
return convertNSNumberToJSIBoolean(runtime, (NSNumber *)value);
|
|
35
|
+
}
|
|
36
|
+
return convertNSNumberToJSINumber(runtime, (NSNumber *)value);
|
|
37
|
+
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
|
38
|
+
return convertNSDictionaryToJSIObject(runtime, (NSDictionary *)value);
|
|
39
|
+
} else if ([value isKindOfClass:[NSArray class]]) {
|
|
40
|
+
return convertNSArrayToJSIArray(runtime, (NSArray *)value);
|
|
41
|
+
} else if (value == (id)kCFNull) {
|
|
42
|
+
return jsi::Value::null();
|
|
43
|
+
}
|
|
44
|
+
return jsi::Value::undefined();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
|
|
48
|
+
{
|
|
49
|
+
jsi::Object result = jsi::Object(runtime);
|
|
50
|
+
for (NSString *k in value) {
|
|
51
|
+
result.setProperty(runtime, [k UTF8String], convertObjCObjectToJSIValue(runtime, value[k]));
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value)
|
|
57
|
+
{
|
|
58
|
+
jsi::Array result = jsi::Array(runtime, value.count);
|
|
59
|
+
for (size_t i = 0; i < value.count; i++) {
|
|
60
|
+
result.setValueAtIndex(runtime, i, convertObjCObjectToJSIValue(runtime, value[i]));
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value)
|
|
66
|
+
{
|
|
67
|
+
std::vector<jsi::Value> result;
|
|
68
|
+
for (size_t i = 0; i < value.count; i++) {
|
|
69
|
+
result.emplace_back(convertObjCObjectToJSIValue(runtime, value[i]));
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
id convertJSIValueToObjCObject(
|
|
75
|
+
jsi::Runtime &runtime,
|
|
76
|
+
const jsi::Value &value)
|
|
77
|
+
{
|
|
78
|
+
if (value.isUndefined() || value.isNull()) {
|
|
79
|
+
return nil;
|
|
80
|
+
}
|
|
81
|
+
if (value.isBool()) {
|
|
82
|
+
return @(value.getBool());
|
|
83
|
+
}
|
|
84
|
+
if (value.isNumber()) {
|
|
85
|
+
return @(value.getNumber());
|
|
86
|
+
}
|
|
87
|
+
if (value.isString()) {
|
|
88
|
+
return convertJSIStringToNSString(runtime, value.getString(runtime));
|
|
89
|
+
}
|
|
90
|
+
if (value.isObject()) {
|
|
91
|
+
jsi::Object o = value.getObject(runtime);
|
|
92
|
+
if (o.isArray(runtime)) {
|
|
93
|
+
return convertJSIArrayToNSArray(runtime, o.getArray(runtime));
|
|
94
|
+
}
|
|
95
|
+
if (o.isFunction(runtime)) {
|
|
96
|
+
return convertJSIFunctionToCallback(runtime, std::move(o.getFunction(runtime)));
|
|
97
|
+
}
|
|
98
|
+
return convertJSIObjectToNSDictionary(runtime, o);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
throw std::runtime_error("Unsupported jsi::jsi::Value kind");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
NSString *convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value)
|
|
105
|
+
{
|
|
106
|
+
return [NSString stringWithUTF8String:value.utf8(runtime).c_str()];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
NSArray *convertJSIArrayToNSArray(
|
|
110
|
+
jsi::Runtime &runtime,
|
|
111
|
+
const jsi::Array &value)
|
|
112
|
+
{
|
|
113
|
+
size_t size = value.size(runtime);
|
|
114
|
+
NSMutableArray *result = [NSMutableArray new];
|
|
115
|
+
for (size_t i = 0; i < size; i++) {
|
|
116
|
+
// Insert kCFNull when it's `undefined` value to preserve the indices.
|
|
117
|
+
[result
|
|
118
|
+
addObject:convertJSIValueToObjCObject(runtime, value.getValueAtIndex(runtime, i)) ?: (id)kCFNull];
|
|
119
|
+
}
|
|
120
|
+
return [result copy];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
NSDictionary *convertJSIObjectToNSDictionary(
|
|
124
|
+
jsi::Runtime &runtime,
|
|
125
|
+
const jsi::Object &value)
|
|
126
|
+
{
|
|
127
|
+
jsi::Array propertyNames = value.getPropertyNames(runtime);
|
|
128
|
+
size_t size = propertyNames.size(runtime);
|
|
129
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
130
|
+
for (size_t i = 0; i < size; i++) {
|
|
131
|
+
jsi::String name = propertyNames.getValueAtIndex(runtime, i).getString(runtime);
|
|
132
|
+
NSString *k = convertJSIStringToNSString(runtime, name);
|
|
133
|
+
id v = convertJSIValueToObjCObject(runtime, value.getProperty(runtime, name));
|
|
134
|
+
if (v) {
|
|
135
|
+
result[k] = v;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return [result copy];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
RCTResponseSenderBlock convertJSIFunctionToCallback(
|
|
142
|
+
jsi::Runtime &runtime,
|
|
143
|
+
const jsi::Function &value)
|
|
144
|
+
{
|
|
145
|
+
__block auto cb = value.getFunction(runtime);
|
|
146
|
+
|
|
147
|
+
return ^(NSArray *responses) {
|
|
148
|
+
cb.call(runtime, convertNSArrayToJSIArray(runtime, responses), 2);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
NSData* convertArrayBufferToNSData(jsi::Runtime &runtime, const jsi::ArrayBuffer &buffer) {
|
|
153
|
+
return [NSData dataWithBytes:buffer.data(runtime)
|
|
154
|
+
length:buffer.size(runtime)];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
jsi::ArrayBuffer converNSDataToArrayBuffer(jsi::Runtime &runtime, NSData *data) {
|
|
158
|
+
size_t length = [data length];
|
|
159
|
+
const void *bytes = [data bytes];
|
|
160
|
+
|
|
161
|
+
jsi::ArrayBuffer arrayBuffer = runtime.global()
|
|
162
|
+
.getPropertyAsFunction(runtime, "ArrayBuffer")
|
|
163
|
+
.callAsConstructor(runtime, (double)length)
|
|
164
|
+
.getObject(runtime)
|
|
165
|
+
.getArrayBuffer(runtime);
|
|
166
|
+
|
|
167
|
+
memcpy(arrayBuffer.data(runtime), bytes, length);
|
|
168
|
+
|
|
169
|
+
return arrayBuffer;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
Promise::Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject)
|
|
173
|
+
: runtime_(rt), resolve_(std::move(resolve)), reject_(std::move(reject)) {}
|
|
174
|
+
|
|
175
|
+
void Promise::resolve(const jsi::Value &result) {
|
|
176
|
+
resolve_.call(runtime_, result);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
void Promise::reject(const std::string &message) {
|
|
180
|
+
jsi::Object error(runtime_);
|
|
181
|
+
error.setProperty(
|
|
182
|
+
runtime_, "message", jsi::String::createFromUtf8(runtime_, message));
|
|
183
|
+
reject_.call(runtime_, error);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
jsi::Value createPromiseAsJSIValue(
|
|
187
|
+
jsi::Runtime &rt,
|
|
188
|
+
const PromiseSetupFunctionType func) {
|
|
189
|
+
jsi::Function JSPromise = rt.global().getPropertyAsFunction(rt, "Promise");
|
|
190
|
+
jsi::Function fn = jsi::Function::createFromHostFunction(
|
|
191
|
+
rt,
|
|
192
|
+
jsi::PropNameID::forAscii(rt, "fn"),
|
|
193
|
+
2,
|
|
194
|
+
[func](
|
|
195
|
+
jsi::Runtime &rt2,
|
|
196
|
+
const jsi::Value &thisVal,
|
|
197
|
+
const jsi::Value *args,
|
|
198
|
+
size_t count) {
|
|
199
|
+
jsi::Function resolve = args[0].getObject(rt2).getFunction(rt2);
|
|
200
|
+
jsi::Function reject = args[1].getObject(rt2).getFunction(rt2);
|
|
201
|
+
auto wrapper = std::make_shared<Promise>(
|
|
202
|
+
rt2, std::move(resolve), std::move(reject));
|
|
203
|
+
func(rt2, wrapper);
|
|
204
|
+
return jsi::Value::undefined();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return JSPromise.callAsConstructor(rt, fn);
|
|
208
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
#import <UIKit/UIKit.h>
|
|
6
|
-
|
|
7
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
-
|
|
9
|
-
@class DSCameraView;
|
|
10
|
-
|
|
11
|
-
@interface RNDynamsoftCameraView : UIView
|
|
12
|
-
|
|
13
|
-
@property (nonatomic, assign) NSArray<NSNumber *> *visibleLayerIds;
|
|
14
|
-
|
|
15
|
-
@property (nonatomic, assign) BOOL scanRegionMaskVisible;
|
|
16
|
-
|
|
17
|
-
@property (nonatomic, assign) BOOL scanLaserVisible;
|
|
18
|
-
|
|
19
|
-
@property (nonatomic, strong) NSDictionary *torchButton;
|
|
20
|
-
|
|
21
|
-
@property (nonatomic, assign) BOOL torchButtonVisible;
|
|
22
|
-
|
|
23
|
-
@property (nonatomic, strong) DSCameraView *cameraView;
|
|
24
|
-
|
|
25
|
-
@property (nonatomic, strong) NSDictionary *cameraToggleButton;
|
|
26
|
-
|
|
27
|
-
@property (nonatomic, assign) BOOL cameraToggleButtonVisible;
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
NS_ASSUME_NONNULL_END
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © Dynamsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#import <UIKit/UIKit.h>
|
|
6
|
+
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
|
|
9
|
+
@class DSCameraView;
|
|
10
|
+
|
|
11
|
+
@interface RNDynamsoftCameraView : UIView
|
|
12
|
+
|
|
13
|
+
@property (nonatomic, assign) NSArray<NSNumber *> *visibleLayerIds;
|
|
14
|
+
|
|
15
|
+
@property (nonatomic, assign) BOOL scanRegionMaskVisible;
|
|
16
|
+
|
|
17
|
+
@property (nonatomic, assign) BOOL scanLaserVisible;
|
|
18
|
+
|
|
19
|
+
@property (nonatomic, strong) NSDictionary *torchButton;
|
|
20
|
+
|
|
21
|
+
@property (nonatomic, assign) BOOL torchButtonVisible;
|
|
22
|
+
|
|
23
|
+
@property (nonatomic, strong) DSCameraView *cameraView;
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, strong) NSDictionary *cameraToggleButton;
|
|
26
|
+
|
|
27
|
+
@property (nonatomic, assign) BOOL cameraToggleButtonVisible;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
NS_ASSUME_NONNULL_END
|