dynamsoft-capture-vision-react-native 3.4.1300 → 3.4.3010
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 +4 -4
- package/README.md +62 -62
- 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/dysJniLibsFor86/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor86/release/x86_64/librn_dys.so +0 -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/src/dce/CameraView.tsx
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import React, {Component, ComponentProps, createElement} from 'react';
|
|
3
|
-
import {
|
|
4
|
-
findNodeHandle,
|
|
5
|
-
type HostComponent,
|
|
6
|
-
type NativeMethods,
|
|
7
|
-
requireNativeComponent,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
View
|
|
10
|
-
} from "react-native";
|
|
11
|
-
import type {CameraViewNativeProps} from "./DynamsoftCameraViewNativeComponent";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Transforms CameraViewNativeProps to a format compatible with the native CameraView component.
|
|
15
|
-
* This ensures only supported properties are passed to the native layer.
|
|
16
|
-
* @param props - The props for the {@link CameraView} component.
|
|
17
|
-
* @returns The transformed native props.
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
const transformToNativeCameraViewProps = (props: CameraViewNativeProps | undefined | null): CameraViewNativeProps => {
|
|
21
|
-
return JSON.parse(JSON.stringify(
|
|
22
|
-
{
|
|
23
|
-
visibleLayerIds: props?.visibleLayerIds,
|
|
24
|
-
scanRegionMaskVisible: props?.scanRegionMaskVisible,
|
|
25
|
-
scanLaserVisible: props?.scanLaserVisible,
|
|
26
|
-
torchButton: props?.torchButton,
|
|
27
|
-
torchButtonVisible: props?.torchButtonVisible,
|
|
28
|
-
cameraToggleButton: props?.cameraToggleButton,
|
|
29
|
-
cameraToggleButtonVisible: props?.cameraToggleButtonVisible,
|
|
30
|
-
}
|
|
31
|
-
)) as CameraViewNativeProps
|
|
32
|
-
}
|
|
33
|
-
type RefType = React.Component<CameraViewNativeProps> & Readonly<NativeMethods>;
|
|
34
|
-
|
|
35
|
-
// @ts-ignore Check whether __turboModuleProxy exists, it may not
|
|
36
|
-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
37
|
-
|
|
38
|
-
const ComponentName = 'DynamsoftCameraView';
|
|
39
|
-
const NativeCameraView: HostComponent<CameraViewNativeProps> = isTurboModuleEnabled?
|
|
40
|
-
require("./DynamsoftCameraViewNativeComponent").default :
|
|
41
|
-
requireNativeComponent(ComponentName)
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The CameraView class is a React Component that wraps the native CameraView, which is used to display the camera preview.
|
|
45
|
-
* Users can add interactable UI elements on the view.
|
|
46
|
-
* You can view {@link CameraViewNativeProps} to know what custom properties you can define.
|
|
47
|
-
* Only available when CameraView is bound on CameraEnhancer by {@link CameraEnhancer.setCameraView} .
|
|
48
|
-
* @prop {@link CameraViewNativeProps}
|
|
49
|
-
* @see {@link CameraViewNativeProps}
|
|
50
|
-
* @see {@link CameraEnhancer.setCameraView}
|
|
51
|
-
*/
|
|
52
|
-
export class CameraView extends Component<CameraViewNativeProps, any> {
|
|
53
|
-
private readonly nativeCameraViewRef: React.RefObject<RefType | null> = React.createRef<RefType>();
|
|
54
|
-
private readonly nativeProps = transformToNativeCameraViewProps(this.props)
|
|
55
|
-
|
|
56
|
-
/** @internal */
|
|
57
|
-
public get nativeCameraViewHandle(): number | null {
|
|
58
|
-
return findNodeHandle(this.nativeCameraViewRef.current);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
componentDidMount() {
|
|
62
|
-
if(this.nativeProps.torchButton?.visible !== undefined) {
|
|
63
|
-
console.warn("The `torchButton.visible` property of CameraView has been deprecated, please use the `torchButtonVisible` property of CameraView")
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
componentDidUpdate(prevProps: CameraViewNativeProps) {
|
|
68
|
-
let nativePreProps = transformToNativeCameraViewProps(prevProps)
|
|
69
|
-
let nativeProps = transformToNativeCameraViewProps(this.props)
|
|
70
|
-
if(nativePreProps !== nativeProps) {
|
|
71
|
-
this.nativeCameraViewRef.current?.setNativeProps(nativeProps)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public render(): React.ReactNode {
|
|
76
|
-
return(
|
|
77
|
-
<View style={[styles.blackBg, this.props?.style]}>
|
|
78
|
-
<NativeCameraView
|
|
79
|
-
style={StyleSheet.absoluteFill}
|
|
80
|
-
ref={this.nativeCameraViewRef}
|
|
81
|
-
{...this.nativeProps}
|
|
82
|
-
/>
|
|
83
|
-
|
|
84
|
-
{this.props?.children}
|
|
85
|
-
</View>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const styles = StyleSheet.create({
|
|
92
|
-
container: {
|
|
93
|
-
flex: 1,
|
|
94
|
-
alignItems: 'center',
|
|
95
|
-
justifyContent: 'center',
|
|
96
|
-
},
|
|
97
|
-
blackBg: {
|
|
98
|
-
backgroundColor: 'black',
|
|
99
|
-
},
|
|
100
|
-
});
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React, {Component, ComponentProps, createElement} from 'react';
|
|
3
|
+
import {
|
|
4
|
+
findNodeHandle,
|
|
5
|
+
type HostComponent,
|
|
6
|
+
type NativeMethods,
|
|
7
|
+
requireNativeComponent,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
View
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import type {CameraViewNativeProps} from "./DynamsoftCameraViewNativeComponent";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Transforms CameraViewNativeProps to a format compatible with the native CameraView component.
|
|
15
|
+
* This ensures only supported properties are passed to the native layer.
|
|
16
|
+
* @param props - The props for the {@link CameraView} component.
|
|
17
|
+
* @returns The transformed native props.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
const transformToNativeCameraViewProps = (props: CameraViewNativeProps | undefined | null): CameraViewNativeProps => {
|
|
21
|
+
return JSON.parse(JSON.stringify(
|
|
22
|
+
{
|
|
23
|
+
visibleLayerIds: props?.visibleLayerIds,
|
|
24
|
+
scanRegionMaskVisible: props?.scanRegionMaskVisible,
|
|
25
|
+
scanLaserVisible: props?.scanLaserVisible,
|
|
26
|
+
torchButton: props?.torchButton,
|
|
27
|
+
torchButtonVisible: props?.torchButtonVisible,
|
|
28
|
+
cameraToggleButton: props?.cameraToggleButton,
|
|
29
|
+
cameraToggleButtonVisible: props?.cameraToggleButtonVisible,
|
|
30
|
+
}
|
|
31
|
+
)) as CameraViewNativeProps
|
|
32
|
+
}
|
|
33
|
+
type RefType = React.Component<CameraViewNativeProps> & Readonly<NativeMethods>;
|
|
34
|
+
|
|
35
|
+
// @ts-ignore Check whether __turboModuleProxy exists, it may not
|
|
36
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
37
|
+
|
|
38
|
+
const ComponentName = 'DynamsoftCameraView';
|
|
39
|
+
const NativeCameraView: HostComponent<CameraViewNativeProps> = isTurboModuleEnabled?
|
|
40
|
+
require("./DynamsoftCameraViewNativeComponent").default :
|
|
41
|
+
requireNativeComponent(ComponentName)
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The CameraView class is a React Component that wraps the native CameraView, which is used to display the camera preview.
|
|
45
|
+
* Users can add interactable UI elements on the view.
|
|
46
|
+
* You can view {@link CameraViewNativeProps} to know what custom properties you can define.
|
|
47
|
+
* Only available when CameraView is bound on CameraEnhancer by {@link CameraEnhancer.setCameraView} .
|
|
48
|
+
* @prop {@link CameraViewNativeProps}
|
|
49
|
+
* @see {@link CameraViewNativeProps}
|
|
50
|
+
* @see {@link CameraEnhancer.setCameraView}
|
|
51
|
+
*/
|
|
52
|
+
export class CameraView extends Component<CameraViewNativeProps, any> {
|
|
53
|
+
private readonly nativeCameraViewRef: React.RefObject<RefType | null> = React.createRef<RefType>();
|
|
54
|
+
private readonly nativeProps = transformToNativeCameraViewProps(this.props)
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
public get nativeCameraViewHandle(): number | null {
|
|
58
|
+
return findNodeHandle(this.nativeCameraViewRef.current);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
componentDidMount() {
|
|
62
|
+
if(this.nativeProps.torchButton?.visible !== undefined) {
|
|
63
|
+
console.warn("The `torchButton.visible` property of CameraView has been deprecated, please use the `torchButtonVisible` property of CameraView")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
componentDidUpdate(prevProps: CameraViewNativeProps) {
|
|
68
|
+
let nativePreProps = transformToNativeCameraViewProps(prevProps)
|
|
69
|
+
let nativeProps = transformToNativeCameraViewProps(this.props)
|
|
70
|
+
if(nativePreProps !== nativeProps) {
|
|
71
|
+
this.nativeCameraViewRef.current?.setNativeProps(nativeProps)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public render(): React.ReactNode {
|
|
76
|
+
return(
|
|
77
|
+
<View style={[styles.blackBg, this.props?.style]}>
|
|
78
|
+
<NativeCameraView
|
|
79
|
+
style={StyleSheet.absoluteFill}
|
|
80
|
+
ref={this.nativeCameraViewRef}
|
|
81
|
+
{...this.nativeProps}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
{this.props?.children}
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
const styles = StyleSheet.create({
|
|
92
|
+
container: {
|
|
93
|
+
flex: 1,
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
},
|
|
97
|
+
blackBg: {
|
|
98
|
+
backgroundColor: 'black',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import type {HostComponent, ViewProps} from "react-native";
|
|
2
|
-
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
3
|
-
import type {Int32} from "react-native/Libraries/Types/CodegenTypes";
|
|
4
|
-
import type {DecodedBarcodesResult} from "../dbr";
|
|
5
|
-
import type {RecognizedTextLinesResult} from "../dlr";
|
|
6
|
-
import type {ProcessedDocumentResult} from "../ddn";
|
|
7
|
-
|
|
8
|
-
export interface CameraViewNativeProps extends ViewProps {
|
|
9
|
-
/**
|
|
10
|
-
* CameraView has three default drawing layers corresponding to
|
|
11
|
-
* {@link EnumDrawingLayerId.DBR_LAYER_ID}/{@link EnumDrawingLayerId.DLR_LAYER_ID}/{@link EnumDrawingLayerId.DDN_LAYER_ID},
|
|
12
|
-
* they will draw the corresponding {@link DecodedBarcodesResult}/{@link RecognizedTextLinesResult}/{@link ProcessedDocumentResult} on the camera preview.
|
|
13
|
-
* If visibleLayerIds is undefined, all layer will be visible.
|
|
14
|
-
* If defined, only the DrawingLayer corresponding to the layerId in the array will be visible.
|
|
15
|
-
*
|
|
16
|
-
* @see {@link EnumDrawingLayerId}
|
|
17
|
-
* */
|
|
18
|
-
visibleLayerIds?: number[]
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Set the visibility of the scan region mask.
|
|
22
|
-
* Only available when set a scan region to CameraEnhancer.
|
|
23
|
-
* Default is true.
|
|
24
|
-
* */
|
|
25
|
-
scanRegionMaskVisible?: boolean
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Set the visibility of the scan laser.
|
|
29
|
-
* Only available when set a scan region to CameraEnhancer.
|
|
30
|
-
* Default is false.
|
|
31
|
-
* */
|
|
32
|
-
scanLaserVisible?: boolean
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Add a torch button that can control the torch on your view.
|
|
36
|
-
* If you are using enhanced feature - {@link EnumEnhancedFeatures.EF_SMART_TORCH},
|
|
37
|
-
* the style of this torch button will be applied to the smart torch as well.
|
|
38
|
-
* */
|
|
39
|
-
torchButton?: {
|
|
40
|
-
/**
|
|
41
|
-
* Set the top-left point and width and height of the torch button.(All by px)
|
|
42
|
-
* */
|
|
43
|
-
location?: {
|
|
44
|
-
x?: Int32;
|
|
45
|
-
y?: Int32;
|
|
46
|
-
width?: Int32;
|
|
47
|
-
height?: Int32;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Set the visibility of the torch button. Default is false.
|
|
51
|
-
* */
|
|
52
|
-
visible?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* The torch button image that you want to display when the torch is on.
|
|
55
|
-
* */
|
|
56
|
-
torchOnImageBase64?: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The torch button image that you want to display when the torch is off.
|
|
60
|
-
* */
|
|
61
|
-
torchOffImageBase64?: string;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Set the visibility of the torch button. Default is false.
|
|
65
|
-
* */
|
|
66
|
-
torchButtonVisible?: boolean
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Add a camera toggle button that can switch camera position on your view.
|
|
70
|
-
* */
|
|
71
|
-
cameraToggleButton?: {
|
|
72
|
-
/**
|
|
73
|
-
* Set the top-left point and width and height of the camera toggle button.(All by px)
|
|
74
|
-
* */
|
|
75
|
-
location?: {
|
|
76
|
-
x?: Int32;
|
|
77
|
-
y?: Int32;
|
|
78
|
-
width?: Int32;
|
|
79
|
-
height?: Int32;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* The camera toggle button image.
|
|
84
|
-
* */
|
|
85
|
-
cameraToggleImageBase64?: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Set the visibility of the camera toggle button. Default is false.
|
|
90
|
-
* */
|
|
91
|
-
cameraToggleButtonVisible?: boolean
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export default codegenNativeComponent<CameraViewNativeProps>(
|
|
95
|
-
"DynamsoftCameraView"
|
|
96
|
-
) as HostComponent<CameraViewNativeProps>;
|
|
1
|
+
import type {HostComponent, ViewProps} from "react-native";
|
|
2
|
+
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
3
|
+
import type {Int32} from "react-native/Libraries/Types/CodegenTypes";
|
|
4
|
+
import type {DecodedBarcodesResult} from "../dbr";
|
|
5
|
+
import type {RecognizedTextLinesResult} from "../dlr";
|
|
6
|
+
import type {ProcessedDocumentResult} from "../ddn";
|
|
7
|
+
|
|
8
|
+
export interface CameraViewNativeProps extends ViewProps {
|
|
9
|
+
/**
|
|
10
|
+
* CameraView has three default drawing layers corresponding to
|
|
11
|
+
* {@link EnumDrawingLayerId.DBR_LAYER_ID}/{@link EnumDrawingLayerId.DLR_LAYER_ID}/{@link EnumDrawingLayerId.DDN_LAYER_ID},
|
|
12
|
+
* they will draw the corresponding {@link DecodedBarcodesResult}/{@link RecognizedTextLinesResult}/{@link ProcessedDocumentResult} on the camera preview.
|
|
13
|
+
* If visibleLayerIds is undefined, all layer will be visible.
|
|
14
|
+
* If defined, only the DrawingLayer corresponding to the layerId in the array will be visible.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link EnumDrawingLayerId}
|
|
17
|
+
* */
|
|
18
|
+
visibleLayerIds?: number[]
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Set the visibility of the scan region mask.
|
|
22
|
+
* Only available when set a scan region to CameraEnhancer.
|
|
23
|
+
* Default is true.
|
|
24
|
+
* */
|
|
25
|
+
scanRegionMaskVisible?: boolean
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set the visibility of the scan laser.
|
|
29
|
+
* Only available when set a scan region to CameraEnhancer.
|
|
30
|
+
* Default is false.
|
|
31
|
+
* */
|
|
32
|
+
scanLaserVisible?: boolean
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Add a torch button that can control the torch on your view.
|
|
36
|
+
* If you are using enhanced feature - {@link EnumEnhancedFeatures.EF_SMART_TORCH},
|
|
37
|
+
* the style of this torch button will be applied to the smart torch as well.
|
|
38
|
+
* */
|
|
39
|
+
torchButton?: {
|
|
40
|
+
/**
|
|
41
|
+
* Set the top-left point and width and height of the torch button.(All by px)
|
|
42
|
+
* */
|
|
43
|
+
location?: {
|
|
44
|
+
x?: Int32;
|
|
45
|
+
y?: Int32;
|
|
46
|
+
width?: Int32;
|
|
47
|
+
height?: Int32;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Set the visibility of the torch button. Default is false.
|
|
51
|
+
* */
|
|
52
|
+
visible?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The torch button image that you want to display when the torch is on.
|
|
55
|
+
* */
|
|
56
|
+
torchOnImageBase64?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The torch button image that you want to display when the torch is off.
|
|
60
|
+
* */
|
|
61
|
+
torchOffImageBase64?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Set the visibility of the torch button. Default is false.
|
|
65
|
+
* */
|
|
66
|
+
torchButtonVisible?: boolean
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Add a camera toggle button that can switch camera position on your view.
|
|
70
|
+
* */
|
|
71
|
+
cameraToggleButton?: {
|
|
72
|
+
/**
|
|
73
|
+
* Set the top-left point and width and height of the camera toggle button.(All by px)
|
|
74
|
+
* */
|
|
75
|
+
location?: {
|
|
76
|
+
x?: Int32;
|
|
77
|
+
y?: Int32;
|
|
78
|
+
width?: Int32;
|
|
79
|
+
height?: Int32;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The camera toggle button image.
|
|
84
|
+
* */
|
|
85
|
+
cameraToggleImageBase64?: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Set the visibility of the camera toggle button. Default is false.
|
|
90
|
+
* */
|
|
91
|
+
cameraToggleButtonVisible?: boolean
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default codegenNativeComponent<CameraViewNativeProps>(
|
|
95
|
+
"DynamsoftCameraView"
|
|
96
|
+
) as HostComponent<CameraViewNativeProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {HostComponent, ViewProps} from "react-native";
|
|
2
|
-
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
3
|
-
|
|
4
|
-
export interface ImageEditorViewNativeProps extends ViewProps {
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default codegenNativeComponent<ImageEditorViewNativeProps>(
|
|
8
|
-
"DynamsoftImageEditorView"
|
|
9
|
-
) as HostComponent<ImageEditorViewNativeProps>;
|
|
1
|
+
import type {HostComponent, ViewProps} from "react-native";
|
|
2
|
+
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
3
|
+
|
|
4
|
+
export interface ImageEditorViewNativeProps extends ViewProps {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default codegenNativeComponent<ImageEditorViewNativeProps>(
|
|
8
|
+
"DynamsoftImageEditorView"
|
|
9
|
+
) as HostComponent<ImageEditorViewNativeProps>;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @see {@link CameraEnhancer.selectCamera}
|
|
3
|
-
* */
|
|
4
|
-
export enum EnumCameraPosition {
|
|
5
|
-
/**
|
|
6
|
-
* Use the back-facing camera.
|
|
7
|
-
*/
|
|
8
|
-
CP_BACK,
|
|
9
|
-
/**
|
|
10
|
-
* Use the front-facing camera.
|
|
11
|
-
*/
|
|
12
|
-
CP_FRONT,
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Use the ultra-wide back-facing camera.
|
|
16
|
-
* @note iOS only. This option is not available on other platforms.
|
|
17
|
-
*/
|
|
18
|
-
CP_BACK_ULTRA_WIDE,
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Use the ultra-wide back-facing camera.
|
|
22
|
-
* @note iOS only. This option is not available on other platforms.
|
|
23
|
-
*/
|
|
24
|
-
CP_BACK_DUAL_WIDE_AUTO,
|
|
25
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link CameraEnhancer.selectCamera}
|
|
3
|
+
* */
|
|
4
|
+
export enum EnumCameraPosition {
|
|
5
|
+
/**
|
|
6
|
+
* Use the back-facing camera.
|
|
7
|
+
*/
|
|
8
|
+
CP_BACK,
|
|
9
|
+
/**
|
|
10
|
+
* Use the front-facing camera.
|
|
11
|
+
*/
|
|
12
|
+
CP_FRONT,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Use the ultra-wide back-facing camera.
|
|
16
|
+
* @note iOS only. This option is not available on other platforms.
|
|
17
|
+
*/
|
|
18
|
+
CP_BACK_ULTRA_WIDE,
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Use the ultra-wide back-facing camera.
|
|
22
|
+
* @note iOS only. This option is not available on other platforms.
|
|
23
|
+
*/
|
|
24
|
+
CP_BACK_DUAL_WIDE_AUTO,
|
|
25
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export enum EnumDrawingLayerId {
|
|
2
|
-
/**
|
|
3
|
-
* The preset DrawingLayer of Dynamsoft Document Normalizer.
|
|
4
|
-
* */
|
|
5
|
-
DDN_LAYER_ID = 1,
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The preset DrawingLayer of Dynamsoft Barcode Reader.
|
|
9
|
-
* */
|
|
10
|
-
DBR_LAYER_ID = 2,
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The preset DrawingLayer of Dynamsoft Label Recognizer.
|
|
14
|
-
* */
|
|
15
|
-
DLR_LAYER_ID = 3,
|
|
16
|
-
TIP_LAYER_ID = 999
|
|
17
|
-
}
|
|
1
|
+
export enum EnumDrawingLayerId {
|
|
2
|
+
/**
|
|
3
|
+
* The preset DrawingLayer of Dynamsoft Document Normalizer.
|
|
4
|
+
* */
|
|
5
|
+
DDN_LAYER_ID = 1,
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The preset DrawingLayer of Dynamsoft Barcode Reader.
|
|
9
|
+
* */
|
|
10
|
+
DBR_LAYER_ID = 2,
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The preset DrawingLayer of Dynamsoft Label Recognizer.
|
|
14
|
+
* */
|
|
15
|
+
DLR_LAYER_ID = 3,
|
|
16
|
+
TIP_LAYER_ID = 999
|
|
17
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enumeration EnhancedFeatures indicates the advanced features of Dynamsoft Camera Enhancer.
|
|
3
|
-
* */
|
|
4
|
-
export enum EnumEnhancedFeatures {
|
|
5
|
-
/**
|
|
6
|
-
* `Frame Filter`: The frame sharpness filter feature of DCE. By enabling this feature, the low-quality frame will be recognized and discarded automatically.
|
|
7
|
-
* */
|
|
8
|
-
EF_FRAME_FILTER = 1,
|
|
9
|
-
|
|
10
|
-
/**`Sensor Control`: The sensor filter feature of DCE. By enabling this feature, the frames will be discarded automatically while the device is shaking.*/
|
|
11
|
-
EF_SENSOR_CONTROL = 2,
|
|
12
|
-
|
|
13
|
-
/**`Enhanced Focus`: The enhanced focus feature. DCE will support the camera in triggering auto-focus.*/
|
|
14
|
-
EF_ENHANCED_FOCUS = 4,
|
|
15
|
-
|
|
16
|
-
/**`Auto Zoom`: The auto-zoom feature of DCE. By enabling this feature, the camera will automatically zoom in to the interest area.*/
|
|
17
|
-
EF_AUTO_ZOOM = 8,
|
|
18
|
-
|
|
19
|
-
/**`Smart Torch`: Add a smart torch on the UI. The torch will be hided when the environment brightness is high and displayed when the brightness is low.*/
|
|
20
|
-
EF_SMART_TORCH = 16,
|
|
21
|
-
|
|
22
|
-
/**Enable all.*/
|
|
23
|
-
EF_ALL = 31
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration EnhancedFeatures indicates the advanced features of Dynamsoft Camera Enhancer.
|
|
3
|
+
* */
|
|
4
|
+
export enum EnumEnhancedFeatures {
|
|
5
|
+
/**
|
|
6
|
+
* `Frame Filter`: The frame sharpness filter feature of DCE. By enabling this feature, the low-quality frame will be recognized and discarded automatically.
|
|
7
|
+
* */
|
|
8
|
+
EF_FRAME_FILTER = 1,
|
|
9
|
+
|
|
10
|
+
/**`Sensor Control`: The sensor filter feature of DCE. By enabling this feature, the frames will be discarded automatically while the device is shaking.*/
|
|
11
|
+
EF_SENSOR_CONTROL = 2,
|
|
12
|
+
|
|
13
|
+
/**`Enhanced Focus`: The enhanced focus feature. DCE will support the camera in triggering auto-focus.*/
|
|
14
|
+
EF_ENHANCED_FOCUS = 4,
|
|
15
|
+
|
|
16
|
+
/**`Auto Zoom`: The auto-zoom feature of DCE. By enabling this feature, the camera will automatically zoom in to the interest area.*/
|
|
17
|
+
EF_AUTO_ZOOM = 8,
|
|
18
|
+
|
|
19
|
+
/**`Smart Torch`: Add a smart torch on the UI. The torch will be hided when the environment brightness is high and displayed when the brightness is low.*/
|
|
20
|
+
EF_SMART_TORCH = 16,
|
|
21
|
+
|
|
22
|
+
/**Enable all.*/
|
|
23
|
+
EF_ALL = 31
|
|
24
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export enum EnumFocusMode {
|
|
2
|
-
/**Lock the focal length.*/
|
|
3
|
-
FM_LOCKED = 1,
|
|
4
|
-
/**Keep continuous auto-focus.*/
|
|
5
|
-
FM_CONTINUOUS_AUTO = 2
|
|
6
|
-
}
|
|
1
|
+
export enum EnumFocusMode {
|
|
2
|
+
/**Lock the focal length.*/
|
|
3
|
+
FM_LOCKED = 1,
|
|
4
|
+
/**Keep continuous auto-focus.*/
|
|
5
|
+
FM_CONTINUOUS_AUTO = 2
|
|
6
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export enum EnumResolution {
|
|
2
|
-
RESOLUTION_AUTO = 0,
|
|
3
|
-
RESOLUTION_480P = 1,
|
|
4
|
-
RESOLUTION_720P = 2,
|
|
5
|
-
Resolution1080P = 3,
|
|
6
|
-
RESOLUTION_4K = 4,
|
|
7
|
-
RESOLUTION_MAX = 5,
|
|
8
|
-
}
|
|
1
|
+
export enum EnumResolution {
|
|
2
|
+
RESOLUTION_AUTO = 0,
|
|
3
|
+
RESOLUTION_480P = 1,
|
|
4
|
+
RESOLUTION_720P = 2,
|
|
5
|
+
Resolution1080P = 3,
|
|
6
|
+
RESOLUTION_4K = 4,
|
|
7
|
+
RESOLUTION_MAX = 5,
|
|
8
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export enum EnumTorchState {
|
|
2
|
-
/**
|
|
3
|
-
* Set the torch state to off.
|
|
4
|
-
*/
|
|
5
|
-
OFF,
|
|
6
|
-
/**
|
|
7
|
-
* Set the torch state to on.
|
|
8
|
-
*/
|
|
9
|
-
ON
|
|
10
|
-
}
|
|
1
|
+
export enum EnumTorchState {
|
|
2
|
+
/**
|
|
3
|
+
* Set the torch state to off.
|
|
4
|
+
*/
|
|
5
|
+
OFF,
|
|
6
|
+
/**
|
|
7
|
+
* Set the torch state to on.
|
|
8
|
+
*/
|
|
9
|
+
ON
|
|
10
|
+
}
|
package/src/dce/FeedBack.tsx
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {NativeModules} from "react-native";
|
|
2
|
-
|
|
3
|
-
// @ts-ignore Check whether __turboModuleProxy exists, it may not
|
|
4
|
-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
5
|
-
|
|
6
|
-
const DynamsoftCameraEnhancerModule = isTurboModuleEnabled ?
|
|
7
|
-
require("./NativeDynamsoftCameraViewModule").default :
|
|
8
|
-
NativeModules.DynamsoftCameraView;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The Feedback class provides methods to trigger feedbacks from the hardware, such as vibrate and beep.
|
|
12
|
-
* @hideconstructor
|
|
13
|
-
* */
|
|
14
|
-
export class FeedBack {
|
|
15
|
-
/**
|
|
16
|
-
* Trigger a beep.
|
|
17
|
-
* */
|
|
18
|
-
static beep(): void {
|
|
19
|
-
DynamsoftCameraEnhancerModule.beep();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Trigger a vibrate.
|
|
24
|
-
* */
|
|
25
|
-
static vibrate(): void {
|
|
26
|
-
DynamsoftCameraEnhancerModule.vibrate();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import {NativeModules} from "react-native";
|
|
2
|
+
|
|
3
|
+
// @ts-ignore Check whether __turboModuleProxy exists, it may not
|
|
4
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
5
|
+
|
|
6
|
+
const DynamsoftCameraEnhancerModule = isTurboModuleEnabled ?
|
|
7
|
+
require("./NativeDynamsoftCameraViewModule").default :
|
|
8
|
+
NativeModules.DynamsoftCameraView;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The Feedback class provides methods to trigger feedbacks from the hardware, such as vibrate and beep.
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
* */
|
|
14
|
+
export class FeedBack {
|
|
15
|
+
/**
|
|
16
|
+
* Trigger a beep.
|
|
17
|
+
* */
|
|
18
|
+
static beep(): void {
|
|
19
|
+
DynamsoftCameraEnhancerModule.beep();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Trigger a vibrate.
|
|
24
|
+
* */
|
|
25
|
+
static vibrate(): void {
|
|
26
|
+
DynamsoftCameraEnhancerModule.vibrate();
|
|
27
|
+
}
|
|
28
|
+
}
|