@robotical/webapp-types 3.27.3 → 3.27.4
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/package.json
CHANGED
|
@@ -142,7 +142,9 @@ export declare class ColourDiagnosticError extends Error {
|
|
|
142
142
|
}
|
|
143
143
|
export declare const newColourSession: () => ColourSession;
|
|
144
144
|
export declare const getColourSensors: (raftId: string) => ColourSensor[];
|
|
145
|
-
export declare const assertColourSensorActive: (sensor: ColourSensor, signal: AbortSignal
|
|
145
|
+
export declare const assertColourSensorActive: (sensor: ColourSensor, signal: AbortSignal, { allowBackground }?: {
|
|
146
|
+
allowBackground?: boolean | undefined;
|
|
147
|
+
}) => void;
|
|
146
148
|
export declare const interpretColour: (vals: Record<string, number | boolean>, profile?: ColourSignalProfile) => {
|
|
147
149
|
red: number;
|
|
148
150
|
green: number;
|
|
@@ -113,10 +113,11 @@ export var getColourSensors = function (raftId) {
|
|
|
113
113
|
.filter(function (addon) { return addon.whoAmI === "coloursensor"; })
|
|
114
114
|
.map(function (addon) { return ({ key: JSON.stringify([addon.id, addon.name]), raftId: raftId, raft: raft, addon: addon }); });
|
|
115
115
|
};
|
|
116
|
-
export var assertColourSensorActive = function (sensor, signal) {
|
|
116
|
+
export var assertColourSensorActive = function (sensor, signal, _a) {
|
|
117
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.allowBackground, allowBackground = _c === void 0 ? false : _c;
|
|
117
118
|
if (signal.aborted)
|
|
118
119
|
throw new ColourDiagnosticError("cancelled");
|
|
119
|
-
if (document.hidden)
|
|
120
|
+
if (document.hidden && !allowBackground)
|
|
120
121
|
throw new ColourDiagnosticError("backgrounded");
|
|
121
122
|
var current = getColourSensors(sensor.raftId).find(function (candidate) { return candidate.key === sensor.key; });
|
|
122
123
|
if (!current || current.raft !== sensor.raft)
|