@robotical/webapp-types 3.17.51 → 3.18.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-types/src/application/ApplicationManager/ApplicationManager.d.ts +18 -10
- package/dist-types/src/application/ApplicationManager/ApplicationManager.js +177 -79
- package/dist-types/src/application/RAFTs/Cog/Cog.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Cog/Cog.js +1 -1
- package/dist-types/src/application/RAFTs/Marty/CalibrationManager.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Marty/CalibrationManager.js +1 -1
- package/dist-types/src/application/RAFTs/Marty/Marty.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Marty/Marty.js +1 -1
- package/dist-types/src/application/RAFTs/Marty/MartyWifiManager.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Marty/MartyWifiManager.js +1 -1
- package/dist-types/src/application/RAFTs/Marty/notifications-manager/ReportedWarningsState.js +1 -1
- package/dist-types/src/application/RAFTs/RAFT.d.ts +1 -1
- package/dist-types/src/application/RAFTs/RAFT.js +2 -2
- package/dist-types/src/application/RAFTs/RAFTInterface.d.ts +1 -1
- package/dist-types/src/application/RAFTs/RaftObserver.d.ts +1 -1
- package/dist-types/src/application/RAFTs/raft-subscription-helpers.js +1 -1
- package/dist-types/src/components/disposables/SwitchableCameraScanner/index.d.ts +4 -0
- package/dist-types/src/components/disposables/SwitchableCameraScanner/index.js +47 -0
- package/dist-types/src/components/modals/ConnectingLoadingSpinnerModal/index.d.ts +4 -2
- package/dist-types/src/components/modals/ConnectingLoadingSpinnerModal/index.js +14 -7
- package/dist-types/src/components/modals/LEDLightsOrQRVerificationModal/index.js +4 -4
- package/dist-types/src/components/modals/VerificationModal/index.js +0 -8
- package/dist-types/src/components/modals/VerificationModalPhoneApp/index.js +17 -32
- package/dist-types/src/components/oneoffs/LEDs/index.js +1 -1
- package/dist-types/src/i18n.js +2 -0
- package/dist-types/src/types/raft.d.ts +1 -1
- package/dist-types/src/utils/helpers/wifi-configuration-subtitle-gen.d.ts +1 -1
- package/dist-types/src/utils/helpers/wifi-configuration-subtitle-gen.js +1 -1
- package/dist-types/src/wrapper-app/WrapperAppManager.d.ts +16 -7
- package/dist-types/src/wrapper-app/WrapperAppManager.js +225 -55
- package/dist-types/src/wrapper-app/communicators/WebAppCommunicator.js +3 -6
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.js +1 -1
- package/dist-types/src/wrapper-app/connectors/Connector.d.ts +14 -2
- package/dist-types/src/wrapper-app/connectors/Connector.js +25 -1
- package/dist-types/src/wrapper-app/connectors/ConnectorFactory.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/ConnectorFactory.js +38 -7
- package/dist-types/src/wrapper-app/connectors/ConnectorInterface.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.js +9 -5
- package/dist-types/src/wrapper-app/utils/ColourSensorManualCalibratorMarty.d.ts +1 -1
- package/package.json +10 -1
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useMemo, useState } from "react";
|
|
25
|
+
import { useTranslation } from "react-i18next";
|
|
26
|
+
import { MdCameraswitch } from "react-icons/md";
|
|
27
|
+
import { Scanner } from "@yudiel/react-qr-scanner";
|
|
28
|
+
import isPhoneApp from "../../../utils/phone-app-communication/is-phone-app";
|
|
29
|
+
import styles from "./styles.module.css";
|
|
30
|
+
export default function SwitchableCameraScanner(_a) {
|
|
31
|
+
var constraints = _a.constraints, scannerProps = __rest(_a, ["constraints"]);
|
|
32
|
+
var t = useTranslation().t;
|
|
33
|
+
var _b = useState("environment"), facingMode = _b[0], setFacingMode = _b[1];
|
|
34
|
+
var cameraConstraints = useMemo(function () { return (__assign(__assign({}, constraints), {
|
|
35
|
+
// A plain facingMode is an ideal constraint. Older browsers and devices
|
|
36
|
+
// with one camera can therefore fall back instead of failing outright.
|
|
37
|
+
facingMode: facingMode })); }, [constraints, facingMode]);
|
|
38
|
+
var switchToFrontCamera = facingMode === "environment";
|
|
39
|
+
var cameraSwitchLabel = switchToFrontCamera
|
|
40
|
+
? t("connection.switch_to_front_camera")
|
|
41
|
+
: t("connection.switch_to_rear_camera");
|
|
42
|
+
return (_jsxs("div", __assign({ className: styles.container }, { children: [_jsx(Scanner, __assign({}, scannerProps, { constraints: cameraConstraints })), isPhoneApp() && (_jsx("button", __assign({ type: "button", className: styles.cameraSwitchButton, "aria-label": cameraSwitchLabel, title: cameraSwitchLabel, onClick: function () {
|
|
43
|
+
return setFacingMode(function (currentFacingMode) {
|
|
44
|
+
return currentFacingMode === "environment" ? "user" : "environment";
|
|
45
|
+
});
|
|
46
|
+
} }, { children: _jsx(MdCameraswitch, { className: styles.cameraSwitchIcon, "aria-hidden": "true", focusable: "false" }) })))] })));
|
|
47
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
|
|
1
|
+
type Props = {
|
|
2
|
+
onDismiss?: () => void;
|
|
3
|
+
};
|
|
4
|
+
export default function ConnectingLoadingSpinnerModal({ onDismiss }: Props): import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
export {};
|
|
@@ -9,18 +9,25 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useTranslation } from "react-i18next";
|
|
14
|
-
import { useEffect } from "react";
|
|
14
|
+
import { useCallback, useEffect } from "react";
|
|
15
15
|
import { secondaryModalState } from "../../../state-observables/modal/ModalState";
|
|
16
|
+
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
16
17
|
import styles from "./styles.module.css";
|
|
17
18
|
export default function ConnectingLoadingSpinnerModal(_a) {
|
|
19
|
+
var onDismiss = _a.onDismiss;
|
|
18
20
|
var t = useTranslation().t;
|
|
21
|
+
var dismissLabel = String(t("connection.dismiss", "Dismiss"));
|
|
22
|
+
var dismissAriaLabel = String(t("connection.dismiss_connecting_modal", "Dismiss connecting dialog"));
|
|
23
|
+
var dismiss = useCallback(function () {
|
|
24
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
25
|
+
secondaryModalState.closeModalWithoutAnimation();
|
|
26
|
+
}, [onDismiss]);
|
|
19
27
|
useEffect(function () {
|
|
20
28
|
// close modal after 3 minutes assuming no connection will take that long
|
|
21
|
-
setTimeout(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, []);
|
|
25
|
-
return (_jsx("div", __assign({ className: styles.container }, { children: t("connection.connecting_loading") })));
|
|
29
|
+
var timeout = setTimeout(dismiss, 180000);
|
|
30
|
+
return function () { return clearTimeout(timeout); };
|
|
31
|
+
}, [dismiss]);
|
|
32
|
+
return (_jsxs("div", __assign({ className: styles.container }, { children: [_jsx("span", { children: t("connection.connecting_loading") }), _jsx("div", __assign({ className: styles.dismissButton, "data-testid": "connecting-modal-dismiss" }, { children: _jsx(SimpleButton, { ariaLabel: dismissAriaLabel, onClick: dismiss, title: dismissLabel }) }))] })));
|
|
26
33
|
}
|
|
@@ -54,9 +54,10 @@ import { MdQrCode } from "react-icons/md";
|
|
|
54
54
|
import { ReactComponent as BluetoothSVG } from "../../../assets/configuration/bluetooth.svg";
|
|
55
55
|
import { MAIN_BLUE } from "../../../styles/colors";
|
|
56
56
|
//@ts-ignore
|
|
57
|
-
import {
|
|
57
|
+
import { centerText } from '@yudiel/react-qr-scanner';
|
|
58
58
|
import { ConnManager } from "@robotical/roboticaljs";
|
|
59
59
|
import { useTranslation } from "react-i18next";
|
|
60
|
+
import SwitchableCameraScanner from "../../disposables/SwitchableCameraScanner";
|
|
60
61
|
export default function LEDLightsOrQRVerificationModal(_a) {
|
|
61
62
|
var _this = this;
|
|
62
63
|
var targetRaftType = _a.targetRaftType, _b = _a.allowSwitchToMarty, allowSwitchToMarty = _b === void 0 ? false : _b;
|
|
@@ -134,7 +135,7 @@ function QRContent(_a) {
|
|
|
134
135
|
});
|
|
135
136
|
}); };
|
|
136
137
|
var isWebapp = ((_b = window.applicationManager.deviceInfo) === null || _b === void 0 ? void 0 : _b.manufacturer) === "Webapp";
|
|
137
|
-
return (_jsx("div", __assign({ className: styles.QRcontainer }, { children: _jsx("div", __assign({ className: styles.QRscannerContainer }, { children: _jsx(
|
|
138
|
+
return (_jsx("div", __assign({ className: styles.QRcontainer }, { children: _jsx("div", __assign({ className: styles.QRscannerContainer }, { children: _jsx(SwitchableCameraScanner, { styles: { container: { transform: isWebapp ? 'scaleX(-1)' : 'none' } }, onError: function (err) { return console.error(err); }, formats: [
|
|
138
139
|
"qr_code",
|
|
139
140
|
"micro_qr_code",
|
|
140
141
|
"rm_qr_code",
|
|
@@ -156,8 +157,7 @@ function QRContent(_a) {
|
|
|
156
157
|
"linear_codes",
|
|
157
158
|
"upc_a",
|
|
158
159
|
"upc_e",
|
|
159
|
-
], allowMultiple: false, scanDelay: 2000, onScan: onQrCodeFound, components: {
|
|
160
|
-
audio: true,
|
|
160
|
+
], allowMultiple: false, scanDelay: 2000, sound: true, onScan: onQrCodeFound, components: {
|
|
161
161
|
onOff: false,
|
|
162
162
|
torch: true,
|
|
163
163
|
zoom: true,
|
|
@@ -55,17 +55,13 @@ import RICSignal from "../../oneoffs/RaftSignal";
|
|
|
55
55
|
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
56
56
|
import LEDs from "../../oneoffs/LEDs";
|
|
57
57
|
import { raftConnectingSubscriptionHelper } from "../../../application/RAFTs/raft-subscription-helpers";
|
|
58
|
-
import { useConnectedRafts } from "../../../store/SelectedRaftContext";
|
|
59
58
|
import { useTranslation } from "react-i18next";
|
|
60
|
-
var SHOW_LOGS = true;
|
|
61
|
-
var TAG = "VerificationModal";
|
|
62
59
|
function VerificationModal(_a) {
|
|
63
60
|
var _this = this;
|
|
64
61
|
var connectedRAFT_ = _a.connectedRAFT_;
|
|
65
62
|
var _b = useState([]), randomColours = _b[0], setRandomColours = _b[1];
|
|
66
63
|
// const [connectedRaft, setConnectedRaft] = useState<RAFT | undefined>(connectedRAFT_);
|
|
67
64
|
var _c = useState(-200), RSSI = _c[0], setRSSI = _c[1];
|
|
68
|
-
var removeConnectedRaft = useConnectedRafts().removeConnectedRaft;
|
|
69
65
|
var t = useTranslation().t;
|
|
70
66
|
useEffect(function () {
|
|
71
67
|
/* Subscribe to the connectedRaft's SIGNAL strength */
|
|
@@ -84,12 +80,8 @@ function VerificationModal(_a) {
|
|
|
84
80
|
modalState.closeModal();
|
|
85
81
|
if (!connectedRAFT_)
|
|
86
82
|
return [2 /*return*/];
|
|
87
|
-
removeConnectedRaft(connectedRAFT_.id);
|
|
88
83
|
return [4 /*yield*/, window.applicationManager.stopVerifyingRaft(connectedRAFT_.id, false)];
|
|
89
84
|
case 1:
|
|
90
|
-
_a.sent();
|
|
91
|
-
return [4 /*yield*/, connectedRAFT_.disconnect()];
|
|
92
|
-
case 2:
|
|
93
85
|
_a.sent();
|
|
94
86
|
return [2 /*return*/];
|
|
95
87
|
}
|
|
@@ -69,11 +69,8 @@ import { raftConnectingSubscriptionHelper, raftDiscoveryFinishedSubscriptionHelp
|
|
|
69
69
|
import isPhoneApp from "../../../utils/phone-app-communication/is-phone-app";
|
|
70
70
|
import LoadingSpinner from "../../disposables/LoadingSpinner";
|
|
71
71
|
import { RaftConnectionMethod } from "../../../types/raft";
|
|
72
|
-
import { useConnectedRafts } from "../../../store/SelectedRaftContext";
|
|
73
72
|
import { ConnManager } from "@robotical/roboticaljs";
|
|
74
73
|
import { useTranslation } from "react-i18next";
|
|
75
|
-
var SHOW_LOGS = true;
|
|
76
|
-
var TAG = "VerificationModalPhone";
|
|
77
74
|
function VerificationModalPhoneApp(_a) {
|
|
78
75
|
var _this = this;
|
|
79
76
|
var foundRICs = _a.foundRICs;
|
|
@@ -84,7 +81,6 @@ function VerificationModalPhoneApp(_a) {
|
|
|
84
81
|
var _e = useState(false), isLoading = _e[0], setIsLoading = _e[1];
|
|
85
82
|
var _f = useState(isPhoneApp()), isScanning = _f[0], setIsScanning = _f[1];
|
|
86
83
|
var _g = useState(), connectedRaft = _g[0], setConnectedRaft = _g[1];
|
|
87
|
-
var removeConnectedRaft = useConnectedRafts().removeConnectedRaft;
|
|
88
84
|
useEffect(function () {
|
|
89
85
|
raftDiscoveryFinishedSubscriptionHelper().subscribe(function () { return setIsScanning(false); });
|
|
90
86
|
raftDiscoveryStartedSubscriptionHelper().subscribe(function () { return setIsScanning(true); });
|
|
@@ -112,20 +108,16 @@ function VerificationModalPhoneApp(_a) {
|
|
|
112
108
|
return __generator(this, function (_a) {
|
|
113
109
|
switch (_a.label) {
|
|
114
110
|
case 0:
|
|
115
|
-
if (!connectedRaft) return [3 /*break*/,
|
|
111
|
+
if (!connectedRaft) return [3 /*break*/, 2];
|
|
116
112
|
return [4 /*yield*/, window.applicationManager.stopVerifyingRaft(connectedRaft.id, false)];
|
|
117
113
|
case 1:
|
|
118
114
|
_a.sent();
|
|
119
|
-
return [
|
|
120
|
-
case 2:
|
|
115
|
+
return [3 /*break*/, 4];
|
|
116
|
+
case 2: return [4 /*yield*/, window.applicationManager.stopDiscovery()];
|
|
117
|
+
case 3:
|
|
121
118
|
_a.sent();
|
|
122
|
-
|
|
123
|
-
return [3 /*break*/, 5];
|
|
124
|
-
case 3: return [4 /*yield*/, window.applicationManager.stopDiscovery()];
|
|
119
|
+
_a.label = 4;
|
|
125
120
|
case 4:
|
|
126
|
-
_a.sent();
|
|
127
|
-
_a.label = 5;
|
|
128
|
-
case 5:
|
|
129
121
|
raftFoundSubscriptionHelper().unsubscribe();
|
|
130
122
|
modalState.closeModal();
|
|
131
123
|
return [2 /*return*/];
|
|
@@ -137,23 +129,20 @@ function VerificationModalPhoneApp(_a) {
|
|
|
137
129
|
switch (_a.label) {
|
|
138
130
|
case 0:
|
|
139
131
|
modalState.closeModalWithoutAnimation();
|
|
140
|
-
if (!connectedRaft) return [3 /*break*/,
|
|
132
|
+
if (!connectedRaft) return [3 /*break*/, 2];
|
|
141
133
|
return [4 /*yield*/, window.applicationManager.stopVerifyingRaft(connectedRaft.id, false)];
|
|
142
134
|
case 1:
|
|
143
135
|
_a.sent();
|
|
144
|
-
|
|
136
|
+
_a.label = 2;
|
|
145
137
|
case 2:
|
|
146
|
-
_a.sent();
|
|
147
|
-
_a.label = 3;
|
|
148
|
-
case 3:
|
|
149
138
|
setSelectedRICIdx(-1);
|
|
150
139
|
setConnectedRaft(undefined);
|
|
151
|
-
if (!window.applicationManager.ricSelectedCb) return [3 /*break*/,
|
|
140
|
+
if (!window.applicationManager.ricSelectedCb) return [3 /*break*/, 4];
|
|
152
141
|
return [4 /*yield*/, window.applicationManager.startDiscovery(window.applicationManager.ricSelectedCb, window.applicationManager.lastUUIDsUsed ? window.applicationManager.lastUUIDsUsed : [ConnManager.COGUUID, ConnManager.RICUUID])];
|
|
153
|
-
case
|
|
142
|
+
case 3:
|
|
154
143
|
_a.sent();
|
|
155
|
-
_a.label =
|
|
156
|
-
case
|
|
144
|
+
_a.label = 4;
|
|
145
|
+
case 4: return [2 /*return*/];
|
|
157
146
|
}
|
|
158
147
|
});
|
|
159
148
|
}); };
|
|
@@ -186,28 +175,24 @@ function VerificationModalPhoneApp(_a) {
|
|
|
186
175
|
switch (_a.label) {
|
|
187
176
|
case 0:
|
|
188
177
|
setIsLoading(true);
|
|
189
|
-
if (!connectedRaft) return [3 /*break*/,
|
|
178
|
+
if (!connectedRaft) return [3 /*break*/, 2];
|
|
190
179
|
return [4 /*yield*/, window.applicationManager.stopVerifyingRaft(connectedRaft.id, false)];
|
|
191
180
|
case 1:
|
|
192
181
|
_a.sent();
|
|
193
|
-
|
|
182
|
+
_a.label = 2;
|
|
194
183
|
case 2:
|
|
195
|
-
_a.sent();
|
|
196
|
-
removeConnectedRaft(connectedRaft.id);
|
|
197
|
-
_a.label = 3;
|
|
198
|
-
case 3:
|
|
199
184
|
setSelectedRICIdx(raftIdx);
|
|
200
185
|
raftFoundSubscriptionHelper().unsubscribe();
|
|
201
|
-
if (!foundRICsState) return [3 /*break*/,
|
|
186
|
+
if (!foundRICsState) return [3 /*break*/, 4];
|
|
202
187
|
foundRaft = foundRICsState[raftIdx];
|
|
203
188
|
return [4 /*yield*/, window.applicationManager.selectRaft(foundRaft, RaftConnectionMethod.PHONE_BLE)];
|
|
204
|
-
case
|
|
189
|
+
case 3:
|
|
205
190
|
newRaft = _a.sent();
|
|
206
191
|
if (!newRaft)
|
|
207
192
|
return [2 /*return*/];
|
|
208
193
|
setConnectedRaft(newRaft);
|
|
209
|
-
_a.label =
|
|
210
|
-
case
|
|
194
|
+
_a.label = 4;
|
|
195
|
+
case 4:
|
|
211
196
|
setIsLoading(false);
|
|
212
197
|
return [2 /*return*/];
|
|
213
198
|
}
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { RaftUtils } from "@
|
|
13
|
+
import { RaftUtils } from "@robdobsn/raftjs";
|
|
14
14
|
import "./styles.css";
|
|
15
15
|
import { RaftTypeE } from "../../../types/raft";
|
|
16
16
|
export default function LEDs(_a) {
|
package/dist-types/src/i18n.js
CHANGED
|
@@ -249,6 +249,8 @@ var resources = {
|
|
|
249
249
|
"qr_subtitle": "Scan a QR code to verify.",
|
|
250
250
|
"qr_title": "QR Code Verification",
|
|
251
251
|
"scan_again": "SCAN AGAIN",
|
|
252
|
+
"switch_to_front_camera": "Switch to front camera",
|
|
253
|
+
"switch_to_rear_camera": "Switch to rear camera",
|
|
252
254
|
"verification_method": "Verification Method",
|
|
253
255
|
"yes": "Yes"
|
|
254
256
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import RAFT from "../../application/RAFTs/RAFT";
|
|
2
|
-
import { RaftWifiConnStatus } from "@
|
|
2
|
+
import { RaftWifiConnStatus } from "@robdobsn/raftjs";
|
|
3
3
|
export declare const FW_VERSION_RSSI_WIFI = "1.2.0";
|
|
4
4
|
export default function wifiConfigSub(raft: RAFT | undefined, cachedStatus: RaftWifiConnStatus | undefined): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import isVersionGreater from "./compare-version";
|
|
2
|
-
import { RaftWifiConnState } from "@
|
|
2
|
+
import { RaftWifiConnState } from "@robdobsn/raftjs";
|
|
3
3
|
export var FW_VERSION_RSSI_WIFI = "1.2.0"; // greater versions than this (1.1.17) have the wifi rssi logic
|
|
4
4
|
export default function wifiConfigSub(raft, cachedStatus) {
|
|
5
5
|
if (!raft) {
|
|
@@ -2,12 +2,16 @@ import { RaftInfoEvents } from "../types/events/raft-info";
|
|
|
2
2
|
import type { RestMessageOptions } from "../types/communication-between-apps/wrapper-communication";
|
|
3
3
|
import { ConnectionAttemptResults, RaftConnectionMethod } from "../types/raft";
|
|
4
4
|
import Connector from "./connectors/Connector";
|
|
5
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
5
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robdobsn/raftjs";
|
|
6
6
|
import { RICLedLcdColours } from "@robotical/roboticaljs";
|
|
7
7
|
import { CustomBluetoothItem, UserDeviceInfo } from "../types/userDeviceInfo";
|
|
8
8
|
import { ColourSensorCalibrationStage } from "../types/colour-sensor-calibration";
|
|
9
9
|
export declare class WrapperAppManager {
|
|
10
10
|
private connectors;
|
|
11
|
+
private _connectPromise;
|
|
12
|
+
private _disconnectOperations;
|
|
13
|
+
private _pendingConnManagers;
|
|
14
|
+
private _pageUnloadStarted;
|
|
11
15
|
private _observers;
|
|
12
16
|
constructor();
|
|
13
17
|
/**
|
|
@@ -23,6 +27,7 @@ export declare class WrapperAppManager {
|
|
|
23
27
|
*
|
|
24
28
|
*/
|
|
25
29
|
connect(method: RaftConnectionMethod, uuids: string[]): Promise<ConnectionAttemptResults>;
|
|
30
|
+
private _connect;
|
|
26
31
|
/**
|
|
27
32
|
* Gets user's device info
|
|
28
33
|
*/
|
|
@@ -66,6 +71,13 @@ export declare class WrapperAppManager {
|
|
|
66
71
|
* Disconnect from a RAFT
|
|
67
72
|
*/
|
|
68
73
|
disconnect(raftId: string): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Best-effort terminal cleanup. Page lifecycle events cannot reliably await
|
|
76
|
+
* async Bluetooth work, so each connector forwards to RaftJS synchronously.
|
|
77
|
+
*/
|
|
78
|
+
disconnectAllForPageUnload(): void;
|
|
79
|
+
private _disconnectConnManagerForPageUnload;
|
|
80
|
+
isConnected(raftId: string): boolean;
|
|
69
81
|
/**
|
|
70
82
|
* Audio streaming
|
|
71
83
|
*/
|
|
@@ -78,12 +90,9 @@ export declare class WrapperAppManager {
|
|
|
78
90
|
/**
|
|
79
91
|
* Send a REST message to the RAFT
|
|
80
92
|
*/
|
|
81
|
-
sendRestMessage(msg: string, params: object | undefined, raftId: string, options?: RestMessageOptions): Promise<import("@
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* Removes from the martys list after x seconds so that we can still get the last event
|
|
85
|
-
*/
|
|
86
|
-
_removeRICConnector(connectorId: string, timeout: number): void;
|
|
93
|
+
sendRestMessage(msg: string, params: object | undefined, raftId: string, options?: RestMessageOptions): Promise<import("@robdobsn/raftjs").RaftOKFail>;
|
|
94
|
+
private _removeConnectorIfCurrent;
|
|
95
|
+
private _handleDisconnectedEvent;
|
|
87
96
|
/**
|
|
88
97
|
* Warranty Service bluetooth scan for device
|
|
89
98
|
* It scans for a device and gets the device object
|