react-native-scanbot-barcode-scanner-sdk 4.2.0 → 4.3.0-beta.1
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/Libraries.txt +31 -31
- package/RNScanbotBarcodeSDK.podspec +1 -4
- package/android/build.gradle +6 -5
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPackage.kt +9 -7
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerView.kt +114 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +56 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +256 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/JSONObject.kt +18 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt +3 -4
- package/android/src/newarch/ScanbotBarcodeScannerViewManagerSpec.kt +19 -0
- package/android/src/oldarch/ScanbotBarcodeScannerViewManagerSpec.kt +29 -0
- package/dist/components/barcode-camera-view/ScanbotBarcodeCameraView.d.ts +3 -0
- package/dist/components/barcode-camera-view/ScanbotBarcodeCameraView.js +122 -0
- package/dist/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +89 -0
- package/dist/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.js +2 -0
- package/dist/components/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +54 -0
- package/dist/components/spec/ScanbotBarcodeScannerViewNativeComponent.js +12 -0
- package/dist/configurations.d.ts +241 -0
- package/dist/configurations.js +2 -0
- package/dist/customConfigurations.d.ts +94 -0
- package/dist/customConfigurations.js +2 -0
- package/dist/customResults.d.ts +5 -0
- package/dist/customResults.js +2 -0
- package/dist/customTypes.d.ts +7 -0
- package/dist/customTypes.js +2 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +34 -0
- package/dist/results.d.ts +29 -0
- package/dist/results.js +2 -0
- package/dist/types.d.ts +1194 -0
- package/dist/types.js +2 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.h +25 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +194 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.h +20 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +259 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +99 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +196 -0
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewManager.mm +73 -0
- package/package.json +16 -21
- package/src/components/barcode-camera-view/ScanbotBarcodeCameraView.tsx +112 -0
- package/src/components/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +106 -0
- package/src/components/spec/ScanbotBarcodeScannerViewNativeComponent.ts +59 -0
- package/src/index.ts +58 -0
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraView.java +0 -401
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventEmitter.java +0 -78
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/communication/ScanbotEventReceiver.java +0 -119
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/base/ui/ScanbotViewWrapper.java +0 -26
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/JSONUtils.kt +0 -24
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/utils/ScanbotViewUtils.java +0 -43
- package/android/src/new-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -125
- package/android/src/old-architecture/io/scanbot/barcodesdk/plugin/reactnative/components/barcodecameraview/ScanbotBarcodeCameraViewManager.java +0 -114
- package/index.d.ts +0 -42
- package/index.js +0 -20
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.h +0 -44
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraView.mm +0 -338
- package/ios/Components/BarcodeCameraView/NewArchitecture/RTNScanbotBarcodeCameraViewManager.mm +0 -71
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.h +0 -36
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraView.mm +0 -181
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.h +0 -28
- package/ios/Components/BarcodeCameraView/OldArchitecture/RNScanbotBarcodeCameraViewManager.mm +0 -89
- package/js/RTNScanbotBarcodeCameraViewNativeComponent.ts +0 -186
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view-types.ts +0 -175
- package/src/components/barcode-camera-view/scanbot-barcode-camera-view.tsx +0 -270
- package/src/components/barcode-camera-view/scanbot-native-barcode-camera-view.ts +0 -7
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
package io.scanbot.barcodesdk.plugin.reactnative.components.barcode_scanner_view
|
|
2
|
+
|
|
3
|
+
import android.content.res.Resources
|
|
4
|
+
import com.facebook.react.bridge.ReadableArray
|
|
5
|
+
import com.facebook.react.bridge.ReadableMap
|
|
6
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
9
|
+
import io.scanbot.barcodesdk.plugin.reactnative.ScanbotBarcodeScannerViewManagerSpec
|
|
10
|
+
import io.scanbot.barcodesdk.plugin.reactnative.extensions.toJSON
|
|
11
|
+
import io.scanbot.sdk.AspectRatio
|
|
12
|
+
import io.scanbot.sdk.barcode.BarcodeEanUpcNoExtensionsFilter
|
|
13
|
+
import io.scanbot.sdk.barcode.BarcodeExtensionsFilter
|
|
14
|
+
import io.scanbot.sdk.barcode.entity.BarcodeDensity
|
|
15
|
+
import io.scanbot.sdk.barcode.entity.BarcodeDocumentFormat
|
|
16
|
+
import io.scanbot.sdk.barcode.entity.BarcodeFormat
|
|
17
|
+
import io.scanbot.sdk.barcode.entity.EngineMode
|
|
18
|
+
import io.scanbot.sdk.barcode.entity.Gs1Handling
|
|
19
|
+
import io.scanbot.sdk.barcode.entity.MSIPlesseyChecksumAlgorithm
|
|
20
|
+
import io.scanbot.sdk.camera.CameraModule
|
|
21
|
+
import io.scanbot.sdk.camera.ZoomRange
|
|
22
|
+
import io.scanbot.sdk.ui.configuration.json.JsonBarcodesExtensionFilter
|
|
23
|
+
import io.scanbot.sdk_wrapper.SBWrapper.gson
|
|
24
|
+
import java.util.EnumSet
|
|
25
|
+
import kotlin.math.floor
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@ReactModule(name = ScanbotBarcodeScannerViewManager.NAME)
|
|
29
|
+
class ScanbotBarcodeScannerViewManager :
|
|
30
|
+
ScanbotBarcodeScannerViewManagerSpec<ScanbotBarcodeScannerView>() {
|
|
31
|
+
|
|
32
|
+
companion object {
|
|
33
|
+
const val NAME = "ScanbotBarcodeScannerView"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun getName(): String {
|
|
37
|
+
return NAME
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public override fun createViewInstance(context: ThemedReactContext): ScanbotBarcodeScannerView {
|
|
41
|
+
return ScanbotBarcodeScannerView(context)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any>? {
|
|
45
|
+
return mutableMapOf(
|
|
46
|
+
BarcodeScannerResultEvent.NAME to mapOf("registrationName" to "onBarcodeScannerResult")
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//region Commands
|
|
51
|
+
|
|
52
|
+
override fun unfreezeCamera(view: ScanbotBarcodeScannerView) {
|
|
53
|
+
view.barcodeScanner.viewController.startPreview()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override fun freezeCamera(view: ScanbotBarcodeScannerView) {
|
|
57
|
+
view.barcodeScanner.viewController.stopPreview()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun receiveCommand(
|
|
61
|
+
root: ScanbotBarcodeScannerView,
|
|
62
|
+
commandId: String?,
|
|
63
|
+
args: ReadableArray?
|
|
64
|
+
) {
|
|
65
|
+
when (commandId) {
|
|
66
|
+
"freezeCamera" -> freezeCamera(root)
|
|
67
|
+
"unfreezeCamera" -> unfreezeCamera(root)
|
|
68
|
+
else -> throw Error("Unrecognized command $commandId")
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//endregion
|
|
73
|
+
|
|
74
|
+
@ReactProp(name = "cameraModule")
|
|
75
|
+
override fun setCameraModule(view: ScanbotBarcodeScannerView, value: String?) {
|
|
76
|
+
value?.let {
|
|
77
|
+
view.barcodeScanner.cameraConfiguration.setCameraModule(
|
|
78
|
+
gson.fromJson(it, CameraModule::class.java)
|
|
79
|
+
)
|
|
80
|
+
view.barcodeScanner.viewController.restartPreview()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@ReactProp(name = "cameraZoomRange")
|
|
85
|
+
override fun setCameraZoomRange(view: ScanbotBarcodeScannerView, value: ReadableMap?) {
|
|
86
|
+
value?.let {
|
|
87
|
+
val zoomRange = gson.fromJson(
|
|
88
|
+
value.toJSON().toString(),
|
|
89
|
+
ZoomRangeConfig::class.java
|
|
90
|
+
)
|
|
91
|
+
view.barcodeScanner.cameraConfiguration.setPhysicalZoomRange(
|
|
92
|
+
ZoomRange(
|
|
93
|
+
maxZoomRatio = zoomRange.maxZoom,
|
|
94
|
+
minZoomRatio = zoomRange.minZoom,
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@ReactProp(name = "minFocusDistanceLock")
|
|
101
|
+
override fun setMinFocusDistanceLock(view: ScanbotBarcodeScannerView, value: Boolean) {
|
|
102
|
+
view.barcodeScanner.cameraConfiguration.lockMinFocusDistance(value)
|
|
103
|
+
view.barcodeScanner.viewController.restartPreview()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@ReactProp(name = "detectorConfig")
|
|
107
|
+
override fun setDetectorConfig(view: ScanbotBarcodeScannerView, value: ReadableMap?) {
|
|
108
|
+
value?.let {
|
|
109
|
+
val config = gson.fromJson(
|
|
110
|
+
value.toJSON().toString(),
|
|
111
|
+
DetectorConfig::class.java
|
|
112
|
+
)
|
|
113
|
+
view.barcodeDetector.modifyConfig {
|
|
114
|
+
config.barcodeFormats?.let { this.setBarcodeFormats(it) }
|
|
115
|
+
config.acceptedDocumentFormats?.let { this.setAcceptedDocumentFormats(it) }
|
|
116
|
+
config.engineMode?.let { this.setEngineMode(it) }
|
|
117
|
+
this.modifyAdditionalConfig {
|
|
118
|
+
config.lowPowerMode?.let { this.setLowPowerMode(it) }
|
|
119
|
+
config.codeDensity?.let { this.setCodeDensity(it) }
|
|
120
|
+
config.gs1HandlingMode?.let { this.setGs1HandlingMode(it) }
|
|
121
|
+
config.minimumTextLength?.let { this.setMinimumTextLength(it) }
|
|
122
|
+
config.maximumTextLength?.let { this.setMaximumTextLength(it) }
|
|
123
|
+
config.minimum1DBarcodesQuietZone?.let { this.setMinimum1DQuietZoneSize(it) }
|
|
124
|
+
config.stripCheckDigits?.let { this.setStripCheckDigits(true) }
|
|
125
|
+
config.msiPlesseyChecksumAlgorithm?.let {
|
|
126
|
+
this.setMsiPlesseyChecksumAlgorithms(
|
|
127
|
+
EnumSet.of(
|
|
128
|
+
it
|
|
129
|
+
)
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
config.barcodesExtensionFilter?.let {
|
|
136
|
+
view.barcodeScanner.viewController.setBarcodeFilter(
|
|
137
|
+
when (it) {
|
|
138
|
+
JsonBarcodesExtensionFilter.NO_FILTER -> null
|
|
139
|
+
JsonBarcodesExtensionFilter.ONLY_WITH_EXTENSIONS -> BarcodeExtensionsFilter()
|
|
140
|
+
JsonBarcodesExtensionFilter.ONLY_WITHOUT_EXTENSIONS -> BarcodeEanUpcNoExtensionsFilter()
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@ReactProp(name = "scanningEnabled")
|
|
149
|
+
override fun setScanningEnabled(view: ScanbotBarcodeScannerView, value: Boolean) {
|
|
150
|
+
view.barcodeDetector.enableBarcodeScan(value)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@ReactProp(name = "cameraZoomFactor")
|
|
154
|
+
override fun setCameraZoomFactor(view: ScanbotBarcodeScannerView, value: Float) {
|
|
155
|
+
view.barcodeScanner.cameraConfiguration.setPhysicalZoomRatio(value)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@ReactProp(name = "finderRequiredAspectRatios")
|
|
159
|
+
override fun setFinderRequiredAspectRatios(
|
|
160
|
+
view: ScanbotBarcodeScannerView,
|
|
161
|
+
value: ReadableMap?
|
|
162
|
+
) {
|
|
163
|
+
value?.let {
|
|
164
|
+
val aspectRatios = gson.fromJson<AspectRatio>(
|
|
165
|
+
value.toJSON().toString(),
|
|
166
|
+
AspectRatio::class.java
|
|
167
|
+
)
|
|
168
|
+
view.barcodeScanner.finderViewController.setRequiredAspectRatios(listOf(aspectRatios))
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@ReactProp(name = "finderInset")
|
|
173
|
+
override fun setFinderInset(view: ScanbotBarcodeScannerView, value: ReadableMap?) {
|
|
174
|
+
value?.let {
|
|
175
|
+
val insets = gson.fromJson(
|
|
176
|
+
value.toJSON().toString(),
|
|
177
|
+
FinderInsets::class.java
|
|
178
|
+
)
|
|
179
|
+
view.barcodeScanner.finderViewController.setFinderInset(
|
|
180
|
+
left = insets.left?.let { convertDpToPx(view.resources, it) },
|
|
181
|
+
right = insets.right?.let { convertDpToPx(view.resources, it) },
|
|
182
|
+
top = insets.top?.let { convertDpToPx(view.resources, it) },
|
|
183
|
+
bottom = insets.bottom?.let { convertDpToPx(view.resources, it) },
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@ReactProp(name = "flashEnabled")
|
|
189
|
+
override fun setFlashEnabled(view: ScanbotBarcodeScannerView, value: Boolean) {
|
|
190
|
+
view.flashState = value
|
|
191
|
+
view.barcodeScanner.viewController.useFlash(value)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@ReactProp(name = "finderEnabled")
|
|
195
|
+
override fun setFinderEnabled(view: ScanbotBarcodeScannerView, value: Boolean) {
|
|
196
|
+
view.barcodeScanner.finderViewController.setFinderEnabled(value)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@ReactProp(name = "finderStrokeWidth")
|
|
200
|
+
override fun setFinderStrokeWidth(view: ScanbotBarcodeScannerView, value: Int) {
|
|
201
|
+
view.barcodeScanner.finderViewController.setStrokeWidth(convertDpToPx(view.resources, value))
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@ReactProp(name = "finderStrokeColor", customType = "Color")
|
|
205
|
+
override fun setFinderStrokeColor(view: ScanbotBarcodeScannerView, value: Int?) {
|
|
206
|
+
value?.let {
|
|
207
|
+
view.barcodeScanner.finderViewController.setStrokeColor(it)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@ReactProp(name = "finderOverlayColor", customType = "Color")
|
|
212
|
+
override fun setFinderOverlayColor(view: ScanbotBarcodeScannerView, value: Int?) {
|
|
213
|
+
value?.let {
|
|
214
|
+
view.barcodeScanner.finderViewController.setOverlayColor(value)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@ReactProp(name = "finderMinPadding")
|
|
219
|
+
override fun setFinderMinPadding(view: ScanbotBarcodeScannerView, value: Int) {
|
|
220
|
+
view.barcodeScanner.finderViewController.setFinderMinPadding(value)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private fun convertDpToPx(resources: Resources, dp: Int): Int {
|
|
224
|
+
return floor((dp * resources.displayMetrics.density)).toInt()
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
data class DetectorConfig(
|
|
230
|
+
var barcodeFormats: List<BarcodeFormat>?,
|
|
231
|
+
var acceptedDocumentFormats: List<BarcodeDocumentFormat>?,
|
|
232
|
+
var engineMode: EngineMode?,
|
|
233
|
+
var barcodesExtensionFilter: JsonBarcodesExtensionFilter?,
|
|
234
|
+
// Additional Config
|
|
235
|
+
var lowPowerMode: Boolean?,
|
|
236
|
+
var minimumTextLength: Int?,
|
|
237
|
+
var maximumTextLength: Int?,
|
|
238
|
+
var minimum1DBarcodesQuietZone: Int?,
|
|
239
|
+
var stripCheckDigits: Boolean?,
|
|
240
|
+
var gs1HandlingMode: Gs1Handling?,
|
|
241
|
+
var msiPlesseyChecksumAlgorithm: MSIPlesseyChecksumAlgorithm?,
|
|
242
|
+
var codeDensity: BarcodeDensity?,
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
data class FinderInsets(
|
|
246
|
+
val left: Int?,
|
|
247
|
+
val right: Int?,
|
|
248
|
+
val top: Int?,
|
|
249
|
+
val bottom: Int?
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
data class ZoomRangeConfig(
|
|
253
|
+
val minZoom: Float,
|
|
254
|
+
val maxZoom: Float,
|
|
255
|
+
)
|
|
256
|
+
|
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/JSONObject.kt
CHANGED
|
@@ -33,16 +33,24 @@ fun JSONObject.toWritableMap(): WritableMap {
|
|
|
33
33
|
map.putInt(key, value)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
is Long -> {
|
|
37
|
+
map.putInt(key, value.toInt())
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
is Double -> {
|
|
37
41
|
map.putDouble(key, value)
|
|
38
42
|
}
|
|
39
43
|
|
|
44
|
+
is Float -> {
|
|
45
|
+
map.putDouble(key, value.toDouble())
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
is String -> {
|
|
41
49
|
map.putString(key, value)
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
else -> {
|
|
45
|
-
map.
|
|
53
|
+
map.putNull(key)
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
}
|
|
@@ -72,16 +80,24 @@ fun JSONArray.toWritableArray(): WritableArray {
|
|
|
72
80
|
array.pushInt(value)
|
|
73
81
|
}
|
|
74
82
|
|
|
83
|
+
is Long -> {
|
|
84
|
+
array.pushInt(value.toInt())
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
is Double -> {
|
|
76
88
|
array.pushDouble(value)
|
|
77
89
|
}
|
|
78
90
|
|
|
91
|
+
is Float -> {
|
|
92
|
+
array.pushDouble(value.toDouble())
|
|
93
|
+
}
|
|
94
|
+
|
|
79
95
|
is String -> {
|
|
80
96
|
array.pushString(value)
|
|
81
97
|
}
|
|
82
98
|
|
|
83
99
|
else -> {
|
|
84
|
-
array.
|
|
100
|
+
array.pushNull()
|
|
85
101
|
}
|
|
86
102
|
}
|
|
87
103
|
}
|
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/extensions/ReadableMap.kt
CHANGED
|
@@ -7,7 +7,6 @@ import org.json.JSONArray
|
|
|
7
7
|
import org.json.JSONException
|
|
8
8
|
import org.json.JSONObject
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
@Throws(JSONException::class)
|
|
12
11
|
fun ReadableMap.toJSON(): JSONObject {
|
|
13
12
|
val jsonResult = JSONObject()
|
|
@@ -24,7 +23,7 @@ fun ReadableMap.toJSON(): JSONObject {
|
|
|
24
23
|
ReadableType.Map -> jsonResult.put(key, this.getMap(key)?.toJSON())
|
|
25
24
|
ReadableType.Array -> jsonResult.put(key, this.getArray(key)?.toJSONArray())
|
|
26
25
|
ReadableType.Null -> {
|
|
27
|
-
|
|
26
|
+
jsonResult.put(key, JSONObject.NULL)
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -44,10 +43,10 @@ fun ReadableArray.toJSONArray(): JSONArray {
|
|
|
44
43
|
ReadableType.Map -> jsonResult.put(this.getMap(i).toJSON())
|
|
45
44
|
ReadableType.Array -> jsonResult.put(this.getArray(i).toJSONArray())
|
|
46
45
|
ReadableType.Null -> {
|
|
47
|
-
|
|
46
|
+
jsonResult.put(JSONObject.NULL)
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
return jsonResult
|
|
53
|
-
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package io.scanbot.barcodesdk.plugin.reactnative
|
|
2
|
+
|
|
3
|
+
import android.view.View
|
|
4
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
5
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
6
|
+
import com.facebook.react.viewmanagers.ScanbotBarcodeScannerViewManagerDelegate
|
|
7
|
+
import com.facebook.react.viewmanagers.ScanbotBarcodeScannerViewManagerInterface
|
|
8
|
+
|
|
9
|
+
abstract class ScanbotBarcodeScannerViewManagerSpec<T : View> : SimpleViewManager<T>(), ScanbotBarcodeScannerViewManagerInterface<T> {
|
|
10
|
+
private val mDelegate: ViewManagerDelegate<T>
|
|
11
|
+
|
|
12
|
+
init {
|
|
13
|
+
mDelegate = ScanbotBarcodeScannerViewManagerDelegate(this)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override fun getDelegate(): ViewManagerDelegate<T>? {
|
|
17
|
+
return mDelegate
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package io.scanbot.barcodesdk.plugin.reactnative
|
|
2
|
+
|
|
3
|
+
import android.view.View
|
|
4
|
+
import com.facebook.react.bridge.ReadableArray
|
|
5
|
+
import com.facebook.react.bridge.ReadableMap
|
|
6
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
7
|
+
import io.scanbot.barcodesdk.plugin.reactnative.components.barcode_scanner_view.ScanbotBarcodeScannerView
|
|
8
|
+
|
|
9
|
+
abstract class ScanbotBarcodeScannerViewManagerSpec<T : View> : SimpleViewManager<T>() {
|
|
10
|
+
abstract fun setCameraModule(view: ScanbotBarcodeScannerView, value: String?)
|
|
11
|
+
abstract fun setCameraZoomRange(view: ScanbotBarcodeScannerView, value: ReadableMap?)
|
|
12
|
+
abstract fun setMinFocusDistanceLock(view: ScanbotBarcodeScannerView, value: Boolean)
|
|
13
|
+
abstract fun setDetectorConfig(view: ScanbotBarcodeScannerView, value: ReadableMap?)
|
|
14
|
+
abstract fun setScanningEnabled(view: ScanbotBarcodeScannerView, value: Boolean)
|
|
15
|
+
abstract fun setCameraZoomFactor(view: ScanbotBarcodeScannerView, value: Float)
|
|
16
|
+
abstract fun setFinderRequiredAspectRatios(
|
|
17
|
+
view: ScanbotBarcodeScannerView,
|
|
18
|
+
value: ReadableMap?
|
|
19
|
+
)
|
|
20
|
+
abstract fun setFinderInset(view: ScanbotBarcodeScannerView, value: ReadableMap?)
|
|
21
|
+
abstract fun setFlashEnabled(view: ScanbotBarcodeScannerView, value: Boolean)
|
|
22
|
+
abstract fun setFinderEnabled(view: ScanbotBarcodeScannerView, value: Boolean)
|
|
23
|
+
abstract fun setFinderStrokeWidth(view: ScanbotBarcodeScannerView, value: Int)
|
|
24
|
+
abstract fun setFinderStrokeColor(view: ScanbotBarcodeScannerView, value: Int?)
|
|
25
|
+
abstract fun setFinderOverlayColor(view: ScanbotBarcodeScannerView, value: Int?)
|
|
26
|
+
abstract fun setFinderMinPadding(view: ScanbotBarcodeScannerView, value: Int)
|
|
27
|
+
abstract fun freezeCamera(view: ScanbotBarcodeScannerView)
|
|
28
|
+
abstract fun unfreezeCamera(view: ScanbotBarcodeScannerView)
|
|
29
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScanbotBarcodeCameraViewHandle, ScanbotBarcodeCameraViewProperties } from './ScanbotBarcodeCameraViewProperties';
|
|
3
|
+
export declare const ScanbotBarcodeCameraView: React.ForwardRefExoticComponent<ScanbotBarcodeCameraViewProperties & React.RefAttributes<ScanbotBarcodeCameraViewHandle>>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.ScanbotBarcodeCameraView = void 0;
|
|
49
|
+
var react_1 = __importStar(require("react"));
|
|
50
|
+
var ScanbotBarcodeScannerViewNativeComponent_1 = __importStar(require("../spec/ScanbotBarcodeScannerViewNativeComponent"));
|
|
51
|
+
var react_native_1 = require("react-native");
|
|
52
|
+
exports.ScanbotBarcodeCameraView = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
|
53
|
+
var _b = _a.flashEnabled, flashEnabled = _b === void 0 ? false : _b, _c = _a.scanningEnabled, scanningEnabled = _c === void 0 ? true : _c, props = __rest(_a, ["flashEnabled", "scanningEnabled"]);
|
|
54
|
+
var finderConfig = __assign({
|
|
55
|
+
viewFinderEnabled: true,
|
|
56
|
+
finderLineWidth: 2,
|
|
57
|
+
finderLineColor: '#ffffffff',
|
|
58
|
+
overlayColor: '#000000A9',
|
|
59
|
+
finderInset: {
|
|
60
|
+
bottom: 20,
|
|
61
|
+
top: 20,
|
|
62
|
+
left: 20,
|
|
63
|
+
right: 20,
|
|
64
|
+
},
|
|
65
|
+
requiredAspectRatio: {
|
|
66
|
+
height: 3,
|
|
67
|
+
width: 4,
|
|
68
|
+
},
|
|
69
|
+
minPadding: 60,
|
|
70
|
+
}, props.finderConfig);
|
|
71
|
+
var cameraConfig = __assign({
|
|
72
|
+
cameraZoomRange: {
|
|
73
|
+
minZoom: 1,
|
|
74
|
+
maxZoom: 12,
|
|
75
|
+
},
|
|
76
|
+
cameraZoomFactor: 0.0,
|
|
77
|
+
minFocusDistanceLock: false,
|
|
78
|
+
}, props.cameraConfig);
|
|
79
|
+
var viewRef = (0, react_1.useRef)(null);
|
|
80
|
+
(0, react_1.useImperativeHandle)(forwardedRef, function () {
|
|
81
|
+
return {
|
|
82
|
+
freezeCamera: function () {
|
|
83
|
+
if (viewRef.current) {
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
ScanbotBarcodeScannerViewNativeComponent_1.Commands.freezeCamera(viewRef.current);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
unfreezeCamera: function () {
|
|
89
|
+
if (viewRef.current) {
|
|
90
|
+
//@ts-ignore
|
|
91
|
+
ScanbotBarcodeScannerViewNativeComponent_1.Commands.unfreezeCamera(viewRef.current);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}, []);
|
|
96
|
+
var _onBarcodeScannerResult = (0, react_1.useCallback)(function (event) {
|
|
97
|
+
var result = react_native_1.Platform.select({
|
|
98
|
+
ios: JSON.parse(event.nativeEvent.result),
|
|
99
|
+
android: event.nativeEvent.result
|
|
100
|
+
});
|
|
101
|
+
if (props.onBarcodeScannerResult && result) {
|
|
102
|
+
props.onBarcodeScannerResult(result);
|
|
103
|
+
}
|
|
104
|
+
}, [props.onBarcodeScannerResult]);
|
|
105
|
+
return <ScanbotBarcodeScannerViewNativeComponent_1.default
|
|
106
|
+
//FinderConfigs
|
|
107
|
+
finderEnabled={finderConfig.viewFinderEnabled} finderStrokeWidth={finderConfig.finderLineWidth} finderMinPadding={finderConfig.minPadding} finderStrokeColor={finderConfig.finderLineColor} finderOverlayColor={finderConfig.overlayColor} finderInset={finderConfig.finderInset} finderRequiredAspectRatios={finderConfig.requiredAspectRatio}
|
|
108
|
+
//CameraConfigs
|
|
109
|
+
cameraZoomFactor={react_native_1.Platform.select({
|
|
110
|
+
ios: parseFloat(cameraConfig.cameraZoomFactor.toFixed(2)),
|
|
111
|
+
android: cameraConfig.cameraZoomRange.minZoom +
|
|
112
|
+
(cameraConfig.cameraZoomRange.maxZoom - cameraConfig.cameraZoomRange.minZoom) * cameraConfig.cameraZoomFactor,
|
|
113
|
+
})} cameraZoomRange={cameraConfig.cameraZoomRange} minFocusDistanceLock={cameraConfig.minFocusDistanceLock} cameraModule={cameraConfig.cameraModule}
|
|
114
|
+
//DetectorConfigs
|
|
115
|
+
detectorConfig={props.detectorConfig}
|
|
116
|
+
//Other
|
|
117
|
+
flashEnabled={flashEnabled} scanningEnabled={scanningEnabled}
|
|
118
|
+
//View
|
|
119
|
+
style={[{ flex: 1 }, props.style]} ref={viewRef}
|
|
120
|
+
//Result
|
|
121
|
+
onBarcodeScannerResult={_onBarcodeScannerResult}/>;
|
|
122
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ColorValue, ViewStyle } from 'react-native';
|
|
2
|
+
import { BarcodeScannerResult } from '../../results';
|
|
3
|
+
import { AspectRatio, BarcodeDocumentFormat, BarcodeFormat, BarcodesExtensionFilter, CameraModule, CodeDensity, EngineMode, Gs1HandlingMode, MSIPlesseyChecksumAlgorithm, ZoomRange } from '../../types';
|
|
4
|
+
import { StyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
|
|
5
|
+
export interface ScanbotBarcodeCameraViewProperties {
|
|
6
|
+
/** Configuration properties of the finder overlay */
|
|
7
|
+
finderConfig?: FinderConfig;
|
|
8
|
+
/** Configuration properties of the camera device */
|
|
9
|
+
cameraConfig?: CameraConfig;
|
|
10
|
+
/** An interface that defines parameters for barcodes detection and filtering */
|
|
11
|
+
detectorConfig?: DetectorConfig;
|
|
12
|
+
/** Whether flash is toggled on or off. */
|
|
13
|
+
flashEnabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Enable or disable barcode detection.
|
|
16
|
+
* If disabled, the camera preview is active but no barcodes will be detected.
|
|
17
|
+
* Default is enabled.
|
|
18
|
+
*/
|
|
19
|
+
scanningEnabled?: boolean;
|
|
20
|
+
onBarcodeScannerResult: (result: BarcodeScannerResult) => void;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
}
|
|
23
|
+
/** Configuration properties of the finder overlay */
|
|
24
|
+
export interface FinderConfig {
|
|
25
|
+
/** Display the region of interest. The default value is TRUE. */
|
|
26
|
+
viewFinderEnabled?: boolean;
|
|
27
|
+
/** Width of finder frame border. */
|
|
28
|
+
finderLineWidth?: number;
|
|
29
|
+
/** Color of finder frame border. */
|
|
30
|
+
finderLineColor?: ColorValue;
|
|
31
|
+
/** Background color of the detection overlay. */
|
|
32
|
+
overlayColor?: ColorValue;
|
|
33
|
+
/** The minimum space from view finders outer edges to the view edges. */
|
|
34
|
+
finderInset?: FinderInset;
|
|
35
|
+
/** Initial padding for insets. Android only. */
|
|
36
|
+
minPadding?: number;
|
|
37
|
+
/** Aspect ratio of finder frame (width \ height), which is used to build actual finder frame. */
|
|
38
|
+
requiredAspectRatio?: AspectRatio;
|
|
39
|
+
}
|
|
40
|
+
/** Configuration properties of the camera device */
|
|
41
|
+
export interface CameraConfig {
|
|
42
|
+
/** The relative initial zoom level of the camera in the range (0,1), where 0 is zoomed out and 1 is zoomed in. Default value is 0.0. */
|
|
43
|
+
cameraZoomFactor?: number;
|
|
44
|
+
/** The range of valid camera zoom factors. Default value is (1.0; 12.0). */
|
|
45
|
+
cameraZoomRange?: ZoomRange;
|
|
46
|
+
/** The camera module to be used for barcode scanning */
|
|
47
|
+
cameraModule?: CameraModule;
|
|
48
|
+
/** Lock focus distance withing minimum possible range */
|
|
49
|
+
minFocusDistanceLock?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** An interface that defines parameters for barcodes detection and filtering */
|
|
52
|
+
export interface DetectorConfig {
|
|
53
|
+
/** Accepted barcode formats */
|
|
54
|
+
barcodeFormats?: BarcodeFormat[];
|
|
55
|
+
/** An optional array of barcode document formats that act as a detection filter. By default all supported document formats will be detected. */
|
|
56
|
+
acceptedDocumentFormats?: BarcodeDocumentFormat[];
|
|
57
|
+
/** The engine mode to be used for barcode scanning. The default value is NEXT_GEN. */
|
|
58
|
+
engineMode?: EngineMode;
|
|
59
|
+
/** The extension filter for EAN and UPC barcodes. */
|
|
60
|
+
barcodesExtensionFilter?: BarcodesExtensionFilter;
|
|
61
|
+
/** If `true`, enabled the mode which slightly decreases the scanning quality and the energy consumption, and increases the scanning speed. If `false` - mode is disabled. The default is `false` */
|
|
62
|
+
lowPowerMode?: boolean;
|
|
63
|
+
/** Optional minimum required text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
|
|
64
|
+
minimumTextLength?: number;
|
|
65
|
+
/** Optional maximum text length of the detected barcode. The default is 0 (setting is turned off). NOTE - This feature works on ITF barcodes only. */
|
|
66
|
+
maximumTextLength?: number;
|
|
67
|
+
/** Optional minimum required quiet zone on the barcode. Measured in modules (the size of minimal bar on the barcode). The default is 10. NOTE - This feature works on ITF barcodes only. */
|
|
68
|
+
minimum1DBarcodesQuietZone?: number;
|
|
69
|
+
/** With this option enabled, the scanner removes checks digits for UPC, EAN and MSI Plessey codes. Has no effect if both single and double digit MSI Plessey checksums are enabled. The default is `false` */
|
|
70
|
+
stripCheckDigits?: boolean;
|
|
71
|
+
/** The GS1 handling mode. The default value is PARSE. */
|
|
72
|
+
gs1HandlingMode?: Gs1HandlingMode;
|
|
73
|
+
/** The checksum algorithm for MSI Plessey barcodes. The default value is MOD_10. */
|
|
74
|
+
msiPlesseyChecksumAlgorithm?: MSIPlesseyChecksumAlgorithm;
|
|
75
|
+
/** The expected density of QR codes in an image. */
|
|
76
|
+
codeDensity?: CodeDensity;
|
|
77
|
+
}
|
|
78
|
+
export interface FinderInset {
|
|
79
|
+
left: number;
|
|
80
|
+
top: number;
|
|
81
|
+
bottom: number;
|
|
82
|
+
right: number;
|
|
83
|
+
}
|
|
84
|
+
export interface ScanbotBarcodeCameraViewHandle {
|
|
85
|
+
/** Freezes the cameras preview */
|
|
86
|
+
freezeCamera(): void;
|
|
87
|
+
/** Unfreezes the previously frozen cameras preview */
|
|
88
|
+
unfreezeCamera(): void;
|
|
89
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react-native/types/modules/Codegen" />
|
|
2
|
+
import type { ColorValue, ViewProps } from 'react-native';
|
|
3
|
+
import type { DirectEventHandler, Double, Float, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
import { ComponentType } from 'react';
|
|
5
|
+
export interface NativeProps extends ViewProps {
|
|
6
|
+
onBarcodeScannerResult?: DirectEventHandler<Readonly<{
|
|
7
|
+
result: string;
|
|
8
|
+
}>>;
|
|
9
|
+
flashEnabled?: WithDefault<boolean, false>;
|
|
10
|
+
finderEnabled?: WithDefault<boolean, false>;
|
|
11
|
+
finderStrokeWidth?: WithDefault<Int32, 2>;
|
|
12
|
+
finderStrokeColor?: ColorValue;
|
|
13
|
+
finderOverlayColor?: ColorValue;
|
|
14
|
+
finderMinPadding?: WithDefault<Int32, 0>;
|
|
15
|
+
finderInset?: {
|
|
16
|
+
left?: WithDefault<Int32, 10>;
|
|
17
|
+
top?: WithDefault<Int32, 10>;
|
|
18
|
+
bottom?: WithDefault<Int32, 10>;
|
|
19
|
+
right?: WithDefault<Int32, 10>;
|
|
20
|
+
};
|
|
21
|
+
finderRequiredAspectRatios?: {
|
|
22
|
+
width?: WithDefault<Double, 4>;
|
|
23
|
+
height?: WithDefault<Double, 3>;
|
|
24
|
+
};
|
|
25
|
+
cameraZoomFactor?: WithDefault<Float, 0.0>;
|
|
26
|
+
cameraZoomRange?: {
|
|
27
|
+
minZoom?: WithDefault<Float, 1.0>;
|
|
28
|
+
maxZoom?: WithDefault<Float, 12.0>;
|
|
29
|
+
};
|
|
30
|
+
cameraModule?: WithDefault<string, 'BACK'>;
|
|
31
|
+
scanningEnabled?: WithDefault<boolean, true>;
|
|
32
|
+
detectorConfig?: {
|
|
33
|
+
barcodeFormats?: ReadonlyArray<string>;
|
|
34
|
+
acceptedDocumentFormats?: ReadonlyArray<string>;
|
|
35
|
+
engineMode?: WithDefault<string, 'NEXT_GEN'>;
|
|
36
|
+
barcodesExtensionFilter?: WithDefault<string, 'NO_FILTER'>;
|
|
37
|
+
lowPowerMode?: WithDefault<boolean, false>;
|
|
38
|
+
minimumTextLength?: WithDefault<Int32, 0>;
|
|
39
|
+
maximumTextLength?: WithDefault<Int32, 0>;
|
|
40
|
+
minimum1DBarcodesQuietZone?: WithDefault<Int32, 10>;
|
|
41
|
+
stripCheckDigits?: WithDefault<boolean, false>;
|
|
42
|
+
gs1HandlingMode?: WithDefault<string, 'PARSE'>;
|
|
43
|
+
msiPlesseyChecksumAlgorithm?: WithDefault<string, 'MOD_10'>;
|
|
44
|
+
codeDensity?: WithDefault<string, 'LOW'>;
|
|
45
|
+
};
|
|
46
|
+
minFocusDistanceLock?: WithDefault<boolean, false>;
|
|
47
|
+
}
|
|
48
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
49
|
+
export default _default;
|
|
50
|
+
interface NativeCommands {
|
|
51
|
+
freezeCamera: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
52
|
+
unfreezeCamera: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const Commands: NativeCommands;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Commands = void 0;
|
|
7
|
+
var codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
var codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
9
|
+
exports.default = (0, codegenNativeComponent_1.default)('ScanbotBarcodeScannerView');
|
|
10
|
+
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
11
|
+
supportedCommands: ['freezeCamera', 'unfreezeCamera'],
|
|
12
|
+
});
|