scandit-datacapture-frameworks-core 7.2.2 → 7.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/dist/dts/BaseController.d.ts +1 -20
- package/dist/dts/controllers/BaseNewController.d.ts +5 -0
- package/dist/dts/controllers/index.d.ts +1 -0
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/proxies/AdvancedInstanceAwareNativeProxy.d.ts +30 -0
- package/dist/dts/proxies/BaseInstanceAwareNativeProxy.d.ts +5 -0
- package/dist/dts/proxies/NativeCaller.d.ts +9 -0
- package/dist/dts/proxies/ProxyEvent.d.ts +4 -0
- package/dist/dts/proxies/index.d.ts +4 -0
- package/dist/index.js +298 -171
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -372,7 +372,7 @@ class FactoryMaker {
|
|
|
372
372
|
throw new Error(`Trying to get a non existing instance for ${clsName}`);
|
|
373
373
|
}
|
|
374
374
|
if (!item.instance && item.builder) {
|
|
375
|
-
item.instance = (_a = item.builder) === null || _a ===
|
|
375
|
+
item.instance = (_a = item.builder) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
376
376
|
}
|
|
377
377
|
return item.instance;
|
|
378
378
|
}
|
|
@@ -382,7 +382,7 @@ class FactoryMaker {
|
|
|
382
382
|
if (item === null || item === undefined) {
|
|
383
383
|
throw new Error(`Trying to get a non existing instance for ${clsName}`);
|
|
384
384
|
}
|
|
385
|
-
const proxyInstance = (_a = item.builder) === null || _a ===
|
|
385
|
+
const proxyInstance = (_a = item.builder) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
386
386
|
if (proxyInstance === undefined) {
|
|
387
387
|
throw new Error(`item.builder?.() returned undefined for ${clsName}`);
|
|
388
388
|
}
|
|
@@ -444,18 +444,6 @@ class BaseController {
|
|
|
444
444
|
this.proxyName = proxyName;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
class BaseNewController {
|
|
448
|
-
get _proxy() {
|
|
449
|
-
return this._cachedProxy;
|
|
450
|
-
}
|
|
451
|
-
constructor(proxyName) {
|
|
452
|
-
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
453
|
-
this._cachedProxy = FactoryMaker.createInstance(proxyName);
|
|
454
|
-
}
|
|
455
|
-
emit(event, payload) {
|
|
456
|
-
this.eventEmitter.emit(event, payload);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
447
|
class BaseNativeProxy {
|
|
460
448
|
constructor() {
|
|
461
449
|
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
@@ -511,14 +499,14 @@ class AdvancedNativeProxy extends BaseNativeProxy {
|
|
|
511
499
|
this.nativeCaller = nativeCaller;
|
|
512
500
|
this.events = events;
|
|
513
501
|
this.eventSubscriptions = new Map();
|
|
514
|
-
this.events.forEach((event) => __awaiter(this,
|
|
502
|
+
this.events.forEach((event) => __awaiter(this, void 0, void 0, function* () {
|
|
515
503
|
yield this._registerEvent(event);
|
|
516
504
|
}));
|
|
517
505
|
// Wrapping the AdvancedNativeProxy instance with the JS proxy hook
|
|
518
506
|
return new Proxy(this, advancedNativeProxyHook);
|
|
519
507
|
}
|
|
520
508
|
dispose() {
|
|
521
|
-
return __awaiter(this,
|
|
509
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
522
510
|
for (const event of this.events) {
|
|
523
511
|
yield this._unregisterEvent(event);
|
|
524
512
|
}
|
|
@@ -530,11 +518,11 @@ class AdvancedNativeProxy extends BaseNativeProxy {
|
|
|
530
518
|
return this.nativeCaller.callFn(fnName, args);
|
|
531
519
|
}
|
|
532
520
|
_registerEvent(event) {
|
|
533
|
-
return __awaiter(this,
|
|
534
|
-
const handler = (args) => __awaiter(this,
|
|
521
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
522
|
+
const handler = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
535
523
|
this.eventEmitter.emit(event.nativeEventName, args);
|
|
536
524
|
});
|
|
537
|
-
this.eventEmitter.on(event.nativeEventName, (args) => __awaiter(this,
|
|
525
|
+
this.eventEmitter.on(event.nativeEventName, (args) => __awaiter(this, void 0, void 0, function* () {
|
|
538
526
|
// Call to the special method defined on the JS Proxy hook
|
|
539
527
|
try {
|
|
540
528
|
const hookArg = this.nativeCaller.eventHook(args);
|
|
@@ -550,7 +538,7 @@ class AdvancedNativeProxy extends BaseNativeProxy {
|
|
|
550
538
|
});
|
|
551
539
|
}
|
|
552
540
|
_unregisterEvent(event) {
|
|
553
|
-
return __awaiter(this,
|
|
541
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
554
542
|
const subscription = this.eventSubscriptions.get(event.name);
|
|
555
543
|
yield this.nativeCaller.unregisterEvent(event.nativeEventName, subscription);
|
|
556
544
|
this.eventEmitter.off(event.nativeEventName);
|
|
@@ -772,10 +760,10 @@ class Point extends DefaultSerializeable {
|
|
|
772
760
|
}
|
|
773
761
|
__decorate([
|
|
774
762
|
nameForSerialization('x')
|
|
775
|
-
], Point.prototype, "_x",
|
|
763
|
+
], Point.prototype, "_x", void 0);
|
|
776
764
|
__decorate([
|
|
777
765
|
nameForSerialization('y')
|
|
778
|
-
], Point.prototype, "_y",
|
|
766
|
+
], Point.prototype, "_y", void 0);
|
|
779
767
|
|
|
780
768
|
class Quadrilateral extends DefaultSerializeable {
|
|
781
769
|
get topLeft() {
|
|
@@ -803,16 +791,16 @@ class Quadrilateral extends DefaultSerializeable {
|
|
|
803
791
|
}
|
|
804
792
|
__decorate([
|
|
805
793
|
nameForSerialization('topLeft')
|
|
806
|
-
], Quadrilateral.prototype, "_topLeft",
|
|
794
|
+
], Quadrilateral.prototype, "_topLeft", void 0);
|
|
807
795
|
__decorate([
|
|
808
796
|
nameForSerialization('topRight')
|
|
809
|
-
], Quadrilateral.prototype, "_topRight",
|
|
797
|
+
], Quadrilateral.prototype, "_topRight", void 0);
|
|
810
798
|
__decorate([
|
|
811
799
|
nameForSerialization('bottomRight')
|
|
812
|
-
], Quadrilateral.prototype, "_bottomRight",
|
|
800
|
+
], Quadrilateral.prototype, "_bottomRight", void 0);
|
|
813
801
|
__decorate([
|
|
814
802
|
nameForSerialization('bottomLeft')
|
|
815
|
-
], Quadrilateral.prototype, "_bottomLeft",
|
|
803
|
+
], Quadrilateral.prototype, "_bottomLeft", void 0);
|
|
816
804
|
|
|
817
805
|
class NumberWithUnit extends DefaultSerializeable {
|
|
818
806
|
get value() {
|
|
@@ -832,10 +820,10 @@ class NumberWithUnit extends DefaultSerializeable {
|
|
|
832
820
|
}
|
|
833
821
|
__decorate([
|
|
834
822
|
nameForSerialization('value')
|
|
835
|
-
], NumberWithUnit.prototype, "_value",
|
|
823
|
+
], NumberWithUnit.prototype, "_value", void 0);
|
|
836
824
|
__decorate([
|
|
837
825
|
nameForSerialization('unit')
|
|
838
|
-
], NumberWithUnit.prototype, "_unit",
|
|
826
|
+
], NumberWithUnit.prototype, "_unit", void 0);
|
|
839
827
|
|
|
840
828
|
var MeasureUnit;
|
|
841
829
|
(function (MeasureUnit) {
|
|
@@ -865,10 +853,10 @@ class PointWithUnit extends DefaultSerializeable {
|
|
|
865
853
|
}
|
|
866
854
|
__decorate([
|
|
867
855
|
nameForSerialization('x')
|
|
868
|
-
], PointWithUnit.prototype, "_x",
|
|
856
|
+
], PointWithUnit.prototype, "_x", void 0);
|
|
869
857
|
__decorate([
|
|
870
858
|
nameForSerialization('y')
|
|
871
|
-
], PointWithUnit.prototype, "_y",
|
|
859
|
+
], PointWithUnit.prototype, "_y", void 0);
|
|
872
860
|
|
|
873
861
|
class Rect extends DefaultSerializeable {
|
|
874
862
|
get origin() {
|
|
@@ -885,10 +873,10 @@ class Rect extends DefaultSerializeable {
|
|
|
885
873
|
}
|
|
886
874
|
__decorate([
|
|
887
875
|
nameForSerialization('origin')
|
|
888
|
-
], Rect.prototype, "_origin",
|
|
876
|
+
], Rect.prototype, "_origin", void 0);
|
|
889
877
|
__decorate([
|
|
890
878
|
nameForSerialization('size')
|
|
891
|
-
], Rect.prototype, "_size",
|
|
879
|
+
], Rect.prototype, "_size", void 0);
|
|
892
880
|
|
|
893
881
|
class RectWithUnit extends DefaultSerializeable {
|
|
894
882
|
get origin() {
|
|
@@ -905,10 +893,10 @@ class RectWithUnit extends DefaultSerializeable {
|
|
|
905
893
|
}
|
|
906
894
|
__decorate([
|
|
907
895
|
nameForSerialization('origin')
|
|
908
|
-
], RectWithUnit.prototype, "_origin",
|
|
896
|
+
], RectWithUnit.prototype, "_origin", void 0);
|
|
909
897
|
__decorate([
|
|
910
898
|
nameForSerialization('size')
|
|
911
|
-
], RectWithUnit.prototype, "_size",
|
|
899
|
+
], RectWithUnit.prototype, "_size", void 0);
|
|
912
900
|
|
|
913
901
|
class ScanditIcon extends DefaultSerializeable {
|
|
914
902
|
static fromJSON(json) {
|
|
@@ -950,26 +938,26 @@ class ScanditIcon extends DefaultSerializeable {
|
|
|
950
938
|
__decorate([
|
|
951
939
|
nameForSerialization('backgroundColor'),
|
|
952
940
|
ignoreFromSerializationIfNull
|
|
953
|
-
], ScanditIcon.prototype, "_backgroundColor",
|
|
941
|
+
], ScanditIcon.prototype, "_backgroundColor", void 0);
|
|
954
942
|
__decorate([
|
|
955
943
|
nameForSerialization('backgroundShape'),
|
|
956
944
|
ignoreFromSerializationIfNull
|
|
957
|
-
], ScanditIcon.prototype, "_backgroundShape",
|
|
945
|
+
], ScanditIcon.prototype, "_backgroundShape", void 0);
|
|
958
946
|
__decorate([
|
|
959
947
|
nameForSerialization('icon'),
|
|
960
948
|
ignoreFromSerializationIfNull
|
|
961
|
-
], ScanditIcon.prototype, "_icon",
|
|
949
|
+
], ScanditIcon.prototype, "_icon", void 0);
|
|
962
950
|
__decorate([
|
|
963
951
|
nameForSerialization('iconColor'),
|
|
964
952
|
ignoreFromSerializationIfNull
|
|
965
|
-
], ScanditIcon.prototype, "_iconColor",
|
|
953
|
+
], ScanditIcon.prototype, "_iconColor", void 0);
|
|
966
954
|
__decorate([
|
|
967
955
|
nameForSerialization('backgroundStrokeColor'),
|
|
968
956
|
ignoreFromSerializationIfNull
|
|
969
|
-
], ScanditIcon.prototype, "_backgroundStrokeColor",
|
|
957
|
+
], ScanditIcon.prototype, "_backgroundStrokeColor", void 0);
|
|
970
958
|
__decorate([
|
|
971
959
|
nameForSerialization('backgroundStrokeWidth')
|
|
972
|
-
], ScanditIcon.prototype, "_backgroundStrokeWidth",
|
|
960
|
+
], ScanditIcon.prototype, "_backgroundStrokeWidth", void 0);
|
|
973
961
|
|
|
974
962
|
class ScanditIconBuilder {
|
|
975
963
|
constructor() {
|
|
@@ -1059,10 +1047,10 @@ class Size extends DefaultSerializeable {
|
|
|
1059
1047
|
}
|
|
1060
1048
|
__decorate([
|
|
1061
1049
|
nameForSerialization('width')
|
|
1062
|
-
], Size.prototype, "_width",
|
|
1050
|
+
], Size.prototype, "_width", void 0);
|
|
1063
1051
|
__decorate([
|
|
1064
1052
|
nameForSerialization('height')
|
|
1065
|
-
], Size.prototype, "_height",
|
|
1053
|
+
], Size.prototype, "_height", void 0);
|
|
1066
1054
|
|
|
1067
1055
|
class SizeWithAspect extends DefaultSerializeable {
|
|
1068
1056
|
get size() {
|
|
@@ -1079,10 +1067,10 @@ class SizeWithAspect extends DefaultSerializeable {
|
|
|
1079
1067
|
}
|
|
1080
1068
|
__decorate([
|
|
1081
1069
|
nameForSerialization('size')
|
|
1082
|
-
], SizeWithAspect.prototype, "_size",
|
|
1070
|
+
], SizeWithAspect.prototype, "_size", void 0);
|
|
1083
1071
|
__decorate([
|
|
1084
1072
|
nameForSerialization('aspect')
|
|
1085
|
-
], SizeWithAspect.prototype, "_aspect",
|
|
1073
|
+
], SizeWithAspect.prototype, "_aspect", void 0);
|
|
1086
1074
|
|
|
1087
1075
|
class SizeWithUnit extends DefaultSerializeable {
|
|
1088
1076
|
get width() {
|
|
@@ -1099,10 +1087,10 @@ class SizeWithUnit extends DefaultSerializeable {
|
|
|
1099
1087
|
}
|
|
1100
1088
|
__decorate([
|
|
1101
1089
|
nameForSerialization('width')
|
|
1102
|
-
], SizeWithUnit.prototype, "_width",
|
|
1090
|
+
], SizeWithUnit.prototype, "_width", void 0);
|
|
1103
1091
|
__decorate([
|
|
1104
1092
|
nameForSerialization('height')
|
|
1105
|
-
], SizeWithUnit.prototype, "_height",
|
|
1093
|
+
], SizeWithUnit.prototype, "_height", void 0);
|
|
1106
1094
|
|
|
1107
1095
|
var SizingMode;
|
|
1108
1096
|
(function (SizingMode) {
|
|
@@ -1207,16 +1195,16 @@ class SizeWithUnitAndAspect {
|
|
|
1207
1195
|
}
|
|
1208
1196
|
__decorate([
|
|
1209
1197
|
nameForSerialization('widthAndHeight')
|
|
1210
|
-
], SizeWithUnitAndAspect.prototype, "_widthAndHeight",
|
|
1198
|
+
], SizeWithUnitAndAspect.prototype, "_widthAndHeight", void 0);
|
|
1211
1199
|
__decorate([
|
|
1212
1200
|
nameForSerialization('widthAndAspectRatio')
|
|
1213
|
-
], SizeWithUnitAndAspect.prototype, "_widthAndAspectRatio",
|
|
1201
|
+
], SizeWithUnitAndAspect.prototype, "_widthAndAspectRatio", void 0);
|
|
1214
1202
|
__decorate([
|
|
1215
1203
|
nameForSerialization('heightAndAspectRatio')
|
|
1216
|
-
], SizeWithUnitAndAspect.prototype, "_heightAndAspectRatio",
|
|
1204
|
+
], SizeWithUnitAndAspect.prototype, "_heightAndAspectRatio", void 0);
|
|
1217
1205
|
__decorate([
|
|
1218
1206
|
nameForSerialization('shorterDimensionAndAspectRatio')
|
|
1219
|
-
], SizeWithUnitAndAspect.prototype, "_shorterDimensionAndAspectRatio",
|
|
1207
|
+
], SizeWithUnitAndAspect.prototype, "_shorterDimensionAndAspectRatio", void 0);
|
|
1220
1208
|
|
|
1221
1209
|
class MarginsWithUnit extends DefaultSerializeable {
|
|
1222
1210
|
get left() {
|
|
@@ -1247,16 +1235,16 @@ class MarginsWithUnit extends DefaultSerializeable {
|
|
|
1247
1235
|
}
|
|
1248
1236
|
__decorate([
|
|
1249
1237
|
nameForSerialization('left')
|
|
1250
|
-
], MarginsWithUnit.prototype, "_left",
|
|
1238
|
+
], MarginsWithUnit.prototype, "_left", void 0);
|
|
1251
1239
|
__decorate([
|
|
1252
1240
|
nameForSerialization('right')
|
|
1253
|
-
], MarginsWithUnit.prototype, "_right",
|
|
1241
|
+
], MarginsWithUnit.prototype, "_right", void 0);
|
|
1254
1242
|
__decorate([
|
|
1255
1243
|
nameForSerialization('top')
|
|
1256
|
-
], MarginsWithUnit.prototype, "_top",
|
|
1244
|
+
], MarginsWithUnit.prototype, "_top", void 0);
|
|
1257
1245
|
__decorate([
|
|
1258
1246
|
nameForSerialization('bottom')
|
|
1259
|
-
], MarginsWithUnit.prototype, "_bottom",
|
|
1247
|
+
], MarginsWithUnit.prototype, "_bottom", void 0);
|
|
1260
1248
|
|
|
1261
1249
|
class Color {
|
|
1262
1250
|
get redComponent() {
|
|
@@ -1430,7 +1418,7 @@ class Observable extends DefaultSerializeable {
|
|
|
1430
1418
|
}
|
|
1431
1419
|
__decorate([
|
|
1432
1420
|
ignoreFromSerialization
|
|
1433
|
-
], Observable.prototype, "listeners",
|
|
1421
|
+
], Observable.prototype, "listeners", void 0);
|
|
1434
1422
|
|
|
1435
1423
|
class HtmlElementPosition {
|
|
1436
1424
|
constructor(top, left) {
|
|
@@ -1473,8 +1461,8 @@ class HTMLElementState {
|
|
|
1473
1461
|
var _a, _b, _c, _d;
|
|
1474
1462
|
if (!other)
|
|
1475
1463
|
return true;
|
|
1476
|
-
const positionChanged = (_b = (_a = this.position) === null || _a ===
|
|
1477
|
-
const sizeChanged = (_d = (_c = this.size) === null || _c ===
|
|
1464
|
+
const positionChanged = (_b = (_a = this.position) === null || _a === void 0 ? void 0 : _a.didChangeComparedTo(other.position)) !== null && _b !== void 0 ? _b : (this.position !== other.position);
|
|
1465
|
+
const sizeChanged = (_d = (_c = this.size) === null || _c === void 0 ? void 0 : _c.didChangeComparedTo(other.size)) !== null && _d !== void 0 ? _d : (this.size !== other.size);
|
|
1478
1466
|
return positionChanged || sizeChanged || this.shouldBeUnderContent !== other.shouldBeUnderContent;
|
|
1479
1467
|
}
|
|
1480
1468
|
}
|
|
@@ -1490,7 +1478,7 @@ class ImageFrameSourceController {
|
|
|
1490
1478
|
this._proxy = FactoryMaker.getInstance('ImageFrameSourceProxy');
|
|
1491
1479
|
}
|
|
1492
1480
|
getCurrentState() {
|
|
1493
|
-
return __awaiter(this,
|
|
1481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1494
1482
|
const result = yield this._proxy.getCurrentCameraState(this.imageFrameSource.position);
|
|
1495
1483
|
if (result == null) {
|
|
1496
1484
|
return FrameSourceState.Off;
|
|
@@ -1504,7 +1492,7 @@ class ImageFrameSourceController {
|
|
|
1504
1492
|
subscribeListener() {
|
|
1505
1493
|
var _a, _b;
|
|
1506
1494
|
this._proxy.registerListenerForEvents();
|
|
1507
|
-
(_b = (_a = this._proxy).subscribeDidChangeState) === null || _b ===
|
|
1495
|
+
(_b = (_a = this._proxy).subscribeDidChangeState) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1508
1496
|
this.eventEmitter.on(FrameSourceListenerEvents.didChangeState, (data) => {
|
|
1509
1497
|
const event = EventDataParser.parse(data);
|
|
1510
1498
|
if (event === null) {
|
|
@@ -1595,19 +1583,19 @@ class ImageFrameSource extends DefaultSerializeable {
|
|
|
1595
1583
|
}
|
|
1596
1584
|
__decorate([
|
|
1597
1585
|
nameForSerialization('id')
|
|
1598
|
-
], ImageFrameSource.prototype, "_id",
|
|
1586
|
+
], ImageFrameSource.prototype, "_id", void 0);
|
|
1599
1587
|
__decorate([
|
|
1600
1588
|
nameForSerialization('desiredState')
|
|
1601
|
-
], ImageFrameSource.prototype, "_desiredState",
|
|
1589
|
+
], ImageFrameSource.prototype, "_desiredState", void 0);
|
|
1602
1590
|
__decorate([
|
|
1603
1591
|
ignoreFromSerialization
|
|
1604
|
-
], ImageFrameSource.prototype, "listeners",
|
|
1592
|
+
], ImageFrameSource.prototype, "listeners", void 0);
|
|
1605
1593
|
__decorate([
|
|
1606
1594
|
ignoreFromSerialization
|
|
1607
|
-
], ImageFrameSource.prototype, "_context",
|
|
1595
|
+
], ImageFrameSource.prototype, "_context", void 0);
|
|
1608
1596
|
__decorate([
|
|
1609
1597
|
ignoreFromSerialization
|
|
1610
|
-
], ImageFrameSource.prototype, "controller",
|
|
1598
|
+
], ImageFrameSource.prototype, "controller", void 0);
|
|
1611
1599
|
|
|
1612
1600
|
class PrivateFrameData {
|
|
1613
1601
|
get imageBuffers() {
|
|
@@ -1652,7 +1640,7 @@ class CameraController {
|
|
|
1652
1640
|
return this.camera;
|
|
1653
1641
|
}
|
|
1654
1642
|
static getFrame(frameId) {
|
|
1655
|
-
return __awaiter(this,
|
|
1643
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1656
1644
|
const result = yield CameraController._proxy.getFrame(frameId);
|
|
1657
1645
|
if (result == null) {
|
|
1658
1646
|
return PrivateFrameData.empty();
|
|
@@ -1662,7 +1650,7 @@ class CameraController {
|
|
|
1662
1650
|
});
|
|
1663
1651
|
}
|
|
1664
1652
|
static getFrameOrNull(frameId) {
|
|
1665
|
-
return __awaiter(this,
|
|
1653
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1666
1654
|
const result = yield CameraController._proxy.getFrame(frameId);
|
|
1667
1655
|
if (result == null) {
|
|
1668
1656
|
return null;
|
|
@@ -1672,7 +1660,7 @@ class CameraController {
|
|
|
1672
1660
|
});
|
|
1673
1661
|
}
|
|
1674
1662
|
getCurrentState() {
|
|
1675
|
-
return __awaiter(this,
|
|
1663
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1676
1664
|
const result = yield CameraController._proxy.getCurrentCameraState(this.privateCamera.position);
|
|
1677
1665
|
if (result == null) {
|
|
1678
1666
|
return FrameSourceState.Off;
|
|
@@ -1681,7 +1669,7 @@ class CameraController {
|
|
|
1681
1669
|
});
|
|
1682
1670
|
}
|
|
1683
1671
|
getIsTorchAvailable() {
|
|
1684
|
-
return __awaiter(this,
|
|
1672
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1685
1673
|
const result = yield CameraController._proxy.isTorchAvailable(this.privateCamera.position);
|
|
1686
1674
|
if (result == null) {
|
|
1687
1675
|
return false;
|
|
@@ -1695,13 +1683,13 @@ class CameraController {
|
|
|
1695
1683
|
subscribeListener() {
|
|
1696
1684
|
var _a, _b;
|
|
1697
1685
|
CameraController._proxy.registerListenerForCameraEvents();
|
|
1698
|
-
(_b = (_a = CameraController._proxy).subscribeDidChangeState) === null || _b ===
|
|
1686
|
+
(_b = (_a = CameraController._proxy).subscribeDidChangeState) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1699
1687
|
this.eventEmitter.on(FrameSourceListenerEvents.didChangeState, (data) => {
|
|
1700
1688
|
const event = EventDataParser.parse(data);
|
|
1701
1689
|
if (event) {
|
|
1702
1690
|
this.privateCamera.listeners.forEach(listener => {
|
|
1703
1691
|
var _a;
|
|
1704
|
-
(_a = listener === null || listener ===
|
|
1692
|
+
(_a = listener === null || listener === void 0 ? void 0 : listener.didChangeState) === null || _a === void 0 ? void 0 : _a.call(listener, this.camera, event.state);
|
|
1705
1693
|
});
|
|
1706
1694
|
}
|
|
1707
1695
|
});
|
|
@@ -1833,7 +1821,7 @@ class Camera extends DefaultSerializeable {
|
|
|
1833
1821
|
return this.didChange();
|
|
1834
1822
|
}
|
|
1835
1823
|
didChange() {
|
|
1836
|
-
return __awaiter(this,
|
|
1824
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1837
1825
|
if (this.context) {
|
|
1838
1826
|
yield this.context.update();
|
|
1839
1827
|
}
|
|
@@ -1842,22 +1830,22 @@ class Camera extends DefaultSerializeable {
|
|
|
1842
1830
|
}
|
|
1843
1831
|
__decorate([
|
|
1844
1832
|
serializationDefault({})
|
|
1845
|
-
], Camera.prototype, "settings",
|
|
1833
|
+
], Camera.prototype, "settings", void 0);
|
|
1846
1834
|
__decorate([
|
|
1847
1835
|
nameForSerialization('desiredTorchState')
|
|
1848
|
-
], Camera.prototype, "_desiredTorchState",
|
|
1836
|
+
], Camera.prototype, "_desiredTorchState", void 0);
|
|
1849
1837
|
__decorate([
|
|
1850
1838
|
ignoreFromSerialization
|
|
1851
|
-
], Camera.prototype, "_desiredState",
|
|
1839
|
+
], Camera.prototype, "_desiredState", void 0);
|
|
1852
1840
|
__decorate([
|
|
1853
1841
|
ignoreFromSerialization
|
|
1854
|
-
], Camera.prototype, "listeners",
|
|
1842
|
+
], Camera.prototype, "listeners", void 0);
|
|
1855
1843
|
__decorate([
|
|
1856
1844
|
ignoreFromSerialization
|
|
1857
|
-
], Camera.prototype, "_context",
|
|
1845
|
+
], Camera.prototype, "_context", void 0);
|
|
1858
1846
|
__decorate([
|
|
1859
1847
|
ignoreFromSerialization
|
|
1860
|
-
], Camera.prototype, "controller",
|
|
1848
|
+
], Camera.prototype, "controller", void 0);
|
|
1861
1849
|
__decorate([
|
|
1862
1850
|
ignoreFromSerialization
|
|
1863
1851
|
], Camera, "coreDefaults", null);
|
|
@@ -1887,11 +1875,11 @@ class ControlImage extends DefaultSerializeable {
|
|
|
1887
1875
|
__decorate([
|
|
1888
1876
|
ignoreFromSerializationIfNull,
|
|
1889
1877
|
nameForSerialization('data')
|
|
1890
|
-
], ControlImage.prototype, "_data",
|
|
1878
|
+
], ControlImage.prototype, "_data", void 0);
|
|
1891
1879
|
__decorate([
|
|
1892
1880
|
ignoreFromSerializationIfNull,
|
|
1893
1881
|
nameForSerialization('name')
|
|
1894
|
-
], ControlImage.prototype, "_name",
|
|
1882
|
+
], ControlImage.prototype, "_name", void 0);
|
|
1895
1883
|
|
|
1896
1884
|
class ContextStatus {
|
|
1897
1885
|
static fromJSON(json) {
|
|
@@ -1959,7 +1947,7 @@ class DataCaptureContextController {
|
|
|
1959
1947
|
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1960
1948
|
}
|
|
1961
1949
|
updateContextFromJSON() {
|
|
1962
|
-
return __awaiter(this,
|
|
1950
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1963
1951
|
try {
|
|
1964
1952
|
yield this._proxy.updateContextFromJSON(JSON.stringify(this.context.toJSON()));
|
|
1965
1953
|
}
|
|
@@ -1992,7 +1980,7 @@ class DataCaptureContextController {
|
|
|
1992
1980
|
return this.initializeContextFromJSON();
|
|
1993
1981
|
}
|
|
1994
1982
|
initializeContextFromJSON() {
|
|
1995
|
-
return __awaiter(this,
|
|
1983
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1996
1984
|
try {
|
|
1997
1985
|
yield this._proxy.contextFromJSON(JSON.stringify(this.context.toJSON()));
|
|
1998
1986
|
}
|
|
@@ -2003,7 +1991,7 @@ class DataCaptureContextController {
|
|
|
2003
1991
|
});
|
|
2004
1992
|
}
|
|
2005
1993
|
static getOpenSourceSoftwareLicenseInfo() {
|
|
2006
|
-
return __awaiter(this,
|
|
1994
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2007
1995
|
const proxy = FactoryMaker.getInstance('DataCaptureContextProxy');
|
|
2008
1996
|
const result = yield proxy.getOpenSourceSoftwareLicenseInfo();
|
|
2009
1997
|
return new OpenSourceSoftwareLicenseInfo(result.data);
|
|
@@ -2015,8 +2003,8 @@ class DataCaptureContextController {
|
|
|
2015
2003
|
return;
|
|
2016
2004
|
}
|
|
2017
2005
|
this._proxy.registerListenerForDataCaptureContext();
|
|
2018
|
-
(_b = (_a = this._proxy).subscribeDidChangeStatus) === null || _b ===
|
|
2019
|
-
(_d = (_c = this._proxy).subscribeDidStartObservingContext) === null || _d ===
|
|
2006
|
+
(_b = (_a = this._proxy).subscribeDidChangeStatus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2007
|
+
(_d = (_c = this._proxy).subscribeDidStartObservingContext) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2020
2008
|
this.eventEmitter.on(DataCaptureContextEvents.didChangeStatus, (data) => {
|
|
2021
2009
|
const event = EventDataParser.parse(data);
|
|
2022
2010
|
if (event === null) {
|
|
@@ -2029,7 +2017,7 @@ class DataCaptureContextController {
|
|
|
2029
2017
|
this.eventEmitter.on(DataCaptureContextEvents.didStartObservingContext, () => {
|
|
2030
2018
|
this.privateContext.listeners.forEach(listener => {
|
|
2031
2019
|
var _a;
|
|
2032
|
-
(_a = listener.didStartObservingContext) === null || _a ===
|
|
2020
|
+
(_a = listener.didStartObservingContext) === null || _a === void 0 ? void 0 : _a.call(listener, this.context);
|
|
2033
2021
|
});
|
|
2034
2022
|
});
|
|
2035
2023
|
this._listenerRegistered = true;
|
|
@@ -2100,7 +2088,7 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2100
2088
|
}
|
|
2101
2089
|
static create(licenseKey, options, settings) {
|
|
2102
2090
|
DataCaptureContext.sharedInstance.licenseKey = licenseKey;
|
|
2103
|
-
DataCaptureContext.sharedInstance.deviceName = (options === null || options ===
|
|
2091
|
+
DataCaptureContext.sharedInstance.deviceName = (options === null || options === void 0 ? void 0 : options.deviceName) || '';
|
|
2104
2092
|
DataCaptureContext.sharedInstance.settings = settings || new DataCaptureContextSettings();
|
|
2105
2093
|
return DataCaptureContext.sharedInstance;
|
|
2106
2094
|
}
|
|
@@ -2183,7 +2171,7 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2183
2171
|
if (!this.controller) {
|
|
2184
2172
|
return;
|
|
2185
2173
|
}
|
|
2186
|
-
(_a = this.view) === null || _a ===
|
|
2174
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
2187
2175
|
this.removeAllModes();
|
|
2188
2176
|
this.controller.dispose();
|
|
2189
2177
|
}
|
|
@@ -2192,7 +2180,7 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2192
2180
|
return this.update();
|
|
2193
2181
|
}
|
|
2194
2182
|
static getOpenSourceSoftwareLicenseInfo() {
|
|
2195
|
-
return __awaiter(this,
|
|
2183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2196
2184
|
return DataCaptureContextController.getOpenSourceSoftwareLicenseInfo();
|
|
2197
2185
|
});
|
|
2198
2186
|
}
|
|
@@ -2205,28 +2193,28 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2205
2193
|
}
|
|
2206
2194
|
__decorate([
|
|
2207
2195
|
ignoreFromSerialization
|
|
2208
|
-
], DataCaptureContext.prototype, "controller",
|
|
2196
|
+
], DataCaptureContext.prototype, "controller", void 0);
|
|
2209
2197
|
__decorate([
|
|
2210
2198
|
nameForSerialization('framework')
|
|
2211
|
-
], DataCaptureContext.prototype, "_framework",
|
|
2199
|
+
], DataCaptureContext.prototype, "_framework", void 0);
|
|
2212
2200
|
__decorate([
|
|
2213
2201
|
nameForSerialization('frameworkVersion')
|
|
2214
|
-
], DataCaptureContext.prototype, "_frameworkVersion",
|
|
2202
|
+
], DataCaptureContext.prototype, "_frameworkVersion", void 0);
|
|
2215
2203
|
__decorate([
|
|
2216
2204
|
nameForSerialization('frameSource')
|
|
2217
|
-
], DataCaptureContext.prototype, "_frameSource",
|
|
2205
|
+
], DataCaptureContext.prototype, "_frameSource", void 0);
|
|
2218
2206
|
__decorate([
|
|
2219
2207
|
ignoreFromSerialization
|
|
2220
|
-
], DataCaptureContext.prototype, "view",
|
|
2208
|
+
], DataCaptureContext.prototype, "view", void 0);
|
|
2221
2209
|
__decorate([
|
|
2222
2210
|
ignoreFromSerialization
|
|
2223
|
-
], DataCaptureContext.prototype, "modes",
|
|
2211
|
+
], DataCaptureContext.prototype, "modes", void 0);
|
|
2224
2212
|
__decorate([
|
|
2225
2213
|
ignoreFromSerialization
|
|
2226
|
-
], DataCaptureContext.prototype, "listeners",
|
|
2214
|
+
], DataCaptureContext.prototype, "listeners", void 0);
|
|
2227
2215
|
__decorate([
|
|
2228
2216
|
ignoreFromSerialization
|
|
2229
|
-
], DataCaptureContext, "_instance",
|
|
2217
|
+
], DataCaptureContext, "_instance", void 0);
|
|
2230
2218
|
__decorate([
|
|
2231
2219
|
ignoreFromSerialization
|
|
2232
2220
|
], DataCaptureContext, "coreDefaults", null);
|
|
@@ -2249,13 +2237,13 @@ class DataCaptureViewController extends BaseController {
|
|
|
2249
2237
|
super('DataCaptureViewProxy');
|
|
2250
2238
|
}
|
|
2251
2239
|
viewPointForFramePoint(point) {
|
|
2252
|
-
return __awaiter(this,
|
|
2240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2253
2241
|
const result = yield this._proxy.viewPointForFramePoint(JSON.stringify(point.toJSON()));
|
|
2254
2242
|
return Point.fromJSON(JSON.parse(result.data));
|
|
2255
2243
|
});
|
|
2256
2244
|
}
|
|
2257
2245
|
viewQuadrilateralForFrameQuadrilateral(quadrilateral) {
|
|
2258
|
-
return __awaiter(this,
|
|
2246
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2259
2247
|
const result = yield this._proxy.viewQuadrilateralForFrameQuadrilateral(JSON.stringify(quadrilateral.toJSON()));
|
|
2260
2248
|
return Quadrilateral.fromJSON(JSON.parse(result.data));
|
|
2261
2249
|
});
|
|
@@ -2270,7 +2258,7 @@ class DataCaptureViewController extends BaseController {
|
|
|
2270
2258
|
return this._proxy.hide();
|
|
2271
2259
|
}
|
|
2272
2260
|
createNativeView() {
|
|
2273
|
-
return __awaiter(this,
|
|
2261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2274
2262
|
yield this.createView();
|
|
2275
2263
|
this.subscribeListener();
|
|
2276
2264
|
});
|
|
@@ -2290,7 +2278,7 @@ class DataCaptureViewController extends BaseController {
|
|
|
2290
2278
|
subscribeListener() {
|
|
2291
2279
|
var _a, _b;
|
|
2292
2280
|
this._proxy.registerListenerForViewEvents();
|
|
2293
|
-
(_b = (_a = this._proxy).subscribeDidChangeSize) === null || _b ===
|
|
2281
|
+
(_b = (_a = this._proxy).subscribeDidChangeSize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2294
2282
|
this.eventEmitter.on(DataCaptureViewEvents.didChangeSize, (data) => {
|
|
2295
2283
|
const event = EventDataParser.parse(data);
|
|
2296
2284
|
if (event === null) {
|
|
@@ -2463,7 +2451,7 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2463
2451
|
this.controller.updateView();
|
|
2464
2452
|
}
|
|
2465
2453
|
createNativeView() {
|
|
2466
|
-
return __awaiter(this,
|
|
2454
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2467
2455
|
if (this.isViewCreated) {
|
|
2468
2456
|
return Promise.resolve();
|
|
2469
2457
|
}
|
|
@@ -2472,7 +2460,7 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2472
2460
|
});
|
|
2473
2461
|
}
|
|
2474
2462
|
removeNativeView() {
|
|
2475
|
-
return __awaiter(this,
|
|
2463
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2476
2464
|
if (!this.isViewCreated) {
|
|
2477
2465
|
return Promise.resolve();
|
|
2478
2466
|
}
|
|
@@ -2508,46 +2496,46 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2508
2496
|
}
|
|
2509
2497
|
__decorate([
|
|
2510
2498
|
ignoreFromSerialization
|
|
2511
|
-
], BaseDataCaptureView.prototype, "_context",
|
|
2499
|
+
], BaseDataCaptureView.prototype, "_context", void 0);
|
|
2512
2500
|
__decorate([
|
|
2513
2501
|
ignoreFromSerialization
|
|
2514
|
-
], BaseDataCaptureView.prototype, "viewComponent",
|
|
2502
|
+
], BaseDataCaptureView.prototype, "viewComponent", void 0);
|
|
2515
2503
|
__decorate([
|
|
2516
2504
|
ignoreFromSerialization
|
|
2517
2505
|
], BaseDataCaptureView.prototype, "coreDefaults", null);
|
|
2518
2506
|
__decorate([
|
|
2519
2507
|
nameForSerialization('scanAreaMargins')
|
|
2520
|
-
], BaseDataCaptureView.prototype, "_scanAreaMargins",
|
|
2508
|
+
], BaseDataCaptureView.prototype, "_scanAreaMargins", void 0);
|
|
2521
2509
|
__decorate([
|
|
2522
2510
|
ignoreFromSerializationIfNull
|
|
2523
|
-
], BaseDataCaptureView.prototype, "viewId",
|
|
2511
|
+
], BaseDataCaptureView.prototype, "viewId", void 0);
|
|
2524
2512
|
__decorate([
|
|
2525
2513
|
nameForSerialization('pointOfInterest')
|
|
2526
|
-
], BaseDataCaptureView.prototype, "_pointOfInterest",
|
|
2514
|
+
], BaseDataCaptureView.prototype, "_pointOfInterest", void 0);
|
|
2527
2515
|
__decorate([
|
|
2528
2516
|
nameForSerialization('logoAnchor')
|
|
2529
|
-
], BaseDataCaptureView.prototype, "_logoAnchor",
|
|
2517
|
+
], BaseDataCaptureView.prototype, "_logoAnchor", void 0);
|
|
2530
2518
|
__decorate([
|
|
2531
2519
|
nameForSerialization('logoOffset')
|
|
2532
|
-
], BaseDataCaptureView.prototype, "_logoOffset",
|
|
2520
|
+
], BaseDataCaptureView.prototype, "_logoOffset", void 0);
|
|
2533
2521
|
__decorate([
|
|
2534
2522
|
nameForSerialization('focusGesture')
|
|
2535
|
-
], BaseDataCaptureView.prototype, "_focusGesture",
|
|
2523
|
+
], BaseDataCaptureView.prototype, "_focusGesture", void 0);
|
|
2536
2524
|
__decorate([
|
|
2537
2525
|
nameForSerialization('zoomGesture')
|
|
2538
|
-
], BaseDataCaptureView.prototype, "_zoomGesture",
|
|
2526
|
+
], BaseDataCaptureView.prototype, "_zoomGesture", void 0);
|
|
2539
2527
|
__decorate([
|
|
2540
2528
|
nameForSerialization('logoStyle')
|
|
2541
|
-
], BaseDataCaptureView.prototype, "_logoStyle",
|
|
2529
|
+
], BaseDataCaptureView.prototype, "_logoStyle", void 0);
|
|
2542
2530
|
__decorate([
|
|
2543
2531
|
ignoreFromSerialization
|
|
2544
|
-
], BaseDataCaptureView.prototype, "controller",
|
|
2532
|
+
], BaseDataCaptureView.prototype, "controller", void 0);
|
|
2545
2533
|
__decorate([
|
|
2546
2534
|
ignoreFromSerialization
|
|
2547
|
-
], BaseDataCaptureView.prototype, "listeners",
|
|
2535
|
+
], BaseDataCaptureView.prototype, "listeners", void 0);
|
|
2548
2536
|
__decorate([
|
|
2549
2537
|
ignoreFromSerialization
|
|
2550
|
-
], BaseDataCaptureView.prototype, "isViewCreated",
|
|
2538
|
+
], BaseDataCaptureView.prototype, "isViewCreated", void 0);
|
|
2551
2539
|
|
|
2552
2540
|
class ZoomSwitchControl extends DefaultSerializeable {
|
|
2553
2541
|
constructor() {
|
|
@@ -2563,76 +2551,76 @@ class ZoomSwitchControl extends DefaultSerializeable {
|
|
|
2563
2551
|
}
|
|
2564
2552
|
get zoomedOutImage() {
|
|
2565
2553
|
var _a, _b;
|
|
2566
|
-
if (((_a = this.icon.zoomedOut.default) === null || _a ===
|
|
2567
|
-
return (_b = this.icon.zoomedOut.default) === null || _b ===
|
|
2554
|
+
if (((_a = this.icon.zoomedOut.default) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2555
|
+
return (_b = this.icon.zoomedOut.default) === null || _b === void 0 ? void 0 : _b.data;
|
|
2568
2556
|
}
|
|
2569
2557
|
return null;
|
|
2570
2558
|
}
|
|
2571
2559
|
set zoomedOutImage(zoomedOutImage) {
|
|
2572
2560
|
var _a;
|
|
2573
2561
|
this.icon.zoomedOut.default = ControlImage.fromBase64EncodedImage(zoomedOutImage);
|
|
2574
|
-
(_a = this.view) === null || _a ===
|
|
2562
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2575
2563
|
}
|
|
2576
2564
|
get zoomedInImage() {
|
|
2577
2565
|
var _a, _b;
|
|
2578
|
-
if (((_a = this.icon.zoomedIn.default) === null || _a ===
|
|
2579
|
-
return (_b = this.icon.zoomedIn.default) === null || _b ===
|
|
2566
|
+
if (((_a = this.icon.zoomedIn.default) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2567
|
+
return (_b = this.icon.zoomedIn.default) === null || _b === void 0 ? void 0 : _b.data;
|
|
2580
2568
|
}
|
|
2581
2569
|
return null;
|
|
2582
2570
|
}
|
|
2583
2571
|
set zoomedInImage(zoomedInImage) {
|
|
2584
2572
|
var _a;
|
|
2585
2573
|
this.icon.zoomedIn.default = ControlImage.fromBase64EncodedImage(zoomedInImage);
|
|
2586
|
-
(_a = this.view) === null || _a ===
|
|
2574
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2587
2575
|
}
|
|
2588
2576
|
get zoomedInPressedImage() {
|
|
2589
2577
|
var _a, _b;
|
|
2590
|
-
if (((_a = this.icon.zoomedIn.pressed) === null || _a ===
|
|
2591
|
-
return (_b = this.icon.zoomedIn.pressed) === null || _b ===
|
|
2578
|
+
if (((_a = this.icon.zoomedIn.pressed) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2579
|
+
return (_b = this.icon.zoomedIn.pressed) === null || _b === void 0 ? void 0 : _b.data;
|
|
2592
2580
|
}
|
|
2593
2581
|
return null;
|
|
2594
2582
|
}
|
|
2595
2583
|
set zoomedInPressedImage(zoomedInPressedImage) {
|
|
2596
2584
|
var _a;
|
|
2597
2585
|
this.icon.zoomedIn.pressed = ControlImage.fromBase64EncodedImage(zoomedInPressedImage);
|
|
2598
|
-
(_a = this.view) === null || _a ===
|
|
2586
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2599
2587
|
}
|
|
2600
2588
|
get zoomedOutPressedImage() {
|
|
2601
2589
|
var _a, _b;
|
|
2602
|
-
if (((_a = this.icon.zoomedOut.pressed) === null || _a ===
|
|
2603
|
-
return (_b = this.icon.zoomedOut.pressed) === null || _b ===
|
|
2590
|
+
if (((_a = this.icon.zoomedOut.pressed) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2591
|
+
return (_b = this.icon.zoomedOut.pressed) === null || _b === void 0 ? void 0 : _b.data;
|
|
2604
2592
|
}
|
|
2605
2593
|
return null;
|
|
2606
2594
|
}
|
|
2607
2595
|
set zoomedOutPressedImage(zoomedOutPressedImage) {
|
|
2608
2596
|
var _a;
|
|
2609
2597
|
this.icon.zoomedOut.pressed = ControlImage.fromBase64EncodedImage(zoomedOutPressedImage);
|
|
2610
|
-
(_a = this.view) === null || _a ===
|
|
2598
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2611
2599
|
}
|
|
2612
2600
|
setZoomedInImage(resource) {
|
|
2613
2601
|
var _a;
|
|
2614
2602
|
this.icon.zoomedIn.default = ControlImage.fromResourceName(resource);
|
|
2615
|
-
(_a = this.view) === null || _a ===
|
|
2603
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2616
2604
|
}
|
|
2617
2605
|
setZoomedInPressedImage(resource) {
|
|
2618
2606
|
var _a;
|
|
2619
2607
|
this.icon.zoomedIn.pressed = ControlImage.fromResourceName(resource);
|
|
2620
|
-
(_a = this.view) === null || _a ===
|
|
2608
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2621
2609
|
}
|
|
2622
2610
|
setZoomedOutImage(resource) {
|
|
2623
2611
|
var _a;
|
|
2624
2612
|
this.icon.zoomedOut.default = ControlImage.fromResourceName(resource);
|
|
2625
|
-
(_a = this.view) === null || _a ===
|
|
2613
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2626
2614
|
}
|
|
2627
2615
|
setZoomedOutPressedImage(resource) {
|
|
2628
2616
|
var _a;
|
|
2629
2617
|
this.icon.zoomedOut.pressed = ControlImage.fromResourceName(resource);
|
|
2630
|
-
(_a = this.view) === null || _a ===
|
|
2618
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2631
2619
|
}
|
|
2632
2620
|
}
|
|
2633
2621
|
__decorate([
|
|
2634
2622
|
ignoreFromSerialization
|
|
2635
|
-
], ZoomSwitchControl.prototype, "view",
|
|
2623
|
+
], ZoomSwitchControl.prototype, "view", void 0);
|
|
2636
2624
|
|
|
2637
2625
|
class TorchSwitchControl extends DefaultSerializeable {
|
|
2638
2626
|
constructor() {
|
|
@@ -2648,66 +2636,66 @@ class TorchSwitchControl extends DefaultSerializeable {
|
|
|
2648
2636
|
}
|
|
2649
2637
|
get torchOffImage() {
|
|
2650
2638
|
var _a, _b;
|
|
2651
|
-
if (((_a = this.icon.off.default) === null || _a ===
|
|
2652
|
-
return (_b = this.icon.off.default) === null || _b ===
|
|
2639
|
+
if (((_a = this.icon.off.default) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2640
|
+
return (_b = this.icon.off.default) === null || _b === void 0 ? void 0 : _b.data;
|
|
2653
2641
|
}
|
|
2654
2642
|
return null;
|
|
2655
2643
|
}
|
|
2656
2644
|
set torchOffImage(torchOffImage) {
|
|
2657
2645
|
var _a;
|
|
2658
2646
|
this.icon.off.default = ControlImage.fromBase64EncodedImage(torchOffImage);
|
|
2659
|
-
(_a = this.view) === null || _a ===
|
|
2647
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2660
2648
|
}
|
|
2661
2649
|
get torchOffPressedImage() {
|
|
2662
2650
|
var _a, _b;
|
|
2663
|
-
if (((_a = this.icon.off.pressed) === null || _a ===
|
|
2664
|
-
return (_b = this.icon.off.pressed) === null || _b ===
|
|
2651
|
+
if (((_a = this.icon.off.pressed) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2652
|
+
return (_b = this.icon.off.pressed) === null || _b === void 0 ? void 0 : _b.data;
|
|
2665
2653
|
}
|
|
2666
2654
|
return null;
|
|
2667
2655
|
}
|
|
2668
2656
|
set torchOffPressedImage(torchOffPressedImage) {
|
|
2669
2657
|
var _a;
|
|
2670
2658
|
this.icon.off.pressed = ControlImage.fromBase64EncodedImage(torchOffPressedImage);
|
|
2671
|
-
(_a = this.view) === null || _a ===
|
|
2659
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2672
2660
|
}
|
|
2673
2661
|
get torchOnImage() {
|
|
2674
2662
|
var _a, _b;
|
|
2675
|
-
if (((_a = this.icon.on.default) === null || _a ===
|
|
2676
|
-
return (_b = this.icon.on.default) === null || _b ===
|
|
2663
|
+
if (((_a = this.icon.on.default) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2664
|
+
return (_b = this.icon.on.default) === null || _b === void 0 ? void 0 : _b.data;
|
|
2677
2665
|
}
|
|
2678
2666
|
return null;
|
|
2679
2667
|
}
|
|
2680
2668
|
set torchOnImage(torchOnImage) {
|
|
2681
2669
|
var _a;
|
|
2682
2670
|
this.icon.on.default = ControlImage.fromBase64EncodedImage(torchOnImage);
|
|
2683
|
-
(_a = this.view) === null || _a ===
|
|
2671
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2684
2672
|
}
|
|
2685
2673
|
get torchOnPressedImage() {
|
|
2686
2674
|
var _a, _b;
|
|
2687
|
-
if (((_a = this.icon.on.pressed) === null || _a ===
|
|
2688
|
-
return (_b = this.icon.on.pressed) === null || _b ===
|
|
2675
|
+
if (((_a = this.icon.on.pressed) === null || _a === void 0 ? void 0 : _a.isBase64EncodedImage()) == true) {
|
|
2676
|
+
return (_b = this.icon.on.pressed) === null || _b === void 0 ? void 0 : _b.data;
|
|
2689
2677
|
}
|
|
2690
2678
|
return null;
|
|
2691
2679
|
}
|
|
2692
2680
|
setTorchOffImage(resource) {
|
|
2693
2681
|
var _a;
|
|
2694
2682
|
this.icon.off.default = ControlImage.fromResourceName(resource);
|
|
2695
|
-
(_a = this.view) === null || _a ===
|
|
2683
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2696
2684
|
}
|
|
2697
2685
|
setTorchOffPressedImage(resource) {
|
|
2698
2686
|
var _a;
|
|
2699
2687
|
this.icon.off.pressed = ControlImage.fromResourceName(resource);
|
|
2700
|
-
(_a = this.view) === null || _a ===
|
|
2688
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2701
2689
|
}
|
|
2702
2690
|
setTorchOnImage(resource) {
|
|
2703
2691
|
var _a;
|
|
2704
2692
|
this.icon.on.default = ControlImage.fromResourceName(resource);
|
|
2705
|
-
(_a = this.view) === null || _a ===
|
|
2693
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2706
2694
|
}
|
|
2707
2695
|
setTorchOnPressedImage(resource) {
|
|
2708
2696
|
var _a;
|
|
2709
2697
|
this.icon.on.pressed = ControlImage.fromResourceName(resource);
|
|
2710
|
-
(_a = this.view) === null || _a ===
|
|
2698
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2711
2699
|
}
|
|
2712
2700
|
setImageResource(resource) {
|
|
2713
2701
|
var _a;
|
|
@@ -2715,17 +2703,17 @@ class TorchSwitchControl extends DefaultSerializeable {
|
|
|
2715
2703
|
this.icon.off.pressed = ControlImage.fromResourceName(resource);
|
|
2716
2704
|
this.icon.on.default = ControlImage.fromResourceName(resource);
|
|
2717
2705
|
this.icon.on.pressed = ControlImage.fromResourceName(resource);
|
|
2718
|
-
(_a = this.view) === null || _a ===
|
|
2706
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2719
2707
|
}
|
|
2720
2708
|
set torchOnPressedImage(torchOnPressedImage) {
|
|
2721
2709
|
var _a;
|
|
2722
2710
|
this.icon.on.pressed = ControlImage.fromBase64EncodedImage(torchOnPressedImage);
|
|
2723
|
-
(_a = this.view) === null || _a ===
|
|
2711
|
+
(_a = this.view) === null || _a === void 0 ? void 0 : _a.controlUpdated();
|
|
2724
2712
|
}
|
|
2725
2713
|
}
|
|
2726
2714
|
__decorate([
|
|
2727
2715
|
ignoreFromSerialization
|
|
2728
|
-
], TorchSwitchControl.prototype, "view",
|
|
2716
|
+
], TorchSwitchControl.prototype, "view", void 0);
|
|
2729
2717
|
|
|
2730
2718
|
var VideoResolution;
|
|
2731
2719
|
(function (VideoResolution) {
|
|
@@ -2840,7 +2828,7 @@ class CameraSettings extends DefaultSerializeable {
|
|
|
2840
2828
|
}
|
|
2841
2829
|
__decorate([
|
|
2842
2830
|
ignoreFromSerialization
|
|
2843
|
-
], CameraSettings.prototype, "focusHiddenProperties",
|
|
2831
|
+
], CameraSettings.prototype, "focusHiddenProperties", void 0);
|
|
2844
2832
|
|
|
2845
2833
|
const NoViewfinder = { type: 'none' };
|
|
2846
2834
|
|
|
@@ -2862,7 +2850,7 @@ class RectangularViewfinderAnimation extends DefaultSerializeable {
|
|
|
2862
2850
|
}
|
|
2863
2851
|
__decorate([
|
|
2864
2852
|
nameForSerialization('isLooping')
|
|
2865
|
-
], RectangularViewfinderAnimation.prototype, "_isLooping",
|
|
2853
|
+
], RectangularViewfinderAnimation.prototype, "_isLooping", void 0);
|
|
2866
2854
|
|
|
2867
2855
|
class RectangularViewfinder extends DefaultSerializeable {
|
|
2868
2856
|
get sizeWithUnitAndAspect() {
|
|
@@ -2945,29 +2933,29 @@ class RectangularViewfinder extends DefaultSerializeable {
|
|
|
2945
2933
|
}
|
|
2946
2934
|
__decorate([
|
|
2947
2935
|
nameForSerialization('style')
|
|
2948
|
-
], RectangularViewfinder.prototype, "_style",
|
|
2936
|
+
], RectangularViewfinder.prototype, "_style", void 0);
|
|
2949
2937
|
__decorate([
|
|
2950
2938
|
nameForSerialization('lineStyle')
|
|
2951
|
-
], RectangularViewfinder.prototype, "_lineStyle",
|
|
2939
|
+
], RectangularViewfinder.prototype, "_lineStyle", void 0);
|
|
2952
2940
|
__decorate([
|
|
2953
2941
|
nameForSerialization('dimming')
|
|
2954
|
-
], RectangularViewfinder.prototype, "_dimming",
|
|
2942
|
+
], RectangularViewfinder.prototype, "_dimming", void 0);
|
|
2955
2943
|
__decorate([
|
|
2956
2944
|
nameForSerialization('disabledDimming')
|
|
2957
|
-
], RectangularViewfinder.prototype, "_disabledDimming",
|
|
2945
|
+
], RectangularViewfinder.prototype, "_disabledDimming", void 0);
|
|
2958
2946
|
__decorate([
|
|
2959
2947
|
nameForSerialization('animation'),
|
|
2960
2948
|
ignoreFromSerialization
|
|
2961
|
-
], RectangularViewfinder.prototype, "_animation",
|
|
2949
|
+
], RectangularViewfinder.prototype, "_animation", void 0);
|
|
2962
2950
|
__decorate([
|
|
2963
2951
|
nameForSerialization('size')
|
|
2964
|
-
], RectangularViewfinder.prototype, "_sizeWithUnitAndAspect",
|
|
2952
|
+
], RectangularViewfinder.prototype, "_sizeWithUnitAndAspect", void 0);
|
|
2965
2953
|
__decorate([
|
|
2966
2954
|
nameForSerialization('disabledColor')
|
|
2967
|
-
], RectangularViewfinder.prototype, "_disabledColor",
|
|
2955
|
+
], RectangularViewfinder.prototype, "_disabledColor", void 0);
|
|
2968
2956
|
__decorate([
|
|
2969
2957
|
ignoreFromSerialization
|
|
2970
|
-
], RectangularViewfinder.prototype, "eventEmitter",
|
|
2958
|
+
], RectangularViewfinder.prototype, "eventEmitter", void 0);
|
|
2971
2959
|
|
|
2972
2960
|
var RectangularViewfinderStyle;
|
|
2973
2961
|
(function (RectangularViewfinderStyle) {
|
|
@@ -3107,11 +3095,11 @@ class WaveFormVibration extends Vibration {
|
|
|
3107
3095
|
}
|
|
3108
3096
|
__decorate([
|
|
3109
3097
|
nameForSerialization('timings')
|
|
3110
|
-
], WaveFormVibration.prototype, "_timings",
|
|
3098
|
+
], WaveFormVibration.prototype, "_timings", void 0);
|
|
3111
3099
|
__decorate([
|
|
3112
3100
|
ignoreFromSerializationIfNull,
|
|
3113
3101
|
nameForSerialization('amplitudes')
|
|
3114
|
-
], WaveFormVibration.prototype, "_amplitudes",
|
|
3102
|
+
], WaveFormVibration.prototype, "_amplitudes", void 0);
|
|
3115
3103
|
|
|
3116
3104
|
class Sound extends DefaultSerializeable {
|
|
3117
3105
|
static get defaultSound() {
|
|
@@ -3128,7 +3116,7 @@ class Sound extends DefaultSerializeable {
|
|
|
3128
3116
|
}
|
|
3129
3117
|
__decorate([
|
|
3130
3118
|
ignoreFromSerializationIfNull
|
|
3131
|
-
], Sound.prototype, "resource",
|
|
3119
|
+
], Sound.prototype, "resource", void 0);
|
|
3132
3120
|
|
|
3133
3121
|
class FeedbackController {
|
|
3134
3122
|
constructor(feedback) {
|
|
@@ -3155,7 +3143,7 @@ class Feedback extends DefaultSerializeable {
|
|
|
3155
3143
|
return this._sound;
|
|
3156
3144
|
}
|
|
3157
3145
|
static fromJSON(json) {
|
|
3158
|
-
return new Feedback((json === null || json ===
|
|
3146
|
+
return new Feedback((json === null || json === void 0 ? void 0 : json.vibration) ? Vibration.fromJSON(json.vibration) : null, (json === null || json === void 0 ? void 0 : json.sound) ? Sound.fromJSON(json.sound) : null);
|
|
3159
3147
|
}
|
|
3160
3148
|
constructor(vibration, sound) {
|
|
3161
3149
|
super();
|
|
@@ -3175,14 +3163,14 @@ class Feedback extends DefaultSerializeable {
|
|
|
3175
3163
|
__decorate([
|
|
3176
3164
|
ignoreFromSerializationIfNull,
|
|
3177
3165
|
nameForSerialization('vibration')
|
|
3178
|
-
], Feedback.prototype, "_vibration",
|
|
3166
|
+
], Feedback.prototype, "_vibration", void 0);
|
|
3179
3167
|
__decorate([
|
|
3180
3168
|
ignoreFromSerializationIfNull,
|
|
3181
3169
|
nameForSerialization('sound')
|
|
3182
|
-
], Feedback.prototype, "_sound",
|
|
3170
|
+
], Feedback.prototype, "_sound", void 0);
|
|
3183
3171
|
__decorate([
|
|
3184
3172
|
ignoreFromSerialization
|
|
3185
|
-
], Feedback.prototype, "controller",
|
|
3173
|
+
], Feedback.prototype, "controller", void 0);
|
|
3186
3174
|
|
|
3187
3175
|
const NoneLocationSelection = { type: 'none' };
|
|
3188
3176
|
|
|
@@ -3202,7 +3190,7 @@ class RadiusLocationSelection extends DefaultSerializeable {
|
|
|
3202
3190
|
}
|
|
3203
3191
|
__decorate([
|
|
3204
3192
|
nameForSerialization('radius')
|
|
3205
|
-
], RadiusLocationSelection.prototype, "_radius",
|
|
3193
|
+
], RadiusLocationSelection.prototype, "_radius", void 0);
|
|
3206
3194
|
|
|
3207
3195
|
class RectangularLocationSelection extends DefaultSerializeable {
|
|
3208
3196
|
constructor() {
|
|
@@ -3264,7 +3252,7 @@ class RectangularLocationSelection extends DefaultSerializeable {
|
|
|
3264
3252
|
}
|
|
3265
3253
|
__decorate([
|
|
3266
3254
|
nameForSerialization('size')
|
|
3267
|
-
], RectangularLocationSelection.prototype, "_sizeWithUnitAndAspect",
|
|
3255
|
+
], RectangularLocationSelection.prototype, "_sizeWithUnitAndAspect", void 0);
|
|
3268
3256
|
|
|
3269
3257
|
class LicenseInfo extends DefaultSerializeable {
|
|
3270
3258
|
get expiration() {
|
|
@@ -3274,7 +3262,7 @@ class LicenseInfo extends DefaultSerializeable {
|
|
|
3274
3262
|
__decorate([
|
|
3275
3263
|
nameForSerialization('expiration')
|
|
3276
3264
|
// @ts-ignore
|
|
3277
|
-
], LicenseInfo.prototype, "_expiration",
|
|
3265
|
+
], LicenseInfo.prototype, "_expiration", void 0);
|
|
3278
3266
|
|
|
3279
3267
|
var Expiration;
|
|
3280
3268
|
(function (Expiration) {
|
|
@@ -3283,7 +3271,146 @@ var Expiration;
|
|
|
3283
3271
|
Expiration["NotAvailable"] = "notAvailable";
|
|
3284
3272
|
})(Expiration || (Expiration = {}));
|
|
3285
3273
|
|
|
3274
|
+
class BaseInstanceAwareNativeProxy {
|
|
3275
|
+
constructor() {
|
|
3276
|
+
this.eventEmitter = new EventEmitter();
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
/**
|
|
3281
|
+
* JS Proxy hook to act as middleware to all the calls performed by an AdvancedNativeProxy instance
|
|
3282
|
+
* This will allow AdvancedNativeProxy to call dynamically the methods defined in the interface defined
|
|
3283
|
+
* as parameter in createAdvancedNativeProxy function
|
|
3284
|
+
*/
|
|
3285
|
+
const advancedInstanceAwareNativeProxyHook = {
|
|
3286
|
+
/**
|
|
3287
|
+
* Dynamic property getter for the AdvancedNativeProxy
|
|
3288
|
+
* In order to call a native method this needs to be preceded by the `$` symbol on the name, ie `$methodName`
|
|
3289
|
+
* In order to set a native event handler this needs to be preceded by `on$` prefix, ie `on$eventName`
|
|
3290
|
+
* @param advancedNativeProxy
|
|
3291
|
+
* @param prop
|
|
3292
|
+
*/
|
|
3293
|
+
get(advancedNativeProxy, prop) {
|
|
3294
|
+
// Important: $ and on$ are required since if they are not added all
|
|
3295
|
+
// properties present on AdvancedNativeProxy will be redirected to the
|
|
3296
|
+
// advancedNativeProxy._call, which will call native even for the own
|
|
3297
|
+
// properties of the class
|
|
3298
|
+
// All the methods with the following structure
|
|
3299
|
+
// $methodName will be redirected to the special _call
|
|
3300
|
+
// method on AdvancedNativeProxy
|
|
3301
|
+
if (prop.startsWith("$")) {
|
|
3302
|
+
if (prop in advancedNativeProxy) {
|
|
3303
|
+
return advancedNativeProxy[prop];
|
|
3304
|
+
}
|
|
3305
|
+
return (args) => {
|
|
3306
|
+
return advancedNativeProxy._call(prop.substring(1), args);
|
|
3307
|
+
};
|
|
3308
|
+
// All methods with the following structure
|
|
3309
|
+
// on$methodName will trigger the event handler properties
|
|
3310
|
+
}
|
|
3311
|
+
else if (prop.startsWith("on$")) {
|
|
3312
|
+
return advancedNativeProxy[prop.substring(3)];
|
|
3313
|
+
// Everything else will be taken as a property
|
|
3314
|
+
}
|
|
3315
|
+
else {
|
|
3316
|
+
return advancedNativeProxy[prop];
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
};
|
|
3320
|
+
/**
|
|
3321
|
+
* AdvancedNativeProxy will provide an easy way to communicate between native proxies
|
|
3322
|
+
* and other parts of the architecture such as the controller layer
|
|
3323
|
+
*/
|
|
3324
|
+
class AdvancedInstanceAwareNativeProxy extends BaseInstanceAwareNativeProxy {
|
|
3325
|
+
constructor(nativeCaller, events = []) {
|
|
3326
|
+
super();
|
|
3327
|
+
this.nativeCaller = nativeCaller;
|
|
3328
|
+
this.events = events;
|
|
3329
|
+
this.eventSubscriptions = new Map();
|
|
3330
|
+
this.eventHandlers = new Map();
|
|
3331
|
+
this.events.forEach((event) => __awaiter(this, void 0, void 0, function* () {
|
|
3332
|
+
yield this._registerEvent(event);
|
|
3333
|
+
}));
|
|
3334
|
+
// Wrapping the AdvancedNativeProxy instance with the JS proxy hook
|
|
3335
|
+
return new Proxy(this, advancedInstanceAwareNativeProxyHook);
|
|
3336
|
+
}
|
|
3337
|
+
dispose() {
|
|
3338
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3339
|
+
for (const event of this.events) {
|
|
3340
|
+
yield this._unregisterEvent(event);
|
|
3341
|
+
}
|
|
3342
|
+
this.eventSubscriptions.clear();
|
|
3343
|
+
this.events = [];
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3346
|
+
_call(fnName, args) {
|
|
3347
|
+
return this.nativeCaller.callFn(fnName, args);
|
|
3348
|
+
}
|
|
3349
|
+
_registerEvent(event) {
|
|
3350
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3351
|
+
const handler = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
3352
|
+
this.eventEmitter.emit(event.nativeEventName, args);
|
|
3353
|
+
});
|
|
3354
|
+
const instanceHandler = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
3355
|
+
try {
|
|
3356
|
+
const hookArg = this.nativeCaller.eventHook(args);
|
|
3357
|
+
yield this[`on$${event.name}`](hookArg);
|
|
3358
|
+
}
|
|
3359
|
+
catch (e) {
|
|
3360
|
+
console.error(`Error while trying to execute handler for ${event.nativeEventName}`, e);
|
|
3361
|
+
throw e;
|
|
3362
|
+
}
|
|
3363
|
+
});
|
|
3364
|
+
// Store the instance-specific handler
|
|
3365
|
+
this.eventHandlers.set(event.nativeEventName, instanceHandler);
|
|
3366
|
+
this.eventEmitter.on(event.nativeEventName, instanceHandler);
|
|
3367
|
+
const subscription = yield this.nativeCaller.registerEvent(event.nativeEventName, handler);
|
|
3368
|
+
this.eventSubscriptions.set(event.name, subscription);
|
|
3369
|
+
});
|
|
3370
|
+
}
|
|
3371
|
+
_unregisterEvent(event) {
|
|
3372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3373
|
+
const subscription = this.eventSubscriptions.get(event.name);
|
|
3374
|
+
yield this.nativeCaller.unregisterEvent(event.nativeEventName, subscription);
|
|
3375
|
+
// Get the instance-specific handler
|
|
3376
|
+
const handler = this.eventHandlers.get(event.nativeEventName);
|
|
3377
|
+
if (handler) {
|
|
3378
|
+
// Remove only this instance's handler
|
|
3379
|
+
this.eventEmitter.off(event.nativeEventName, handler);
|
|
3380
|
+
this.eventHandlers.delete(event.nativeEventName);
|
|
3381
|
+
}
|
|
3382
|
+
this.eventSubscriptions.delete(event.name);
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Function to create a custom AdvancedNativeProxy. This will return an object which will provide dynamically the
|
|
3388
|
+
* methods specified in the PROXY interface.
|
|
3389
|
+
*
|
|
3390
|
+
* The Proxy interface implemented in order to call native methods will require a special mark
|
|
3391
|
+
* `$methodName` for method calls
|
|
3392
|
+
* `on$methodName` for the listeners added to the events defined in eventsEnum
|
|
3393
|
+
* @param nativeCaller
|
|
3394
|
+
* @param eventsEnum
|
|
3395
|
+
*/
|
|
3396
|
+
function createAdvancedInstanceAwareNativeProxy(nativeCaller, eventsEnum = undefined) {
|
|
3397
|
+
const eventsList = eventsEnum == null ? [] : Object.entries(eventsEnum).map(([key, value]) => ({
|
|
3398
|
+
name: key,
|
|
3399
|
+
nativeEventName: value
|
|
3400
|
+
}));
|
|
3401
|
+
return new AdvancedInstanceAwareNativeProxy(nativeCaller, eventsList);
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
class BaseNewController {
|
|
3405
|
+
get _proxy() {
|
|
3406
|
+
return this._cachedProxy;
|
|
3407
|
+
}
|
|
3408
|
+
constructor(proxyName) {
|
|
3409
|
+
this._cachedProxy = FactoryMaker.createInstance(proxyName);
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3286
3413
|
createEventEmitter();
|
|
3287
3414
|
|
|
3288
|
-
export { AdvancedNativeProxy, AimerViewfinder, Anchor, BaseController, BaseDataCaptureView, BaseNativeProxy, BaseNewController, Brush, Camera, CameraController, CameraPosition, CameraSettings, Color, ContextStatus, ControlImage, DataCaptureContext, DataCaptureContextEvents, DataCaptureContextSettings, DataCaptureViewController, DataCaptureViewEvents, DefaultSerializeable, Direction, EventDataParser, EventEmitter, Expiration, FactoryMaker, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameSourceListenerEvents, FrameSourceState, HTMLElementState, HtmlElementPosition, HtmlElementSize, ImageBuffer, ImageFrameSource, LicenseInfo, LogoStyle, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, Observable, OpenSourceSoftwareLicenseInfo, Orientation, Point, PointWithUnit, PrivateFocusGestureDeserializer, PrivateFrameData, PrivateZoomGestureDeserializer, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VibrationType, VideoResolution, WaveFormVibration, ZoomSwitchControl, createAdvancedNativeFromCtorProxy, createAdvancedNativeProxy, getCoreDefaults, ignoreFromSerialization, ignoreFromSerializationIfNull, loadCoreDefaults, nameForSerialization, serializationDefault };
|
|
3415
|
+
export { AdvancedInstanceAwareNativeProxy, AdvancedNativeProxy, AimerViewfinder, Anchor, BaseController, BaseDataCaptureView, BaseInstanceAwareNativeProxy, BaseNativeProxy, BaseNewController, Brush, Camera, CameraController, CameraPosition, CameraSettings, Color, ContextStatus, ControlImage, DataCaptureContext, DataCaptureContextEvents, DataCaptureContextSettings, DataCaptureViewController, DataCaptureViewEvents, DefaultSerializeable, Direction, EventDataParser, EventEmitter, Expiration, FactoryMaker, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameSourceListenerEvents, FrameSourceState, HTMLElementState, HtmlElementPosition, HtmlElementSize, ImageBuffer, ImageFrameSource, LicenseInfo, LogoStyle, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, Observable, OpenSourceSoftwareLicenseInfo, Orientation, Point, PointWithUnit, PrivateFocusGestureDeserializer, PrivateFrameData, PrivateZoomGestureDeserializer, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VibrationType, VideoResolution, WaveFormVibration, ZoomSwitchControl, createAdvancedInstanceAwareNativeProxy, createAdvancedNativeFromCtorProxy, createAdvancedNativeProxy, getCoreDefaults, ignoreFromSerialization, ignoreFromSerializationIfNull, loadCoreDefaults, nameForSerialization, serializationDefault };
|
|
3289
3416
|
//# sourceMappingURL=index.js.map
|