scandit-react-native-datacapture-core 6.14.0 → 6.15.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/android/build.gradle +4 -4
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +20 -1
- package/ios/Sources/ScanditDataCaptureCore+DataCaptureContextListener.swift +29 -16
- package/ios/Sources/ScanditDataCaptureCore.xcodeproj/project.pbxproj +2 -0
- package/js/Camera+Related.d.ts +22 -0
- package/js/Camera+Related.js +104 -1
- package/js/Camera+Related.js.map +1 -1
- package/js/DataCaptureVersion.js +1 -1
- package/js/DataCaptureVersion.js.map +1 -1
- package/js/native/ImageFrameSourceProxy.d.ts +11 -0
- package/js/native/ImageFrameSourceProxy.js +50 -0
- package/js/native/ImageFrameSourceProxy.js.map +1 -0
- package/js/private/PrivateCamera+Related.d.ts +17 -1
- package/js/private/PrivateCamera+Related.js.map +1 -1
- package/package.json +1 -1
- package/scandit-react-native-datacapture-core.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -5,7 +5,7 @@ def safeExtGet(prop, fallback) {
|
|
|
5
5
|
buildscript {
|
|
6
6
|
ext {
|
|
7
7
|
kotlin_version = "1.5.31"
|
|
8
|
-
agp_version = "7.
|
|
8
|
+
agp_version = "7.2.1"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
repositories {
|
|
@@ -23,11 +23,11 @@ apply plugin: 'com.android.library'
|
|
|
23
23
|
apply plugin: 'kotlin-android'
|
|
24
24
|
|
|
25
25
|
android {
|
|
26
|
-
compileSdkVersion safeExtGet('compileSdkVersion',
|
|
26
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 32)
|
|
27
27
|
|
|
28
28
|
defaultConfig {
|
|
29
29
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
30
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
30
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 32)
|
|
31
31
|
versionCode 1
|
|
32
32
|
versionName "1.0"
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ android {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
|
-
def sdk_version = "6.
|
|
41
|
+
def sdk_version = "6.15.0-beta.1"
|
|
42
42
|
|
|
43
43
|
api "com.scandit.datacapture:core:$sdk_version"
|
|
44
44
|
|
|
@@ -90,6 +90,12 @@ class ScanditDataCaptureCoreModule(
|
|
|
90
90
|
field = value?.also { it.addListener(this) }
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
private var imageFrameSource: BitmapFrameSource? = null
|
|
94
|
+
private set(value) {
|
|
95
|
+
field?.removeListener(this)
|
|
96
|
+
field = value?.also { it.addListener(this) }
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
private var latestFeedback: Feedback? = null
|
|
94
100
|
|
|
95
101
|
private val defaults: SerializableCoreDefaults by lazy {
|
|
@@ -255,6 +261,7 @@ class ScanditDataCaptureCoreModule(
|
|
|
255
261
|
dataCaptureContext?.release()
|
|
256
262
|
dataCaptureContext = null
|
|
257
263
|
camera = null
|
|
264
|
+
imageFrameSource = null
|
|
258
265
|
|
|
259
266
|
DataCaptureViewHandler.dataCaptureView?.removeListener(this)
|
|
260
267
|
DataCaptureViewHandler.dataCaptureView = null
|
|
@@ -361,7 +368,7 @@ class ScanditDataCaptureCoreModule(
|
|
|
361
368
|
frameSource: FrameSource,
|
|
362
369
|
json: JsonValue
|
|
363
370
|
) {
|
|
364
|
-
camera = frameSource as? Camera
|
|
371
|
+
camera = frameSource as? Camera
|
|
365
372
|
|
|
366
373
|
camera?.let {
|
|
367
374
|
if (json.contains("desiredTorchState")) {
|
|
@@ -377,6 +384,18 @@ class ScanditDataCaptureCoreModule(
|
|
|
377
384
|
)
|
|
378
385
|
)
|
|
379
386
|
}
|
|
387
|
+
} ?: run {
|
|
388
|
+
imageFrameSource = frameSource as? BitmapFrameSource
|
|
389
|
+
|
|
390
|
+
imageFrameSource?.let {
|
|
391
|
+
if (json.contains("desiredState")) {
|
|
392
|
+
it.switchToDesiredState(
|
|
393
|
+
FrameSourceStateDeserializer.fromJson(
|
|
394
|
+
json.requireByKeyAsString("desiredState")
|
|
395
|
+
)
|
|
396
|
+
)
|
|
397
|
+
}
|
|
398
|
+
}
|
|
380
399
|
}
|
|
381
400
|
}
|
|
382
401
|
}
|
|
@@ -15,22 +15,35 @@ extension ScanditDataCaptureCore: FrameSourceDeserializerDelegate {
|
|
|
15
15
|
public func frameSourceDeserializer(_ deserializer: FrameSourceDeserializer,
|
|
16
16
|
didFinishDeserializingFrameSource frameSource: FrameSource,
|
|
17
17
|
from JSONValue: JSONValue) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
if JSONValue.containsKey("type") {
|
|
19
|
+
let type = JSONValue.string(forKey: "type")
|
|
20
|
+
if type == "camera" {
|
|
21
|
+
guard let camera = frameSource as? Camera else { return }
|
|
22
|
+
camera.addListener(self)
|
|
23
|
+
if JSONValue.containsKey("desiredState") {
|
|
24
|
+
let desiredStateJson = JSONValue.string(forKey: "desiredState")
|
|
25
|
+
var desiredState = FrameSourceState.on
|
|
26
|
+
if SDCFrameSourceStateFromJSONString(desiredStateJson, &desiredState) {
|
|
27
|
+
camera.switch(toDesiredState: desiredState)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if JSONValue.containsKey("desiredTorchState") {
|
|
31
|
+
let desiredTorchStateJson = JSONValue.string(forKey: "desiredTorchState")
|
|
32
|
+
var desiredTorchState = TorchState.off
|
|
33
|
+
if SDCTorchStateFromJSONString(desiredTorchStateJson, &desiredTorchState) {
|
|
34
|
+
camera.desiredTorchState = desiredTorchState
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
guard let imageFrameSource = frameSource as? ImageFrameSource else { return }
|
|
39
|
+
imageFrameSource.addListener(self)
|
|
40
|
+
if JSONValue.containsKey("desiredState") {
|
|
41
|
+
let desiredStateJson = JSONValue.string(forKey: "desiredState")
|
|
42
|
+
var desiredState = FrameSourceState.on
|
|
43
|
+
if SDCFrameSourceStateFromJSONString(desiredStateJson, &desiredState) {
|
|
44
|
+
imageFrameSource.switch(toDesiredState: desiredState)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
48
|
}
|
|
36
49
|
}
|
|
@@ -268,6 +268,7 @@
|
|
|
268
268
|
isa = XCBuildConfiguration;
|
|
269
269
|
buildSettings = {
|
|
270
270
|
CLANG_ENABLE_MODULES = YES;
|
|
271
|
+
ENABLE_BITCODE = NO;
|
|
271
272
|
HEADER_SEARCH_PATHS = (
|
|
272
273
|
"$(inherited)",
|
|
273
274
|
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
@@ -289,6 +290,7 @@
|
|
|
289
290
|
isa = XCBuildConfiguration;
|
|
290
291
|
buildSettings = {
|
|
291
292
|
CLANG_ENABLE_MODULES = YES;
|
|
293
|
+
ENABLE_BITCODE = NO;
|
|
292
294
|
HEADER_SEARCH_PATHS = (
|
|
293
295
|
"$(inherited)",
|
|
294
296
|
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
package/js/Camera+Related.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DefaultSerializeable } from './private/Serializeable';
|
|
2
|
+
import { FrameSource, FrameSourceListener, FrameSourceState } from './FrameSource';
|
|
2
3
|
export declare enum TorchState {
|
|
3
4
|
On = "on",
|
|
4
5
|
Off = "off",
|
|
@@ -58,3 +59,24 @@ export declare class ImageBuffer {
|
|
|
58
59
|
get height(): number;
|
|
59
60
|
get data(): string;
|
|
60
61
|
}
|
|
62
|
+
export declare class ImageFrameSource extends DefaultSerializeable implements FrameSource {
|
|
63
|
+
private set context(value);
|
|
64
|
+
private get context();
|
|
65
|
+
get desiredState(): FrameSourceState;
|
|
66
|
+
private position;
|
|
67
|
+
private type;
|
|
68
|
+
private image;
|
|
69
|
+
private _id;
|
|
70
|
+
private _desiredState;
|
|
71
|
+
private listeners;
|
|
72
|
+
private _context;
|
|
73
|
+
private proxy;
|
|
74
|
+
static create(image: string): ImageFrameSource;
|
|
75
|
+
private static fromJSON;
|
|
76
|
+
private constructor();
|
|
77
|
+
private didChange;
|
|
78
|
+
switchToDesiredState(state: FrameSourceState): Promise<void>;
|
|
79
|
+
addListener(listener: FrameSourceListener | null): void;
|
|
80
|
+
removeListener(listener: FrameSourceListener | null): void;
|
|
81
|
+
getCurrentState(): Promise<FrameSourceState>;
|
|
82
|
+
}
|
package/js/Camera+Related.js
CHANGED
|
@@ -12,10 +12,18 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
13
|
};
|
|
14
14
|
})();
|
|
15
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
15
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ImageBuffer = exports.CameraSettings = exports.FocusGestureStrategy = exports.FocusRange = exports.VideoResolution = exports.CameraPosition = exports.TorchState = void 0;
|
|
22
|
+
exports.ImageFrameSource = exports.ImageBuffer = exports.CameraSettings = exports.FocusGestureStrategy = exports.FocusRange = exports.VideoResolution = exports.CameraPosition = exports.TorchState = void 0;
|
|
17
23
|
var Defaults_1 = require("./private/Defaults");
|
|
18
24
|
var Serializeable_1 = require("./private/Serializeable");
|
|
25
|
+
var FrameSource_1 = require("./FrameSource");
|
|
26
|
+
var ImageFrameSourceProxy_1 = require("./native/ImageFrameSourceProxy");
|
|
19
27
|
var TorchState;
|
|
20
28
|
(function (TorchState) {
|
|
21
29
|
TorchState["On"] = "on";
|
|
@@ -164,4 +172,99 @@ var ImageBuffer = /** @class */ (function () {
|
|
|
164
172
|
return ImageBuffer;
|
|
165
173
|
}());
|
|
166
174
|
exports.ImageBuffer = ImageBuffer;
|
|
175
|
+
var ImageFrameSource = /** @class */ (function (_super) {
|
|
176
|
+
__extends(ImageFrameSource, _super);
|
|
177
|
+
function ImageFrameSource() {
|
|
178
|
+
var _this = _super.call(this) || this;
|
|
179
|
+
_this.type = 'image';
|
|
180
|
+
_this.image = '';
|
|
181
|
+
_this._id = "" + Date.now();
|
|
182
|
+
_this._desiredState = FrameSource_1.FrameSourceState.Off;
|
|
183
|
+
_this.listeners = [];
|
|
184
|
+
_this._context = null;
|
|
185
|
+
_this.proxy = ImageFrameSourceProxy_1.ImageFrameSourceProxy.forImage(_this);
|
|
186
|
+
return _this;
|
|
187
|
+
}
|
|
188
|
+
Object.defineProperty(ImageFrameSource.prototype, "context", {
|
|
189
|
+
get: function () {
|
|
190
|
+
return this._context;
|
|
191
|
+
},
|
|
192
|
+
set: function (newContext) {
|
|
193
|
+
if (newContext == null) {
|
|
194
|
+
this.proxy.unsubscribeListener();
|
|
195
|
+
}
|
|
196
|
+
else if (this._context == null) {
|
|
197
|
+
this.proxy.subscribeListener();
|
|
198
|
+
}
|
|
199
|
+
this._context = newContext;
|
|
200
|
+
},
|
|
201
|
+
enumerable: false,
|
|
202
|
+
configurable: true
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(ImageFrameSource.prototype, "desiredState", {
|
|
205
|
+
get: function () {
|
|
206
|
+
return this._desiredState;
|
|
207
|
+
},
|
|
208
|
+
enumerable: false,
|
|
209
|
+
configurable: true
|
|
210
|
+
});
|
|
211
|
+
ImageFrameSource.create = function (image) {
|
|
212
|
+
var imageFrameSource = new ImageFrameSource();
|
|
213
|
+
imageFrameSource.image = image;
|
|
214
|
+
return imageFrameSource;
|
|
215
|
+
};
|
|
216
|
+
ImageFrameSource.fromJSON = function (json) {
|
|
217
|
+
return ImageFrameSource.create(json.image);
|
|
218
|
+
};
|
|
219
|
+
ImageFrameSource.prototype.didChange = function () {
|
|
220
|
+
if (this.context) {
|
|
221
|
+
return this.context.update();
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
return Promise.resolve();
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
ImageFrameSource.prototype.switchToDesiredState = function (state) {
|
|
228
|
+
this._desiredState = state;
|
|
229
|
+
return this.didChange();
|
|
230
|
+
};
|
|
231
|
+
ImageFrameSource.prototype.addListener = function (listener) {
|
|
232
|
+
if (listener == null) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (this.listeners.includes(listener)) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
this.listeners.push(listener);
|
|
239
|
+
};
|
|
240
|
+
ImageFrameSource.prototype.removeListener = function (listener) {
|
|
241
|
+
if (listener == null) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (!this.listeners.includes(listener)) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.listeners.splice(this.listeners.indexOf(listener), 1);
|
|
248
|
+
};
|
|
249
|
+
ImageFrameSource.prototype.getCurrentState = function () {
|
|
250
|
+
return this.proxy.getCurrentState();
|
|
251
|
+
};
|
|
252
|
+
__decorate([
|
|
253
|
+
Serializeable_1.nameForSerialization('id')
|
|
254
|
+
], ImageFrameSource.prototype, "_id", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
Serializeable_1.nameForSerialization('desiredState')
|
|
257
|
+
], ImageFrameSource.prototype, "_desiredState", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
Serializeable_1.ignoreFromSerialization
|
|
260
|
+
], ImageFrameSource.prototype, "listeners", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
Serializeable_1.ignoreFromSerialization
|
|
263
|
+
], ImageFrameSource.prototype, "_context", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
Serializeable_1.ignoreFromSerialization
|
|
266
|
+
], ImageFrameSource.prototype, "proxy", void 0);
|
|
267
|
+
return ImageFrameSource;
|
|
268
|
+
}(Serializeable_1.DefaultSerializeable));
|
|
269
|
+
exports.ImageFrameSource = ImageFrameSource;
|
|
167
270
|
//# sourceMappingURL=Camera+Related.js.map
|
package/js/Camera+Related.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera+Related.js","sourceRoot":"","sources":["../ts/Camera+Related.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Camera+Related.js","sourceRoot":"","sources":["../ts/Camera+Related.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8C;AAE9C,yDAA8G;AAC9G,6CAAiF;AAGjF,wEAAuE;AAEvE,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,uBAAS,CAAA;IACT,yBAAW,CAAA;IACX,2BAAa,CAAA;AACf,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;AAC7B,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,oCAAiB,CAAA;I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;SACR;QAED,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAEM,yCAAc,GAArB,UAAsB,QAAoC;QACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACtC,OAAO;SACR;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IAEM,0CAAe,GAAtB;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC;IArED;QADC,oCAAoB,CAAC,IAAI,CAAC;iDACW;IAGtC;QADC,oCAAoB,CAAC,cAAc,CAAC;2DAC0B;IAG/D;QADC,uCAAuB;uDACsB;IAG9C;QADC,uCAAuB;sDAC2B;IAGnD;QADC,uCAAuB;mDACa;IA0DvC,uBAAC;CAAA,AA/FD,CAAsC,oCAAoB,GA+FzD;AA/FY,4CAAgB"}
|
package/js/DataCaptureVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCaptureVersion.js","sourceRoot":"","sources":["../ts/DataCaptureVersion.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAE7C,yCAAyC;AACzC,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAE1D;IAAA;IAQA,CAAC;IAPC,sBAAkB,mCAAa;aAA/B;YACE,OAAO,
|
|
1
|
+
{"version":3,"file":"DataCaptureVersion.js","sourceRoot":"","sources":["../ts/DataCaptureVersion.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAE7C,yCAAyC;AACzC,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAE1D;IAAA;IAQA,CAAC;IAPC,sBAAkB,mCAAa;aAA/B;YACE,OAAO,eAAe,CAAC;QACzB,CAAC;;;OAAA;IAED,sBAAkB,gCAAU;aAA5B;YACE,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;;;OAAA;IACH,yBAAC;AAAD,CAAC,AARD,IAQC;AARY,gDAAkB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImageFrameSource } from '../Camera+Related';
|
|
2
|
+
import { FrameSourceState } from '../FrameSource';
|
|
3
|
+
export declare class ImageFrameSourceProxy {
|
|
4
|
+
private imageFrameSource;
|
|
5
|
+
private nativeListeners;
|
|
6
|
+
static forImage(imageFrameSource: ImageFrameSource): ImageFrameSourceProxy;
|
|
7
|
+
getCurrentState(): Promise<FrameSourceState>;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
subscribeListener(): void;
|
|
10
|
+
unsubscribeListener(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageFrameSourceProxy = void 0;
|
|
4
|
+
var react_native_1 = require("react-native");
|
|
5
|
+
// tslint:disable:variable-name
|
|
6
|
+
var NativeModule = react_native_1.NativeModules.ScanditDataCaptureCore;
|
|
7
|
+
var EventEmitter = new react_native_1.NativeEventEmitter(NativeModule);
|
|
8
|
+
// tslint:enable:variable-name
|
|
9
|
+
var FrameSourceListenerName;
|
|
10
|
+
(function (FrameSourceListenerName) {
|
|
11
|
+
FrameSourceListenerName["didChangeState"] = "frameSourceListener-didChangeState";
|
|
12
|
+
})(FrameSourceListenerName || (FrameSourceListenerName = {}));
|
|
13
|
+
var ImageFrameSourceProxy = /** @class */ (function () {
|
|
14
|
+
function ImageFrameSourceProxy() {
|
|
15
|
+
this.nativeListeners = [];
|
|
16
|
+
}
|
|
17
|
+
ImageFrameSourceProxy.forImage = function (imageFrameSource) {
|
|
18
|
+
var proxy = new ImageFrameSourceProxy();
|
|
19
|
+
proxy.imageFrameSource = imageFrameSource;
|
|
20
|
+
return proxy;
|
|
21
|
+
};
|
|
22
|
+
ImageFrameSourceProxy.prototype.getCurrentState = function () {
|
|
23
|
+
return NativeModule.getCurrentCameraState(this.imageFrameSource.position);
|
|
24
|
+
};
|
|
25
|
+
ImageFrameSourceProxy.prototype.dispose = function () {
|
|
26
|
+
this.unsubscribeListener();
|
|
27
|
+
return NativeModule.dispose();
|
|
28
|
+
};
|
|
29
|
+
ImageFrameSourceProxy.prototype.subscribeListener = function () {
|
|
30
|
+
var _this = this;
|
|
31
|
+
NativeModule.registerListenerForCameraEvents();
|
|
32
|
+
var didChangeState = EventEmitter.addListener(FrameSourceListenerName.didChangeState, function (body) {
|
|
33
|
+
var newState = body.state;
|
|
34
|
+
_this.imageFrameSource.listeners.forEach(function (listener) {
|
|
35
|
+
if (listener.didChangeState) {
|
|
36
|
+
listener.didChangeState(_this.imageFrameSource, newState);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
this.nativeListeners.push(didChangeState);
|
|
41
|
+
};
|
|
42
|
+
ImageFrameSourceProxy.prototype.unsubscribeListener = function () {
|
|
43
|
+
NativeModule.unregisterListenerForCameraEvents();
|
|
44
|
+
this.nativeListeners.forEach(function (listener) { return listener.remove(); });
|
|
45
|
+
this.nativeListeners = [];
|
|
46
|
+
};
|
|
47
|
+
return ImageFrameSourceProxy;
|
|
48
|
+
}());
|
|
49
|
+
exports.ImageFrameSourceProxy = ImageFrameSourceProxy;
|
|
50
|
+
//# sourceMappingURL=ImageFrameSourceProxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageFrameSourceProxy.js","sourceRoot":"","sources":["../../ts/native/ImageFrameSourceProxy.ts"],"names":[],"mappings":";;;AAAA,6CAAsF;AAMtF,+BAA+B;AAC/B,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAC1D,IAAM,YAAY,GAAG,IAAI,iCAAkB,CAAC,YAAY,CAA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AAQ,IAAI,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,CAAC,CAAC;QAC5D,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;IACH,4BAAC;AAAD,CAAC,AA1CD,IA0CC;AA1CY,sDAAqB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { CameraSettings, FrameData as IFrameData, ImageBuffer } from '../Camera+Related';
|
|
1
|
+
import { CameraPosition, CameraSettings, FrameData as IFrameData, ImageBuffer } from '../Camera+Related';
|
|
2
|
+
import { DataCaptureContext } from '../DataCaptureContext';
|
|
3
|
+
import { FrameSourceListener, FrameSourceState } from '../FrameSource';
|
|
4
|
+
import { ImageFrameSourceProxy } from '../native/ImageFrameSourceProxy';
|
|
2
5
|
export interface CameraSettingsJSON {
|
|
3
6
|
preferredResolution: string;
|
|
4
7
|
zoomFactor: number;
|
|
@@ -25,6 +28,9 @@ export interface ImageBufferJSON {
|
|
|
25
28
|
height: number;
|
|
26
29
|
data: string;
|
|
27
30
|
}
|
|
31
|
+
export interface ImageFrameSourceJSON {
|
|
32
|
+
image: string;
|
|
33
|
+
}
|
|
28
34
|
export declare class FrameData implements IFrameData {
|
|
29
35
|
private _imageBuffers;
|
|
30
36
|
private _orientation;
|
|
@@ -32,3 +38,13 @@ export declare class FrameData implements IFrameData {
|
|
|
32
38
|
get orientation(): number;
|
|
33
39
|
static fromJSON(json: FrameDataJSON): IFrameData;
|
|
34
40
|
}
|
|
41
|
+
export interface PrivateImageFrameSource {
|
|
42
|
+
context: DataCaptureContext | null;
|
|
43
|
+
_desiredState: FrameSourceState;
|
|
44
|
+
listeners: FrameSourceListener[];
|
|
45
|
+
_proxy: ImageFrameSourceProxy;
|
|
46
|
+
proxy: ImageFrameSourceProxy;
|
|
47
|
+
position: CameraPosition;
|
|
48
|
+
initialize: () => void;
|
|
49
|
+
didChange: () => Promise<void>;
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateCamera+Related.js","sourceRoot":"","sources":["../../ts/private/PrivateCamera+Related.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"PrivateCamera+Related.js","sourceRoot":"","sources":["../../ts/private/PrivateCamera+Related.ts"],"names":[],"mappings":";;;AAAA,oDAAyG;AAwCzG;IAAA;IAyBA,CAAC;IArBC,sBAAW,mCAAY;aAAvB;YACE,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;;;OAAA;IAED,sBAAW,kCAAW;aAAtB;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAEa,kBAAQ,GAAtB,UAAuB,IAAmB;QACxC,IAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAClC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,eAAgC;YAC/E,IAAM,WAAW,GAAG,IAAI,4BAAW,EAAE,CAAC;YACrC,WAAyC,CAAC,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;YACzE,WAAyC,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC;YAC3E,WAAyC,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC;YACxE,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAE1C,OAAO,SAAS,CAAC;IACnB,CAAC;IACH,gBAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,8BAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.15.0-beta.1",
|
|
4
4
|
"description": "Scandit Data Capture SDK for React Native",
|
|
5
5
|
"homepage": "https://github.com/Scandit/scandit-react-native-datacapture-core",
|
|
6
6
|
"main": "js/index.js",
|
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.requires_arc = true
|
|
17
17
|
s.module_name = "ScanditDataCaptureCore"
|
|
18
18
|
s.header_dir = "ScanditDataCaptureCore"
|
|
19
|
-
s.dependency 'ScanditCaptureCore', '= 6.
|
|
19
|
+
s.dependency 'ScanditCaptureCore', '= 6.15.0-beta.1'
|
|
20
20
|
|
|
21
21
|
s.dependency "React"
|
|
22
22
|
end
|