astraeus 0.1.1 → 0.3.0
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/CHANGELOG.md +51 -0
- package/README.md +76 -7
- package/package.json +10 -6
- package/src/api/AstraeusScene.d.ts +27 -0
- package/src/api/AstraeusScene.js +38 -0
- package/src/api/AstraeusScene.node.js +37 -0
- package/src/api/activity.d.ts +50 -0
- package/src/api/activity.js +62 -0
- package/src/api/bodies.d.ts +24 -0
- package/src/api/bodies.js +24 -0
- package/src/api/errors.d.ts +1 -1
- package/src/api/group.d.ts +89 -0
- package/src/api/group.js +121 -0
- package/src/api/index.d.ts +6 -1
- package/src/api/index.js +3 -1
- package/src/api/index.node.js +8 -0
- package/src/api/mount.d.ts +10 -1
- package/src/api/mount.js +15 -4
- package/src/api/mount.node.js +36 -0
- package/src/api/prepared.d.ts +10 -0
- package/src/api/prepared.js +5 -0
- package/src/api/scene.d.ts +148 -9
- package/src/api/scene.js +563 -59
- package/src/api/story.d.ts +69 -0
- package/src/api/story.js +63 -0
- package/src/api/sunOrbit.d.ts +20 -0
- package/src/api/sunOrbit.js +85 -0
- package/src/api/switches.d.ts +14 -0
- package/src/api/switches.js +19 -0
- package/src/api/time.d.ts +4 -0
- package/src/api/time.js +8 -0
- package/src/app/App.d.ts +6 -2
- package/src/app/App.js +43 -21
- package/src/app/App.node.js +401 -0
- package/src/app/AstraeusScene.d.ts +1 -1
- package/src/app/DebugOverlay.d.ts +3 -52
- package/src/app/DebugOverlay.js +2 -29
- package/src/app/PanelLoadBoundary.d.ts +19 -0
- package/src/app/PanelLoadBoundary.js +17 -0
- package/src/app/SkyView.d.ts +3 -3
- package/src/app/SkyView.js +19 -10
- package/src/app/debugReadout.d.ts +53 -0
- package/src/app/debugReadout.js +30 -0
- package/src/app/developerPanels.d.ts +6 -0
- package/src/app/developerPanels.js +11 -0
- package/src/app/displaySwitches.d.ts +54 -0
- package/src/app/displaySwitches.js +48 -0
- package/src/app/experienceDefinition.d.ts +13 -1
- package/src/app/listSwitch.d.ts +16 -0
- package/src/{experiences/showers/showerChoice.js → app/listSwitch.js} +1 -9
- package/src/app/metricReadouts.d.ts +1 -1
- package/src/app/metricReadouts.js +1 -1
- package/src/app/openClock.d.ts +7 -0
- package/src/app/openClock.js +14 -0
- package/src/app/sceneContentsHooks.d.ts +3 -3
- package/src/app/sceneContentsHooks.js +2 -2
- package/src/app/sceneDebug.d.ts +1 -1
- package/src/app/sceneDebug.js +1 -1
- package/src/app/sceneFrame.js +4 -3
- package/src/app/sceneFraming.d.ts +13 -0
- package/src/app/sceneFraming.js +22 -0
- package/src/app/skyModel.js +3 -1
- package/src/app/trackedMetrics.d.ts +53 -0
- package/src/{experiences/apollo11/spacecraftMetrics.js → app/trackedMetrics.js} +40 -56
- package/src/assets/licence.d.ts +1 -0
- package/src/assets/pictures.d.ts +1 -1
- package/src/assets/sky.d.ts +4 -4
- package/src/assets/sky.js +12 -13
- package/src/core/bodies/index.d.ts +3 -0
- package/src/core/bodies/index.js +3 -1
- package/src/core/bodies/io.js +1 -1
- package/src/core/bodies/jupiterData.js +2 -2
- package/src/core/bodies/jupiterMoons.js +8 -12
- package/src/core/bodies/moon.d.ts +8 -0
- package/src/core/bodies/moon.js +28 -5
- package/src/core/bodies/outerPlanetData.js +7 -7
- package/src/core/bodies/planetMoons.js +18 -27
- package/src/core/bodies/swiftTuttle.js +2 -0
- package/src/core/elementsBody.d.ts +2 -0
- package/src/core/elementsBody.js +3 -0
- package/src/core/moonTrajectory.js +3 -5
- package/src/core/planetModels.js +1 -1
- package/src/core/planetSeries.d.ts +2 -0
- package/src/core/planetSeries.js +4 -0
- package/src/core/provenance.d.ts +7 -2
- package/src/core/provenance.js +3 -1
- package/src/core/scalePolicy.d.ts +3 -0
- package/src/core/scalePolicy.js +2 -0
- package/src/core/state.d.ts +1 -0
- package/src/shell/AstraeusShell.d.ts +4 -1
- package/src/shell/AstraeusShell.js +12 -6
- package/src/shell/AstraeusShell.node.js +225 -0
- package/src/shell/DisplaySwitches.d.ts +16 -0
- package/src/shell/DisplaySwitches.js +31 -0
- package/src/shell/StoryPanelView.js +3 -1
- package/src/shell/TimelineBar.css +4 -0
- package/src/shell/TimelineBar.node.js +75 -0
- package/src/shell/TopBar.css +20 -0
- package/src/shell/TopBar.d.ts +4 -1
- package/src/shell/TopBar.js +3 -2
- package/src/shell/TopBar.node.js +14 -0
- package/src/shell/experience.d.ts +4 -0
- package/src/shell/infoModel.js +3 -1
- package/src/shell/phone.css +4 -1
- package/src/shell/topBarIcons.d.ts +1 -0
- package/src/shell/topBarIcons.js +1 -0
- package/src/shell/useDrawers.js +1 -1
- package/src/shell/useZoomThrough.d.ts +7 -0
- package/src/shell/useZoomThrough.js +51 -0
- package/src/synthetic/syntheticDefinition.js +3 -3
- package/src/experiences/apollo11/spacecraftMetrics.d.ts +0 -34
- package/src/experiences/showers/showerChoice.d.ts +0 -25
package/src/shell/infoModel.js
CHANGED
|
@@ -6,6 +6,7 @@ export const PROVENANCE_STATUS = {
|
|
|
6
6
|
ephemeris: "Ephemeris",
|
|
7
7
|
observed: "Observed",
|
|
8
8
|
reconstructed: "Reconstructed",
|
|
9
|
+
modelled: "Modelled",
|
|
9
10
|
illustrative: "Illustrative",
|
|
10
11
|
};
|
|
11
12
|
export function provenanceView(provenance, knownLimitations = []) {
|
|
@@ -71,10 +72,11 @@ function eventInfo(experience, target) {
|
|
|
71
72
|
const event = experience.events.find((candidate) => candidate.id === target.id);
|
|
72
73
|
if (event === undefined)
|
|
73
74
|
return null;
|
|
75
|
+
const source = experience.eventProvenanceById?.[event.id] ?? experience.eventProvenance;
|
|
74
76
|
return {
|
|
75
77
|
target,
|
|
76
78
|
title: event.label,
|
|
77
79
|
subtitle: formatUtcTimestamp(event.timeUtcMs),
|
|
78
|
-
provenance:
|
|
80
|
+
provenance: source === undefined ? null : provenanceView(source),
|
|
79
81
|
};
|
|
80
82
|
}
|
package/src/shell/phone.css
CHANGED
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
/* The object list takes the first row, leaving room for the cog at the right. */
|
|
77
77
|
[data-phone="true"] .controls-drawer .object-picker { grid-column: 1 / -1; width: calc(100% - 52px); max-width: none; }
|
|
78
78
|
/* Each button: icon over a short word. */
|
|
79
|
+
[data-phone="true"] .controls-drawer .display-switches { display: contents; }
|
|
79
80
|
[data-phone="true"] .controls-drawer .top-bar-button { width: auto; flex-direction: column; gap: 2px; padding: 0 4px; }
|
|
80
81
|
[data-phone="true"] .controls-drawer .top-bar-button-text { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
81
82
|
[data-phone="true"] .controls-drawer .switch-control { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
|
|
@@ -83,6 +84,8 @@
|
|
|
83
84
|
[data-phone="true"] .controls-drawer .scale-toggle > span { font-size: 11px; }
|
|
84
85
|
[data-phone="true"] .controls-drawer .scale-menu,
|
|
85
86
|
[data-phone="true"] .controls-drawer .scale-explanation-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(320px, calc(100vw - 32px)); }
|
|
87
|
+
/* The switch panel stays clear of the cog's column (60 px at the right) and the drawer's edge. */
|
|
88
|
+
[data-phone="true"] .controls-drawer .switch-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(260px, calc(100vw - 84px)); min-width: 0; }
|
|
86
89
|
[data-phone="true"] .controls-drawer .top-bar { position: relative; }
|
|
87
90
|
[data-phone="true"] .controls-drawer .scale-control { position: static; }
|
|
88
91
|
|
|
@@ -156,7 +159,7 @@
|
|
|
156
159
|
animation: story-sheet-in var(--drawer-ms, 240ms) var(--drawer-ease);
|
|
157
160
|
}
|
|
158
161
|
[data-phone="true"] .info-panel { z-index: 8; background: #0e0e13; }
|
|
159
|
-
[data-phone="true"] .story-panel { z-index: 4; }
|
|
162
|
+
[data-phone="true"] .story-panel { z-index: 4; touch-action: pan-y; } /* a pinch reaches the scene beneath (useZoomThrough); a vertical drag still scrolls or dismisses */
|
|
160
163
|
[data-phone="true"] .info-panel-header h2 { margin: 0; font-size: 22px; }
|
|
161
164
|
|
|
162
165
|
/* ---- The Developer panel below the pill, above the timeline ---- */
|
|
@@ -4,6 +4,7 @@ export declare const FocusIcon: () => import("react").JSX.Element;
|
|
|
4
4
|
export declare const OverviewIcon: () => import("react").JSX.Element;
|
|
5
5
|
export declare const FollowIcon: () => import("react").JSX.Element;
|
|
6
6
|
export declare const OrbitIcon: () => import("react").JSX.Element;
|
|
7
|
+
export declare const SwitchesIcon: () => import("react").JSX.Element;
|
|
7
8
|
export declare const ScaleIcon: () => import("react").JSX.Element;
|
|
8
9
|
export declare const ChevronIcon: () => import("react").JSX.Element;
|
|
9
10
|
export declare const CogIcon: () => import("react").JSX.Element;
|
package/src/shell/topBarIcons.js
CHANGED
|
@@ -8,6 +8,7 @@ export const FocusIcon = () => _jsxs(Icon, { children: [_jsx("circle", { cx: "10
|
|
|
8
8
|
export const OverviewIcon = () => _jsx(Icon, { children: _jsx("path", { d: "M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" }) });
|
|
9
9
|
export const FollowIcon = () => _jsxs(Icon, { children: [_jsx("circle", { cx: "12", cy: "12", r: "4" }), _jsx("path", { d: "M12 3v4M12 17v4M3 12h4M17 12h4" })] });
|
|
10
10
|
export const OrbitIcon = () => _jsxs(Icon, { children: [_jsx("ellipse", { cx: "12", cy: "12", rx: "9", ry: "5", transform: "rotate(-20 12 12)" }), _jsx("circle", { cx: "12", cy: "12", r: "1.4", fill: "currentColor" })] });
|
|
11
|
+
export const SwitchesIcon = () => _jsxs(Icon, { children: [_jsx("path", { d: "M4 8h10M18 8h2M4 16h2M10 16h10" }), _jsx("circle", { cx: "16", cy: "8", r: "2" }), _jsx("circle", { cx: "8", cy: "16", r: "2" })] });
|
|
11
12
|
export const ScaleIcon = () => _jsxs(Icon, { size: 16, children: [_jsx("circle", { cx: "7", cy: "12", r: "2.5" }), _jsx("circle", { cx: "16", cy: "12", r: "5.5" })] });
|
|
12
13
|
export const ChevronIcon = () => _jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.6", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M2 4l4 4 4-4" }) });
|
|
13
14
|
export const CogIcon = () => (_jsxs(Icon, { size: 19, strokeWidth: 1.7, children: [_jsx("circle", { cx: "12", cy: "12", r: "3" }), _jsx("path", { d: "M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z" })] }));
|
package/src/shell/useDrawers.js
CHANGED
|
@@ -18,7 +18,7 @@ export function useDrawers(phone, onControlsOpened) {
|
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
if (!phone || (!controlsOpen && !timelineOpen))
|
|
20
20
|
return undefined;
|
|
21
|
-
const onKey = (event) => { if (event.key === "Escape") {
|
|
21
|
+
const onKey = (event) => { if (!event.defaultPrevented && event.key === "Escape") {
|
|
22
22
|
setControlsOpen(false);
|
|
23
23
|
setTimelineOpen(false);
|
|
24
24
|
} };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Lets a phone bottom sheet pass zoom input to the scene beneath it: a wheel, or a two-finger pinch, over the sheet is forwarded to the canvas as a
|
|
4
|
+
* wheel event, which the camera control already turns into a zoom. A sheet with something to scroll keeps its wheel (reading wins); a pinch always zooms.
|
|
5
|
+
* Does nothing on a wide screen, where the panel sits beside the scene.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useZoomThrough(ref: RefObject<HTMLElement | null>): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
/** A pinch's spread change (px) counts as this many wheel units, matching the camera's pinch (0.006) and wheel (0.0012) sensitivities. */
|
|
3
|
+
const PINCH_TO_WHEEL = 5;
|
|
4
|
+
/**
|
|
5
|
+
* Lets a phone bottom sheet pass zoom input to the scene beneath it: a wheel, or a two-finger pinch, over the sheet is forwarded to the canvas as a
|
|
6
|
+
* wheel event, which the camera control already turns into a zoom. A sheet with something to scroll keeps its wheel (reading wins); a pinch always zooms.
|
|
7
|
+
* Does nothing on a wide screen, where the panel sits beside the scene.
|
|
8
|
+
*/
|
|
9
|
+
export function useZoomThrough(ref) {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const sheet = ref.current;
|
|
12
|
+
if (sheet === null)
|
|
13
|
+
return undefined;
|
|
14
|
+
const shell = sheet.closest(".astraeus-shell");
|
|
15
|
+
const forward = (deltaY) => {
|
|
16
|
+
shell?.querySelector("canvas")?.dispatchEvent(new WheelEvent("wheel", { deltaY, bubbles: true, cancelable: true }));
|
|
17
|
+
};
|
|
18
|
+
const phone = () => shell?.dataset.phone === "true";
|
|
19
|
+
const onWheel = (event) => {
|
|
20
|
+
if (!phone() || sheet.scrollHeight > sheet.clientHeight)
|
|
21
|
+
return;
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
forward(event.deltaY);
|
|
24
|
+
};
|
|
25
|
+
let spread = null;
|
|
26
|
+
const spreadOf = (touches) => {
|
|
27
|
+
const [a, b] = [touches[0], touches[1]];
|
|
28
|
+
return touches.length === 2 && a !== undefined && b !== undefined ? Math.hypot(a.clientX - b.clientX, a.clientY - b.clientY) : null;
|
|
29
|
+
};
|
|
30
|
+
const onTouch = (event) => {
|
|
31
|
+
const next = phone() ? spreadOf(event.touches) : null;
|
|
32
|
+
if (next !== null && spread !== null) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
forward(-(next - spread) * PINCH_TO_WHEEL);
|
|
35
|
+
}
|
|
36
|
+
spread = next;
|
|
37
|
+
};
|
|
38
|
+
sheet.addEventListener("wheel", onWheel, { passive: false });
|
|
39
|
+
sheet.addEventListener("touchstart", onTouch, { passive: true });
|
|
40
|
+
sheet.addEventListener("touchmove", onTouch, { passive: false });
|
|
41
|
+
sheet.addEventListener("touchend", onTouch, { passive: true });
|
|
42
|
+
sheet.addEventListener("touchcancel", onTouch, { passive: true });
|
|
43
|
+
return () => {
|
|
44
|
+
sheet.removeEventListener("wheel", onWheel);
|
|
45
|
+
sheet.removeEventListener("touchstart", onTouch);
|
|
46
|
+
sheet.removeEventListener("touchmove", onTouch);
|
|
47
|
+
sheet.removeEventListener("touchend", onTouch);
|
|
48
|
+
sheet.removeEventListener("touchcancel", onTouch);
|
|
49
|
+
};
|
|
50
|
+
}, [ref]);
|
|
51
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bodyMetrics
|
|
2
|
-
import {
|
|
1
|
+
import { bodyMetrics } from "../app/bodyMetrics.js";
|
|
2
|
+
import { createReadoutMetrics } from "../app/trackedMetrics.js";
|
|
3
3
|
import { earthMoonSystem } from "../assets/compositions.js";
|
|
4
4
|
import { createEvents } from "../core/events.js";
|
|
5
5
|
import { createProvenance } from "../core/provenance.js";
|
|
@@ -164,7 +164,7 @@ export const syntheticDefinition = {
|
|
|
164
164
|
trackedBodies: [marker],
|
|
165
165
|
createMetrics: ({ resolver }) => {
|
|
166
166
|
const catalogued = bodyMetrics(resolver, earthMoonSystem.bodies, ["distance"]);
|
|
167
|
-
const tracked =
|
|
167
|
+
const tracked = createReadoutMetrics([{ body: marker, readouts: [{ kind: "range", marker: "moon" }, { kind: "speed" }, { kind: "distance", to: "moon" }] }], resolver);
|
|
168
168
|
return (objectId, timeUtcMs) => objectId === marker.id ? [...tracked(objectId, timeUtcMs), contactRateMetric(timeUtcMs)] : catalogued(objectId, timeUtcMs);
|
|
169
169
|
},
|
|
170
170
|
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CenteredPosition } from "../../core/state.js";
|
|
2
|
-
import type { Trajectory } from "../../core/trajectory.js";
|
|
3
|
-
import { type TrackedBody, type TrackedReadout } from "../../app/mission.js";
|
|
4
|
-
import type { AltitudeMetric, CoordinatesMetric, DistanceMetric, Metric, MetricReference, RelativeDistanceMetric, SpeedMetric, UncertaintyMetric } from "../../shell/metrics.js";
|
|
5
|
-
/**
|
|
6
|
-
* Highest speed at the body's NASA source anchors, the honest top of its speed gauge. Anchors rather
|
|
7
|
-
* than reconstructed samples, because a smoothed join can carry a known non-physical spike (I-008).
|
|
8
|
-
* Null when the body has no anchors or the trajectory carries no velocity.
|
|
9
|
-
*/
|
|
10
|
-
export declare function peakAnchorSpeedKmS(body: TrackedBody): number | null;
|
|
11
|
-
/** A reference marker only when it is measured from the same centre and in the same frame as the value. */
|
|
12
|
-
export declare function referenceInSameFrame(label: string, row: Pick<TrackedReadout, "frame" | "center">, reference: CenteredPosition | null): MetricReference | null;
|
|
13
|
-
export declare function spacecraftRangeMetric(row: TrackedReadout, moon: MetricReference | null): DistanceMetric;
|
|
14
|
-
export declare function spacecraftSpeedMetric(row: TrackedReadout, peakKmS: number | null): SpeedMetric;
|
|
15
|
-
/** Centre-to-centre distance from the spacecraft to the Moon, drawn in Moon radii. */
|
|
16
|
-
export declare function spacecraftMoonMetric(row: TrackedReadout, moon: CenteredPosition | null): RelativeDistanceMetric;
|
|
17
|
-
/**
|
|
18
|
-
* Height above the mean radius of whichever of Earth and the Moon is closer to the surface.
|
|
19
|
-
* Mean radius, not terrain: on the lunar surface the value can be negative.
|
|
20
|
-
*/
|
|
21
|
-
export declare function spacecraftAltitudeMetric(row: TrackedReadout, moon: CenteredPosition | null): AltitudeMetric;
|
|
22
|
-
export declare function spacecraftPositionMetric(row: TrackedReadout, moon: CenteredPosition | null): CoordinatesMetric;
|
|
23
|
-
/** The data's own discrepancy for the segment at this time, compared with the vehicle's largest. */
|
|
24
|
-
export declare function spacecraftDiscrepancyMetric(body: TrackedBody, timeUtcMs: number): UncertaintyMetric;
|
|
25
|
-
export interface TrackedMetricSources {
|
|
26
|
-
readonly bodies: readonly TrackedBody[];
|
|
27
|
-
/** Earth-centred Moon trajectory, the reference every Earth-centred tracked body is measured against. */
|
|
28
|
-
readonly moon: Trajectory;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The info panel's range, speed and Moon-distance rows for one tracked body, from State only: scale policy and camera never
|
|
32
|
-
* enter. A tracked body outside its bounds and any other id have none. The catalogued bodies' own rows are `bodyMetrics`'.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createTrackedMetrics({ bodies, moon }: TrackedMetricSources): (objectId: string, timeUtcMs: number) => readonly Metric[];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ExperienceSwitch } from "../../shell/SwitchControl.js";
|
|
2
|
-
/** The address parameter that names the shower (`?experience=showers&shower=<name>`). */
|
|
3
|
-
export declare const SHOWER_PARAM = "shower";
|
|
4
|
-
/** The label the switch carries as its accessible name. */
|
|
5
|
-
export declare const SHOWER_SWITCH_LABEL = "Shower";
|
|
6
|
-
/** One shower the experience can open: its settings file's name, its label, and its place in the switch (the lowest `order` is the default). */
|
|
7
|
-
export interface ShowerEntry {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly label: string;
|
|
10
|
-
readonly order: number;
|
|
11
|
-
}
|
|
12
|
-
/** The entry to open (the requested one when it exists, else `preferred`, else the first by `order`, then name) and the switch listing every entry. Undefined when there are none. Shared by the experiences that offer such a switch. */
|
|
13
|
-
export declare function chooseSwitch<T extends ShowerEntry>(entries: readonly T[], requested: string | null, switchOf: {
|
|
14
|
-
readonly label: string;
|
|
15
|
-
readonly param: string;
|
|
16
|
-
readonly keep?: readonly string[];
|
|
17
|
-
}, preferred?: string): {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly switcher: ExperienceSwitch;
|
|
20
|
-
} | undefined;
|
|
21
|
-
/** The shower to open (the requested one when it exists, else the first by `order`, then name) and the switch listing every shower. Undefined when there are no showers. */
|
|
22
|
-
export declare function chooseShower(entries: readonly ShowerEntry[], requested: string | null): {
|
|
23
|
-
readonly name: string;
|
|
24
|
-
readonly switcher: ExperienceSwitch;
|
|
25
|
-
} | undefined;
|