@robotical/webapp-types 1.1.0 → 1.1.2
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-types/src/application/ApplicationManager/ApplicationManager.d.ts +13 -3
- package/dist-types/src/application/ApplicationManager/ApplicationManager.js +62 -26
- package/dist-types/src/application/RAFTs/Cog/Cog.d.ts +7 -2
- package/dist-types/src/application/RAFTs/Cog/Cog.js +27 -12
- package/dist-types/src/application/RAFTs/Cog/PublishedDataAnalyser.d.ts +64 -4
- package/dist-types/src/application/RAFTs/Cog/PublishedDataAnalyser.js +98 -37
- package/dist-types/src/application/RAFTs/Marty/Marty.js +1 -1
- package/dist-types/src/application/RAFTs/RAFT.d.ts +5 -4
- package/dist-types/src/application/RAFTs/RAFT.js +4 -4
- package/dist-types/src/application/communicators/SelfdestructiveMessagePromise.js +1 -1
- package/dist-types/src/components/modals/ConnectingLoadingSpinnerModal/index.d.ts +3 -0
- package/dist-types/src/components/modals/ConnectingLoadingSpinnerModal/index.js +16 -0
- package/dist-types/src/components/modals/DisconnectConfirmation/index.d.ts +1 -6
- package/dist-types/src/components/modals/DisconnectConfirmation/index.js +2 -59
- package/dist-types/src/components/modals/VerificationModal/index.js +1 -1
- package/dist-types/src/components/modals/VerificationModalPhoneApp/index.js +11 -6
- package/dist-types/src/services/logger/Logger.d.ts +1 -0
- package/dist-types/src/services/logger/Logger.js +10 -4
- package/dist-types/src/state-observables/modal/ModalObserver.d.ts +1 -0
- package/dist-types/src/state-observables/modal/ModalState.d.ts +1 -1
- package/dist-types/src/state-observables/modal/ModalState.js +3 -2
- package/dist-types/src/types/communication-between-apps/wrapper-communication.d.ts +4 -1
- package/dist-types/src/types/communication-between-apps/wrapper-communication.js +3 -0
- package/dist-types/src/wrapper-app/WrapperAppManager.d.ts +1 -1
- package/dist-types/src/wrapper-app/WrapperAppManager.js +2 -2
- package/dist-types/src/wrapper-app/communicators/WebAppCommunicator.js +1 -1
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.d.ts +5 -0
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.js +33 -1
- package/dist-types/src/wrapper-app/connectors/Connector.d.ts +4 -1
- package/dist-types/src/wrapper-app/connectors/Connector.js +10 -11
- package/dist-types/src/wrapper-app/connectors/ConnectorFactory.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/ConnectorFactory.js +2 -2
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.d.ts +5 -0
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.js +24 -0
- package/package.json +1 -1
|
@@ -13,15 +13,59 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
16
52
|
import { raftPubSubscriptionHelper } from "../raft-subscription-helpers";
|
|
17
53
|
import { isVersionGreater_errorCatching } from "../../../utils/helpers/compare-version";
|
|
18
|
-
import PublishedDataGetter from "./PublishedDataGetter";
|
|
19
54
|
import EventEmitter from "events";
|
|
55
|
+
import Logger from "../../../services/logger/Logger";
|
|
56
|
+
var SHOW_LOGS = true;
|
|
57
|
+
var TAG = "PublishedDataAnalyser";
|
|
20
58
|
var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
21
59
|
__extends(PublishedDataAnalyser, _super);
|
|
22
60
|
function PublishedDataAnalyser(cog) {
|
|
23
61
|
var _this = _super.call(this) || this;
|
|
24
62
|
_this.cog = cog;
|
|
63
|
+
_this.rotationDetection = new RotationDetection();
|
|
64
|
+
_this.shakeDetector = new ShakeDetector();
|
|
65
|
+
_this.buttonClickDetection = new ButtonClickDetection();
|
|
66
|
+
_this.tiltDetection = new TiltDetection();
|
|
67
|
+
_this.objectSenseDetection = new ObjectSenseDetection();
|
|
68
|
+
_this.lightSenseDetection = new LightSenseDetection();
|
|
25
69
|
_this.eventsMap = {
|
|
26
70
|
tilt: {
|
|
27
71
|
forward: "tiltForward",
|
|
@@ -58,7 +102,6 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
58
102
|
},
|
|
59
103
|
};
|
|
60
104
|
_this.TiltDetection = TiltDetection;
|
|
61
|
-
_this.PublishedDataGetter = PublishedDataGetter;
|
|
62
105
|
_this.cog = cog;
|
|
63
106
|
_this.cogState = {
|
|
64
107
|
tilt: "none",
|
|
@@ -84,20 +127,19 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
84
127
|
(_a = this.pubSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
85
128
|
};
|
|
86
129
|
PublishedDataAnalyser.prototype.analyse = function (data) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var gyroData =
|
|
91
|
-
|
|
92
|
-
var lightData = PublishedDataGetter.getLightData(data.deviceManager);
|
|
130
|
+
if (!data)
|
|
131
|
+
return;
|
|
132
|
+
var accelData = data.accelerometer;
|
|
133
|
+
var gyroData = data.gyroscope;
|
|
134
|
+
var lightData = data.light;
|
|
93
135
|
var isMoving;
|
|
94
136
|
if (accelData)
|
|
95
|
-
isMoving = shakeDetector.detectShake(accelData.ax, accelData.ay, accelData.az, Date.now(), this);
|
|
96
|
-
accelData && tiltDetection.detectTilt(accelData.ax, accelData.ay, accelData.az, isMoving, this, this.cog.getRaftVersion());
|
|
97
|
-
gyroData && rotationDetection.detectRotation(gyroData.gz, isMoving, this);
|
|
98
|
-
lightData && buttonClickDetection.detectButtonClick(lightData.ir2, this, this.cog.getRaftVersion());
|
|
99
|
-
lightData && objectSenseDetection.detectObjectSense([lightData.ir0, lightData.ir1], this);
|
|
100
|
-
lightData && lightSenseDetection.detectLightSense(lightData.amb0, this);
|
|
137
|
+
isMoving = this.shakeDetector.detectShake(accelData.ax, accelData.ay, accelData.az, Date.now(), this);
|
|
138
|
+
accelData && this.tiltDetection.detectTilt(accelData.ax, accelData.ay, accelData.az, isMoving, this, this.cog.getRaftVersion());
|
|
139
|
+
gyroData && this.rotationDetection.detectRotation(gyroData.gz, isMoving, this);
|
|
140
|
+
lightData && this.buttonClickDetection.detectButtonClick(lightData.ir2, this, this.cog.getRaftVersion());
|
|
141
|
+
lightData && this.objectSenseDetection.detectObjectSense([lightData.ir0, lightData.ir1], this);
|
|
142
|
+
lightData && this.lightSenseDetection.detectLightSense(lightData.amb0, this);
|
|
101
143
|
};
|
|
102
144
|
PublishedDataAnalyser.prototype.setTilt = function (tilt) {
|
|
103
145
|
this.cogState.tilt = tilt;
|
|
@@ -157,7 +199,7 @@ var TiltDetection = /** @class */ (function () {
|
|
|
157
199
|
if (isVersionGreater_errorCatching(cogVersion, correctionCutOffVersion)) {
|
|
158
200
|
tiltCorrection = tiltCorrectionForNewerCog;
|
|
159
201
|
}
|
|
160
|
-
var _a = TiltDetection.rotateAccelData(ax, ay, az, tiltCorrection), x = _a.x, y = _a.y, z = _a.z;
|
|
202
|
+
var _a = TiltDetection.rotateAccelData(ax, ay, az * -1, tiltCorrection), x = _a.x, y = _a.y, z = _a.z;
|
|
161
203
|
var pitch = Math.atan2(x, this.distance(y, z));
|
|
162
204
|
var roll = Math.atan2(y, this.distance(x, z));
|
|
163
205
|
var yaw = Math.atan2(z, this.distance(x, y));
|
|
@@ -275,7 +317,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
275
317
|
this.gravityVector = [xAcc, yAcc, zAcc];
|
|
276
318
|
if (this.moveInProgress) {
|
|
277
319
|
// console.log("move detected");
|
|
278
|
-
analyser.setMovementType("move");
|
|
320
|
+
// analyser.setMovementType("move");
|
|
279
321
|
}
|
|
280
322
|
else {
|
|
281
323
|
// console.log("no move detected");
|
|
@@ -284,7 +326,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
284
326
|
this.moveInProgress = false;
|
|
285
327
|
this.shakeInProgress = false;
|
|
286
328
|
this.sensorBundles = [];
|
|
287
|
-
return this.
|
|
329
|
+
return this.shakeInProgress;
|
|
288
330
|
}
|
|
289
331
|
else {
|
|
290
332
|
//console.log("move in progrss. prev state: ", this.moveInProgress);
|
|
@@ -309,7 +351,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
309
351
|
if (this.sensorBundles.length > this.thresholdShakeNumber) {
|
|
310
352
|
// console.log("Shake detected!");
|
|
311
353
|
this.sensorBundles = [];
|
|
312
|
-
this.shakeInProgress =
|
|
354
|
+
this.shakeInProgress = true;
|
|
313
355
|
analyser.setMovementType("shake");
|
|
314
356
|
}
|
|
315
357
|
}
|
|
@@ -321,11 +363,11 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
321
363
|
this.sensorBundles = [];
|
|
322
364
|
// console.log("resetting shake detector. Move detected");
|
|
323
365
|
// fire move detector
|
|
324
|
-
analyser.setMovementType("
|
|
366
|
+
analyser.setMovementType("none");
|
|
325
367
|
}
|
|
326
368
|
}
|
|
327
369
|
}
|
|
328
|
-
return this.
|
|
370
|
+
return this.shakeInProgress;
|
|
329
371
|
/*
|
|
330
372
|
if (this.sensorBundles.length === 0 || timestamp - this.lastTime > this.interval) {
|
|
331
373
|
// Check if we should reset based on time since last recorded shake
|
|
@@ -392,27 +434,18 @@ var ButtonClickDetection = /** @class */ (function () {
|
|
|
392
434
|
this.buttonClicked = false;
|
|
393
435
|
}
|
|
394
436
|
ButtonClickDetection.prototype.detectButtonClick = function (buttonValue, analyser, cogVersion) {
|
|
395
|
-
var correctionCutOffVersion = "1.2.0";
|
|
396
|
-
var clickThreshold = 1600;
|
|
397
|
-
if (isVersionGreater_errorCatching(cogVersion, correctionCutOffVersion)) {
|
|
398
|
-
clickThreshold = 1500;
|
|
399
|
-
}
|
|
400
|
-
var releaseThreshold = 1590;
|
|
401
|
-
if (isVersionGreater_errorCatching(cogVersion, correctionCutOffVersion)) {
|
|
402
|
-
releaseThreshold = 1490;
|
|
403
|
-
}
|
|
404
|
-
this.clickThreshold = clickThreshold;
|
|
405
|
-
this.releaseThreshold = releaseThreshold;
|
|
406
437
|
var currentTime = Date.now();
|
|
407
438
|
if (buttonValue > this.clickThreshold && !this.buttonClicked) {
|
|
408
439
|
// console.log("Button clicked", buttonValue);
|
|
409
440
|
this.buttonClicked = true;
|
|
410
441
|
this.lastTime = currentTime;
|
|
442
|
+
Logger.info(SHOW_LOGS, TAG, "Button clicked");
|
|
411
443
|
analyser.setButtonClick("click");
|
|
412
444
|
}
|
|
413
445
|
else if (buttonValue < this.releaseThreshold && this.buttonClicked) {
|
|
414
446
|
// console.log("Button released", buttonValue);
|
|
415
447
|
this.buttonClicked = false;
|
|
448
|
+
Logger.info(SHOW_LOGS, TAG, "Button released");
|
|
416
449
|
analyser.setButtonClick("release");
|
|
417
450
|
}
|
|
418
451
|
// } else {
|
|
@@ -422,6 +455,7 @@ var ButtonClickDetection = /** @class */ (function () {
|
|
|
422
455
|
};
|
|
423
456
|
return ButtonClickDetection;
|
|
424
457
|
}());
|
|
458
|
+
export { ButtonClickDetection };
|
|
425
459
|
var ObjectSenseDetection = /** @class */ (function () {
|
|
426
460
|
function ObjectSenseDetection() {
|
|
427
461
|
this.objectSensed0Threshold = 2500; // left of the arrow
|
|
@@ -463,10 +497,37 @@ var LightSenseDetection = /** @class */ (function () {
|
|
|
463
497
|
};
|
|
464
498
|
return LightSenseDetection;
|
|
465
499
|
}());
|
|
466
|
-
var
|
|
467
|
-
var
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
500
|
+
export var setButtonThresholdsUtil = function (connectedCog) { return __awaiter(void 0, void 0, void 0, function () {
|
|
501
|
+
var lightResponse, irMin, irMax, buttonClickDetection, error_1;
|
|
502
|
+
return __generator(this, function (_a) {
|
|
503
|
+
switch (_a.label) {
|
|
504
|
+
case 0:
|
|
505
|
+
Logger.info(SHOW_LOGS, TAG, "Setting button thresholds");
|
|
506
|
+
_a.label = 1;
|
|
507
|
+
case 1:
|
|
508
|
+
_a.trys.push([1, 3, , 4]);
|
|
509
|
+
return [4 /*yield*/, connectedCog.sendRestMessage('light')];
|
|
510
|
+
case 2:
|
|
511
|
+
lightResponse = _a.sent();
|
|
512
|
+
if (lightResponse && lightResponse.rslt === "ok" && lightResponse.light.irMax4) {
|
|
513
|
+
irMin = lightResponse.light.irMin4;
|
|
514
|
+
irMax = lightResponse.light.irMax4;
|
|
515
|
+
Logger.info(SHOW_LOGS, TAG, "Got button thresholds: irMin: ".concat(irMin, ", irMax: ").concat(irMax));
|
|
516
|
+
buttonClickDetection = connectedCog.publishedDataAnalyser.buttonClickDetection;
|
|
517
|
+
buttonClickDetection.clickThreshold = irMin + (irMax - irMin) / 2;
|
|
518
|
+
buttonClickDetection.releaseThreshold = buttonClickDetection.clickThreshold - 10;
|
|
519
|
+
Logger.info(SHOW_LOGS, TAG, "Set button thresholds: clickThreshold: ".concat(buttonClickDetection.clickThreshold, ", releaseThreshold: ").concat(buttonClickDetection.releaseThreshold));
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
Logger.warn(SHOW_LOGS, TAG, "Couldn't get button thresholds, probably older fw version");
|
|
523
|
+
}
|
|
524
|
+
return [3 /*break*/, 4];
|
|
525
|
+
case 3:
|
|
526
|
+
error_1 = _a.sent();
|
|
527
|
+
Logger.warn(SHOW_LOGS, TAG, "Couldn't get button thresholds, probably older fw version");
|
|
528
|
+
return [3 /*break*/, 4];
|
|
529
|
+
case 4: return [2 /*return*/];
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
}); };
|
|
472
533
|
export default PublishedDataAnalyser;
|
|
@@ -102,7 +102,7 @@ var Marty = /** @class */ (function (_super) {
|
|
|
102
102
|
}
|
|
103
103
|
this.rssiValues.push(newRssi);
|
|
104
104
|
var rssiAverage = this.rssiValues.reduce(function (sum, val) { return sum + val; }, 0) / this.rssiValues.length;
|
|
105
|
-
return
|
|
105
|
+
return rssiAverage;
|
|
106
106
|
};
|
|
107
107
|
/**
|
|
108
108
|
* Gets the battery strength of the RAFT
|
|
@@ -4,7 +4,8 @@ import { FOUND_RAFT_ON_DISCOVERY_RESPONSE } from "../../types/phone-app-communic
|
|
|
4
4
|
import RICInterface from "./RAFTInterface";
|
|
5
5
|
import { RaftObserver } from "./RaftObserver";
|
|
6
6
|
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent, RaftOKFail, RaftSystemInfo } from "@robotical/raftjs";
|
|
7
|
-
import {
|
|
7
|
+
import { RICLedLcdColours, RICStateInfo } from "@robotical/roboticaljs";
|
|
8
|
+
import { SimplifiedCogStateInfo } from "@robotical/roboticaljs/dist/SystemTypeCog/CogTypes";
|
|
8
9
|
export default class RAFT implements RICInterface {
|
|
9
10
|
id: string;
|
|
10
11
|
type: RaftTypeE;
|
|
@@ -14,7 +15,7 @@ export default class RAFT implements RICInterface {
|
|
|
14
15
|
};
|
|
15
16
|
isSerialNoRegisteredInWarranty: boolean | null;
|
|
16
17
|
systemInfo: RaftSystemInfo | null;
|
|
17
|
-
raftStateInfo: RICStateInfo |
|
|
18
|
+
raftStateInfo: RICStateInfo | SimplifiedCogStateInfo | null;
|
|
18
19
|
/**
|
|
19
20
|
* Method to get ledLcdColours, to be implemented in child classes.
|
|
20
21
|
*/
|
|
@@ -29,7 +30,7 @@ export default class RAFT implements RICInterface {
|
|
|
29
30
|
* Connect to a RAFT
|
|
30
31
|
* We first connect, then we discover the raft type, and then we create the appopriate raft instance
|
|
31
32
|
*/
|
|
32
|
-
static connect(method: RaftConnectionMethod,
|
|
33
|
+
static connect(method: RaftConnectionMethod, uuids: string[]): Promise<ConnectionAttemptResults>;
|
|
33
34
|
/**
|
|
34
35
|
* Disconnect from a RAFT
|
|
35
36
|
*/
|
|
@@ -41,7 +42,7 @@ export default class RAFT implements RICInterface {
|
|
|
41
42
|
/**
|
|
42
43
|
* Verify correct RAFT is selected for phone app
|
|
43
44
|
*/
|
|
44
|
-
verifyRaftPhoneApp(
|
|
45
|
+
verifyRaftPhoneApp(discoveredDevice: FOUND_RAFT_ON_DISCOVERY_RESPONSE['foundRIC']): Promise<boolean>;
|
|
45
46
|
/**
|
|
46
47
|
* Verify correct RAFT is selected
|
|
47
48
|
*/
|
|
@@ -84,12 +84,12 @@ var RAFT = /** @class */ (function () {
|
|
|
84
84
|
* Connect to a RAFT
|
|
85
85
|
* We first connect, then we discover the raft type, and then we create the appopriate raft instance
|
|
86
86
|
*/
|
|
87
|
-
RAFT.connect = function (method,
|
|
87
|
+
RAFT.connect = function (method, uuids) {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function () {
|
|
89
89
|
var connectResults;
|
|
90
90
|
return __generator(this, function (_a) {
|
|
91
91
|
switch (_a.label) {
|
|
92
|
-
case 0: return [4 /*yield*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.RAFT_CONNECT, { method: method,
|
|
92
|
+
case 0: return [4 /*yield*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.RAFT_CONNECT, { method: method, uuids: uuids })];
|
|
93
93
|
case 1:
|
|
94
94
|
connectResults = _a.sent();
|
|
95
95
|
return [2 /*return*/, connectResults];
|
|
@@ -126,10 +126,10 @@ var RAFT = /** @class */ (function () {
|
|
|
126
126
|
/**
|
|
127
127
|
* Verify correct RAFT is selected for phone app
|
|
128
128
|
*/
|
|
129
|
-
RAFT.prototype.verifyRaftPhoneApp = function (
|
|
129
|
+
RAFT.prototype.verifyRaftPhoneApp = function (discoveredDevice) {
|
|
130
130
|
return __awaiter(this, void 0, void 0, function () {
|
|
131
131
|
return __generator(this, function (_a) {
|
|
132
|
-
return [2 /*return*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.RAFT_VERIFY_PHONE, { ledLcdColours: this.ledLcdColours,
|
|
132
|
+
return [2 /*return*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.RAFT_VERIFY_PHONE, { ledLcdColours: this.ledLcdColours, discoveredDevice: discoveredDevice, raftId: this.id })];
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
135
|
};
|
|
@@ -13,7 +13,7 @@ var SelfdestructiveMessagePromise = /** @class */ (function () {
|
|
|
13
13
|
delete messagePromises[id];
|
|
14
14
|
};
|
|
15
15
|
this.reject = function (reason) {
|
|
16
|
-
|
|
16
|
+
resolve(reason); // on purpose resolving instead of rejecting
|
|
17
17
|
clearTimeout(_this.timeout);
|
|
18
18
|
delete messagePromises[id];
|
|
19
19
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import styles from "./styles.module.css";
|
|
14
|
+
export default function ConnectingLoadingSpinnerModal(_a) {
|
|
15
|
+
return (_jsx("div", __assign({ className: styles.container }, { children: "This shouldn't take long!" })));
|
|
16
|
+
}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type Props = {
|
|
3
|
-
connectedRaft?: RAFT;
|
|
4
|
-
};
|
|
5
|
-
export default function DisconnectConfirmationModal({ connectedRaft }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
export default function DisconnectConfirmationModal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
2
|
import modalState from "../../../state-observables/modal/ModalState";
|
|
39
|
-
import { useConnectedRafts } from "../../../store/SelectedRaftContext";
|
|
40
3
|
import { RED } from "../../../styles/colors";
|
|
41
4
|
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
42
5
|
import { Container } from "./styles";
|
|
43
|
-
export default function DisconnectConfirmationModal(
|
|
44
|
-
|
|
45
|
-
var connectedRaft = _a.connectedRaft;
|
|
46
|
-
var removeConnectedRaft = useConnectedRafts().removeConnectedRaft;
|
|
47
|
-
var disconnectHandler = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
48
|
-
return __generator(this, function (_a) {
|
|
49
|
-
switch (_a.label) {
|
|
50
|
-
case 0:
|
|
51
|
-
if (!connectedRaft) {
|
|
52
|
-
console.warn("No connected raft found", connectedRaft);
|
|
53
|
-
return [2 /*return*/];
|
|
54
|
-
}
|
|
55
|
-
return [4 /*yield*/, window.applicationManager.disconnectFromRaft(connectedRaft.id)];
|
|
56
|
-
case 1:
|
|
57
|
-
_a.sent();
|
|
58
|
-
removeConnectedRaft(connectedRaft.id);
|
|
59
|
-
modalState.closeModal();
|
|
60
|
-
return [2 /*return*/];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}); };
|
|
64
|
-
return (_jsxs(Container, { children: [_jsx(SimpleButton, { onClick: function () { return modalState.closeModal(); }, title: "Cancel" }), _jsx(SimpleButton, { onClick: disconnectHandler, title: "Disconnect", colour: RED })] }));
|
|
6
|
+
export default function DisconnectConfirmationModal() {
|
|
7
|
+
return (_jsxs(Container, { children: [_jsx(SimpleButton, { onClick: function () { return modalState.closeModal(false); }, title: "Cancel" }), _jsx(SimpleButton, { onClick: function () { return modalState.closeModal(true); }, title: "Disconnect", colour: RED })] }));
|
|
65
8
|
}
|
|
@@ -71,7 +71,7 @@ function VerificationModal(_a) {
|
|
|
71
71
|
return;
|
|
72
72
|
var signalUpdateTimout = setInterval(function () {
|
|
73
73
|
setRSSI(connectedRaft.getRSSI());
|
|
74
|
-
},
|
|
74
|
+
}, 1000);
|
|
75
75
|
return function () { return clearInterval(signalUpdateTimout); };
|
|
76
76
|
}, [connectedRaft]);
|
|
77
77
|
var onCancel = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -61,6 +61,7 @@ import isPhoneApp from "../../../utils/phone-app-communication/is-phone-app";
|
|
|
61
61
|
import LoadingSpinner from "../../disposables/LoadingSpinner";
|
|
62
62
|
import { RaftConnectionMethod } from "../../../types/raft";
|
|
63
63
|
import { useConnectedRafts } from "../../../store/SelectedRaftContext";
|
|
64
|
+
import { ConnManager } from "@robotical/roboticaljs";
|
|
64
65
|
var SHOW_LOGS = true;
|
|
65
66
|
var TAG = "VerificationModalPhone";
|
|
66
67
|
function VerificationModalPhoneApp(_a) {
|
|
@@ -92,8 +93,12 @@ function VerificationModalPhoneApp(_a) {
|
|
|
92
93
|
case 2:
|
|
93
94
|
_a.sent();
|
|
94
95
|
removeConnectedRaft(connectedRaft.id);
|
|
95
|
-
|
|
96
|
-
case 3:
|
|
96
|
+
return [3 /*break*/, 5];
|
|
97
|
+
case 3: return [4 /*yield*/, window.applicationManager.stopDiscovery()];
|
|
98
|
+
case 4:
|
|
99
|
+
_a.sent();
|
|
100
|
+
_a.label = 5;
|
|
101
|
+
case 5:
|
|
97
102
|
modalState.closeModal();
|
|
98
103
|
return [2 /*return*/];
|
|
99
104
|
}
|
|
@@ -115,7 +120,7 @@ function VerificationModalPhoneApp(_a) {
|
|
|
115
120
|
setSelectedRICIdx(-1);
|
|
116
121
|
setConnectedRaft(undefined);
|
|
117
122
|
if (!window.applicationManager.ricSelectedCb) return [3 /*break*/, 5];
|
|
118
|
-
return [4 /*yield*/, window.applicationManager.startDiscovery(window.applicationManager.ricSelectedCb)];
|
|
123
|
+
return [4 /*yield*/, window.applicationManager.startDiscovery(window.applicationManager.ricSelectedCb, [ConnManager.COGUUID, ConnManager.RICUUID])];
|
|
119
124
|
case 4:
|
|
120
125
|
_a.sent();
|
|
121
126
|
_a.label = 5;
|
|
@@ -144,7 +149,7 @@ function VerificationModalPhoneApp(_a) {
|
|
|
144
149
|
raftConnectingSubscriptionHelper(connectedRaft).unsubscribe();
|
|
145
150
|
};
|
|
146
151
|
}, [connectedRaft]);
|
|
147
|
-
var
|
|
152
|
+
var onSelectRaft = function (raftIdx) { return __awaiter(_this, void 0, void 0, function () {
|
|
148
153
|
var foundRaft, newRaft;
|
|
149
154
|
return __generator(this, function (_a) {
|
|
150
155
|
switch (_a.label) {
|
|
@@ -178,11 +183,11 @@ function VerificationModalPhoneApp(_a) {
|
|
|
178
183
|
}); };
|
|
179
184
|
var contentJSX = null;
|
|
180
185
|
if (foundRICs.length === 0) {
|
|
181
|
-
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [!isScanning && _jsx("p", __assign({ style: { alignSelf: 'center' } }, { children: "No
|
|
186
|
+
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [!isScanning && _jsx("p", __assign({ style: { alignSelf: 'center' } }, { children: "No Robots Found" })), _jsx("div", __assign({ className: "verification-modal-martys-container" }, { children: isScanning && _jsxs("div", __assign({ style: { margin: "auto", width: "50px", height: "50px" } }, { children: [" ", _jsx(LoadingSpinner, {}), " "] })) })), _jsxs("div", __assign({ className: "verification-modal-bottom-btns-container" }, { children: [_jsx(SVGImageButton, { onClick: onScanAgain, title: "SCAN AGAIN", SVGImage: RefreshSVG, backgroundColour: MAIN_BLUE, titleColour: WHITE, SVGColour: WHITE }), _jsx("div", { className: "dummy-gap" }), _jsx(SimpleButton, { onClick: onCancel, title: "CANCEL" })] }))] }));
|
|
182
187
|
}
|
|
183
188
|
else {
|
|
184
189
|
contentJSX = _jsxs("div", __assign({ className: "verification-modal-container" }, { children: [_jsxs("div", __assign({ className: "verification-modal-martys-container" }, { children: [isScanning && _jsxs("div", __assign({ style: { margin: "auto", width: "50px", height: "50px" } }, { children: [" ", _jsx(LoadingSpinner, {}), " "] })), foundRICs.map(function (raftObj, raftIdx) {
|
|
185
|
-
return _jsxs(Fragment, { children: [_jsxs("div", __assign({ className: "verification-modal-marty-name-row-container", onClick: function () { return
|
|
190
|
+
return _jsxs(Fragment, { children: [_jsxs("div", __assign({ className: "verification-modal-marty-name-row-container", onClick: function () { return onSelectRaft(raftIdx); } }, { children: [_jsx("p", __assign({ className: "verification-modal-marty-name" }, { children: raftObj._localName })), _jsx("div", __assign({ className: "verification-modal-marty-signal-container" }, { children: _jsx(RICSignal, { signalStrength: raftObj._rssi }) })), _jsx(BluetoothSVG, { fill: MAIN_BLUE })] })), selectedRICIdx === raftIdx && _jsxs("div", { children: [_jsx("p", __assign({ className: "verification-modal-martys-back-hint" }, { children: isLoading ? "Loading..." : "Look on ".concat(connectedRaft === null || connectedRaft === void 0 ? void 0 : connectedRaft.type, "'s back, is it displaying these lights?") })), _jsxs("div", __assign({ className: "verification-modal-led-row-container" }, { children: [_jsx(LEDs, { coloursArr: randomColours, connectedRaft: connectedRaft }), !isLoading && _jsx(SimpleButton, { onClick: onCancel, title: "No", borderColour: "red", colour: "white", textColour: "red" }), !isLoading && _jsx(SimpleButton, { onClick: onYes, title: "YES" })] }))] })] }, raftIdx);
|
|
186
191
|
})] })), _jsxs("div", __assign({ className: "verification-modal-bottom-btns-container" }, { children: [_jsx(SVGImageButton, { onClick: onScanAgain, title: "SCAN AGAIN", SVGImage: RefreshSVG, backgroundColour: MAIN_BLUE, titleColour: WHITE, SVGColour: WHITE, disabled: isScanning }), _jsx("div", { className: "dummy-gap" }), _jsx(SimpleButton, { onClick: onCancel, title: "CANCEL" })] }))] }));
|
|
187
192
|
}
|
|
188
193
|
return contentJSX;
|
|
@@ -3,5 +3,6 @@ declare class Logger {
|
|
|
3
3
|
static error(SHOW_LOGS: boolean, tag: string, message: string): void;
|
|
4
4
|
static debug(SHOW_LOGS: boolean, tag: string, message: string): void;
|
|
5
5
|
static warn(SHOW_LOGS: boolean, tag: string, message: string): void;
|
|
6
|
+
static phoneAppLog(SHOW_LOGS: boolean, tag: string, message: string): void;
|
|
6
7
|
}
|
|
7
8
|
export default Logger;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import { AppSentMessage } from "../../types/communication-between-apps/wrapper-communication";
|
|
2
|
+
var SHOW_LOGS_GLOBAL = true;
|
|
1
3
|
var Logger = /** @class */ (function () {
|
|
2
4
|
function Logger() {
|
|
3
5
|
}
|
|
4
6
|
Logger.info = function (SHOW_LOGS, tag, message) {
|
|
5
|
-
SHOW_LOGS && console.log('\x1b[34m%s\x1b[0m', "INFO: ".concat(tag), message); // Blue color for info logs
|
|
7
|
+
SHOW_LOGS_GLOBAL && SHOW_LOGS && console.log('\x1b[34m%s\x1b[0m', "INFO: ".concat(tag), message); // Blue color for info logs
|
|
6
8
|
};
|
|
7
9
|
Logger.error = function (SHOW_LOGS, tag, message) {
|
|
8
|
-
SHOW_LOGS && console.error('\x1b[31m%s\x1b[0m', "ERROR: ".concat(tag), message); // Red color for error logs
|
|
10
|
+
SHOW_LOGS_GLOBAL && SHOW_LOGS && console.error('\x1b[31m%s\x1b[0m', "ERROR: ".concat(tag), message); // Red color for error logs
|
|
9
11
|
};
|
|
10
12
|
Logger.debug = function (SHOW_LOGS, tag, message) {
|
|
11
|
-
SHOW_LOGS && console.debug('\x1b[35m%s\x1b[0m', "DEBUG: ".concat(tag), message); // Magenta color for debug logs
|
|
13
|
+
SHOW_LOGS_GLOBAL && SHOW_LOGS && console.debug('\x1b[35m%s\x1b[0m', "DEBUG: ".concat(tag), message); // Magenta color for debug logs
|
|
12
14
|
};
|
|
13
15
|
Logger.warn = function (SHOW_LOGS, tag, message) {
|
|
14
|
-
SHOW_LOGS && console.warn('\x1b[33m%s\x1b[0m', "WARN: ".concat(tag), message); // Yellow color for warning logs
|
|
16
|
+
SHOW_LOGS_GLOBAL && SHOW_LOGS && console.warn('\x1b[33m%s\x1b[0m', "WARN: ".concat(tag), message); // Yellow color for warning logs
|
|
17
|
+
};
|
|
18
|
+
Logger.phoneAppLog = function (SHOW_LOGS, tag, message) {
|
|
19
|
+
SHOW_LOGS_GLOBAL && SHOW_LOGS && console.log('\x1b[32m%s\x1b[0m', "PHONE APP: ".concat(tag), message); // Green color for phone app logs
|
|
20
|
+
SHOW_LOGS_GLOBAL && window.wrapperCommunicator.sendMessageNoWait(AppSentMessage.LOG, { showLogs: SHOW_LOGS, tag: tag, message: message });
|
|
15
21
|
};
|
|
16
22
|
return Logger;
|
|
17
23
|
}());
|
|
@@ -8,7 +8,7 @@ declare class ModalState implements ModalObservable {
|
|
|
8
8
|
private _modalResolve;
|
|
9
9
|
private _modalReject;
|
|
10
10
|
constructor();
|
|
11
|
-
setModal(modalContent: ModalContentType, modalTitle: string): Promise<ModalReturnValue>;
|
|
11
|
+
setModal(modalContent: ModalContentType, modalTitle: string, withLogo?: boolean): Promise<ModalReturnValue>;
|
|
12
12
|
closeModal(modalReturnValue?: ModalReturnValue, onCloseCb?: () => void): void;
|
|
13
13
|
updateModalProps(updatedProps: {
|
|
14
14
|
modalTitle?: string;
|
|
@@ -5,14 +5,15 @@ var ModalState = /** @class */ (function () {
|
|
|
5
5
|
this._modalResolve = function () { };
|
|
6
6
|
this._modalReject = function () { };
|
|
7
7
|
}
|
|
8
|
-
ModalState.prototype.setModal = function (modalContent, modalTitle) {
|
|
8
|
+
ModalState.prototype.setModal = function (modalContent, modalTitle, withLogo) {
|
|
9
9
|
var _this = this;
|
|
10
|
+
if (withLogo === void 0) { withLogo = true; }
|
|
10
11
|
this._modalPromise = new Promise(function (resolve, reject) {
|
|
11
12
|
_this._modalResolve = resolve;
|
|
12
13
|
_this._modalReject = reject;
|
|
13
14
|
_this.modalContent = modalContent;
|
|
14
15
|
_this.modalTitle = modalTitle;
|
|
15
|
-
_this.publish("SetModal", { modalContent: modalContent, modalTitle: modalTitle });
|
|
16
|
+
_this.publish("SetModal", { modalContent: modalContent, modalTitle: modalTitle, withLogo: withLogo });
|
|
16
17
|
});
|
|
17
18
|
return this._modalPromise;
|
|
18
19
|
};
|
|
@@ -17,6 +17,7 @@ export declare enum AppSentMessage {
|
|
|
17
17
|
RAFT_STOP_VERIFY = "RAFT_STOP_VERIFY",
|
|
18
18
|
RAFT_DISCONNECT = "RAFT_DISCONNECT",
|
|
19
19
|
RAFT_START_DISCOVERY = "RAFT_START_DISCOVERY",
|
|
20
|
+
RAFT_STOP_DISCOVERY = "RAFT_STOP_DISCOVERY",
|
|
20
21
|
RAFT_SELECT = "RAFT_SELECT",
|
|
21
22
|
RAFT_SEND_REST = "RAFT_SEND_REST",
|
|
22
23
|
GET_MISSED_CONN_EVENT = "GET_MISSED_CONN_EVENT",
|
|
@@ -25,7 +26,9 @@ export declare enum AppSentMessage {
|
|
|
25
26
|
SAVE_FILE_ON_DEVICE_LOCAL_STORAGE = "SAVE_FILE_ON_DEVICE_LOCAL_STORAGE",
|
|
26
27
|
LOAD_FILE_FROM_DEVICE_LOCAL_STORAGE = "LOAD_FILE_FROM_DEVICE_LOCAL_STORAGE",
|
|
27
28
|
DELETE_FILE_FROM_DEVICE_LOCAL_STORAGE = "DELETE_FILE_FROM_DEVICE_LOCAL_STORAGE",
|
|
28
|
-
LIST_FILES_FROM_DEVICE_LOCAL_STORAGE = "LIST_FILES_FROM_DEVICE_LOCAL_STORAGE"
|
|
29
|
+
LIST_FILES_FROM_DEVICE_LOCAL_STORAGE = "LIST_FILES_FROM_DEVICE_LOCAL_STORAGE",
|
|
30
|
+
LOG = "LOG",
|
|
31
|
+
INJECT_JS = "INJECT_JS"
|
|
29
32
|
}
|
|
30
33
|
export declare enum WrapperSentMessage {
|
|
31
34
|
RAFT_PUBLISHED_EVENT = "RAFT_PUBLISHED_EVENT",
|
|
@@ -8,6 +8,7 @@ export var AppSentMessage;
|
|
|
8
8
|
AppSentMessage["RAFT_STOP_VERIFY"] = "RAFT_STOP_VERIFY";
|
|
9
9
|
AppSentMessage["RAFT_DISCONNECT"] = "RAFT_DISCONNECT";
|
|
10
10
|
AppSentMessage["RAFT_START_DISCOVERY"] = "RAFT_START_DISCOVERY";
|
|
11
|
+
AppSentMessage["RAFT_STOP_DISCOVERY"] = "RAFT_STOP_DISCOVERY";
|
|
11
12
|
AppSentMessage["RAFT_SELECT"] = "RAFT_SELECT";
|
|
12
13
|
AppSentMessage["RAFT_SEND_REST"] = "RAFT_SEND_REST";
|
|
13
14
|
AppSentMessage["GET_MISSED_CONN_EVENT"] = "GET_MISSED_CONN_EVENT";
|
|
@@ -17,6 +18,8 @@ export var AppSentMessage;
|
|
|
17
18
|
AppSentMessage["LOAD_FILE_FROM_DEVICE_LOCAL_STORAGE"] = "LOAD_FILE_FROM_DEVICE_LOCAL_STORAGE";
|
|
18
19
|
AppSentMessage["DELETE_FILE_FROM_DEVICE_LOCAL_STORAGE"] = "DELETE_FILE_FROM_DEVICE_LOCAL_STORAGE";
|
|
19
20
|
AppSentMessage["LIST_FILES_FROM_DEVICE_LOCAL_STORAGE"] = "LIST_FILES_FROM_DEVICE_LOCAL_STORAGE";
|
|
21
|
+
AppSentMessage["LOG"] = "LOG";
|
|
22
|
+
AppSentMessage["INJECT_JS"] = "INJECT_JS";
|
|
20
23
|
})(AppSentMessage || (AppSentMessage = {}));
|
|
21
24
|
export var WrapperSentMessage;
|
|
22
25
|
(function (WrapperSentMessage) {
|
|
@@ -14,7 +14,7 @@ export declare class WrapperAppManager {
|
|
|
14
14
|
* @returns Promise<ConnectionAttemptResults>
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
connect(method: RaftConnectionMethod,
|
|
17
|
+
connect(method: RaftConnectionMethod, uuids: string[]): Promise<ConnectionAttemptResults>;
|
|
18
18
|
/**
|
|
19
19
|
* Re-triggers the connect event which was missed due to the connection logic
|
|
20
20
|
*/
|
|
@@ -55,12 +55,12 @@ var WrapperAppManager = /** @class */ (function () {
|
|
|
55
55
|
* @returns Promise<ConnectionAttemptResults>
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
|
-
WrapperAppManager.prototype.connect = function (method,
|
|
58
|
+
WrapperAppManager.prototype.connect = function (method, uuids) {
|
|
59
59
|
return __awaiter(this, void 0, void 0, function () {
|
|
60
60
|
var connector, connectionResults;
|
|
61
61
|
return __generator(this, function (_a) {
|
|
62
62
|
switch (_a.label) {
|
|
63
|
-
case 0: return [4 /*yield*/, ConnectorFactory.connectToRaftHelper(method,
|
|
63
|
+
case 0: return [4 /*yield*/, ConnectorFactory.connectToRaftHelper(method, uuids)];
|
|
64
64
|
case 1:
|
|
65
65
|
connector = _a.sent();
|
|
66
66
|
if (!connector) {
|