@deck-shelves/host 1.1.0 → 1.2.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/README.md +17 -10
- package/dist/index.d.cts +95 -27
- package/dist/index.d.ts +95 -27
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
+
<p>
|
|
6
|
+
<img src="assets/logo.svg" alt="@deck-shelves/host" width="352">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
5
9
|
[](https://github.com/santojon/Deck-Shelves-HOST/actions/workflows/ci.yml)
|
|
6
10
|
[](https://github.com/santojon/Deck-Shelves-HOST/actions/workflows/release.yml)
|
|
7
11
|
[](https://www.npmjs.com/package/@deck-shelves/host)
|
|
@@ -22,20 +26,23 @@
|
|
|
22
26
|
The **host contract** for [Deck Shelves](https://github.com/santojon/Deck-Shelves) —
|
|
23
27
|
the `HostApi` types that both host implementations and the bundle build against.
|
|
24
28
|
|
|
25
|
-
It is the boundary between a *host* and the Deck Shelves bundle
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
It is the boundary between a *host* and the Deck Shelves bundle. Each host
|
|
30
|
+
ships its own adapter in the plugin — one file per host,
|
|
31
|
+
`runtime/host/<host>.ts` — and every adapter fulfils this same contract, so
|
|
32
|
+
the bundle's call sites never depend on a specific host and new hosts can be
|
|
33
|
+
added without touching the bundle.
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
specific host.
|
|
33
|
-
|
|
34
|
-
> **Types only.** The standalone host *runtime* — the injected
|
|
35
|
+
> **Types only.** A host's *runtime* — for external hosts, the injected
|
|
35
36
|
> `window.__SHELVES_HOST__` that locates Steam's UI components and adds the
|
|
36
|
-
> Quick Access Menu tab — lives in
|
|
37
|
+
> Quick Access Menu tab — lives in that host's own project, not here. This
|
|
37
38
|
> package is just the interface both sides agree on.
|
|
38
39
|
|
|
40
|
+
> **Coexistence.** A host with a native QAM tab may also expose its panel
|
|
41
|
+
> registration on `window.__SHELVES_QAM__` (a `HostQam`), independently of the
|
|
42
|
+
> full `HostApi` — so a bundle can populate that host's tab even when *another*
|
|
43
|
+
> host owns the home (and `__SHELVES_HOST__` is left unset). Both globals are
|
|
44
|
+
> declared in the contract.
|
|
45
|
+
|
|
39
46
|
It is **not** `@deck-shelves/api` — that package is the public *extension* API
|
|
40
47
|
consumed by third-party plugins (`window.deckShelves`). This one is the
|
|
41
48
|
host↔bundle contract, a different audience.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deck-shelves/host — HostApi contract
|
|
2
|
+
* @deck-shelves/host — HostApi contract.
|
|
3
3
|
*
|
|
4
|
-
* The single source of truth for the boundary between a *host*
|
|
5
|
-
* host
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The single source of truth for the boundary between a *host* and the Deck
|
|
5
|
+
* Shelves bundle. Every host ships its own adapter (one per host), and every
|
|
6
|
+
* adapter fulfils this shape, so the bundle's call sites depend only on it
|
|
7
|
+
* and never on a specific host's UI library directly.
|
|
8
8
|
*
|
|
9
|
-
* Additive-only
|
|
10
|
-
*
|
|
9
|
+
* Additive-only Optional UI-surface capabilities are additive
|
|
10
|
+
* namespaces a host implements *if it can* and the bundle feature-detects:
|
|
11
|
+
* - `qam` — a Quick Access Menu tab.
|
|
12
|
+
* - `mainMenu` — an entry in the Steam Main Menu / left rail.
|
|
13
|
+
* The contract names no concrete host; a host may implement any, all, or none.
|
|
11
14
|
*
|
|
12
15
|
* Dependency-free by design (mirrors `@deck-shelves/api`): supporting data
|
|
13
|
-
* types are inlined.
|
|
14
|
-
* that get tightened against the plugin's `src/types.ts` / `runtime/platform.ts`
|
|
15
|
-
* when the contract formally supersedes the two divergent in-repo copies.
|
|
16
|
+
* types are inlined.
|
|
16
17
|
*/
|
|
17
18
|
declare const HOST_API_VERSION: "1.1.0";
|
|
18
19
|
interface PluginDescriptor {
|
|
@@ -28,9 +29,9 @@ interface HostLifecycle {
|
|
|
28
29
|
onMount(cb: () => void): void;
|
|
29
30
|
onUnmount(cb: () => void): void;
|
|
30
31
|
}
|
|
31
|
-
/** Generic RPC channel into the host backend.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
/** Generic RPC channel into the host backend. Each host routes it to the
|
|
33
|
+
* plugin's data backend through its own transport (an in-process bridge, a
|
|
34
|
+
* local HTTP server that proxies to the backend process, …). */
|
|
34
35
|
interface HostRpc {
|
|
35
36
|
call<Req = unknown, Res = unknown>(method: string, args?: Req): Promise<Res>;
|
|
36
37
|
}
|
|
@@ -47,10 +48,10 @@ interface HostNotifications {
|
|
|
47
48
|
toast(opts: ToastOptions): void;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
|
-
* Steam UI primitives the bundle renders with.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Steam UI primitives the bundle renders with. Every host resolves the SAME
|
|
52
|
+
* Steam webpack components through its own mechanism (a UI library, an
|
|
53
|
+
* injected runtime, …) — we do not reimplement the widgets, we find Steam's
|
|
54
|
+
* own and provide fallbacks.
|
|
54
55
|
*
|
|
55
56
|
* Typed as `unknown` to stay framework-agnostic and dependency-free; the bundle
|
|
56
57
|
* casts each to its React component / handler type at the call site.
|
|
@@ -76,7 +77,6 @@ interface HostUi {
|
|
|
76
77
|
showContextMenu: (menu: unknown) => void;
|
|
77
78
|
showModal: (modal: unknown) => void;
|
|
78
79
|
}
|
|
79
|
-
/** Opaque until reconciled in Batch 5 with the plugin's `ShelfSource` union. */
|
|
80
80
|
type ShelfSource = unknown;
|
|
81
81
|
interface PlatformCollection {
|
|
82
82
|
id: string;
|
|
@@ -118,7 +118,7 @@ interface PlatformApi {
|
|
|
118
118
|
getAppMetaBatch?(appids: number[]): Promise<Map<number, PlatformAppMeta>>;
|
|
119
119
|
navigateToApp(appid: number): void;
|
|
120
120
|
navigateToShelfSource?(source: ShelfSource, title?: string): void;
|
|
121
|
-
/**
|
|
121
|
+
/** Optional host/OS information a host may expose. */
|
|
122
122
|
getOSVersion?(): string;
|
|
123
123
|
checkCompatibility?(): boolean;
|
|
124
124
|
}
|
|
@@ -128,20 +128,67 @@ interface QamPanel {
|
|
|
128
128
|
id: string;
|
|
129
129
|
/** Label / accessible name. */
|
|
130
130
|
title: string;
|
|
131
|
-
/** Inline SVG markup (or a `data:` URI) used as the icon.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
/** Inline SVG markup (or a `data:` URI) used as the icon. Optional: a host
|
|
132
|
+
* with a first-class tab (a permanent presence with its own icon) falls back
|
|
133
|
+
* to that icon when omitted. */
|
|
134
|
+
icon?: string;
|
|
135
|
+
/** Render into the host-owned container; return an optional cleanup fn.
|
|
136
|
+
* Framework-agnostic — the way any host can accept a panel. Provide exactly
|
|
137
|
+
* one of `render` / `content`. */
|
|
138
|
+
render?(container: HTMLElement): void | (() => void);
|
|
139
|
+
/** …or a React node (or a zero-arg factory returning one) that a React-based
|
|
140
|
+
* host renders in its OWN React tree — no nested root, so the bundle's context
|
|
141
|
+
* providers reach the panel. Typed `unknown` to keep the contract
|
|
142
|
+
* dependency-free (cast at the call site, as with `HostUi`). Provide exactly
|
|
143
|
+
* one of `render` / `content`. */
|
|
144
|
+
content?: unknown;
|
|
135
145
|
}
|
|
136
146
|
interface HostQam {
|
|
137
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Register a QAM panel; returns an unregister function. A host may keep its
|
|
149
|
+
* QAM tab visible at all times (a first-class presence), even before any
|
|
150
|
+
* panel is registered.
|
|
151
|
+
*/
|
|
138
152
|
registerPanel(panel: QamPanel): () => void;
|
|
139
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* An entry in the Steam Main Menu (the left navigation rail). Navigational by
|
|
156
|
+
* nature: it selects a route or runs a callback (unlike a QAM panel, which
|
|
157
|
+
* renders content in place).
|
|
158
|
+
*/
|
|
159
|
+
interface MainMenuEntry {
|
|
160
|
+
/** Stable id — re-registering with the same id replaces the entry. */
|
|
161
|
+
id: string;
|
|
162
|
+
/** Label / accessible name. */
|
|
163
|
+
title: string;
|
|
164
|
+
/** Inline SVG markup (or a `data:` URI) used as the icon. */
|
|
165
|
+
icon: string;
|
|
166
|
+
/** Navigate to this registered route on selection… */
|
|
167
|
+
route?: string;
|
|
168
|
+
/** …or run this callback (exactly one of `route` / `onSelect` is required). */
|
|
169
|
+
onSelect?(): void;
|
|
170
|
+
}
|
|
171
|
+
interface HostMainMenu {
|
|
172
|
+
/**
|
|
173
|
+
* Register a Main Menu entry; returns an unregister function. Unlike the QAM
|
|
174
|
+
* tab, a host MUST NOT inject or show a Main Menu entry unless there is
|
|
175
|
+
* content to show — i.e. only while at least one entry is registered. No
|
|
176
|
+
* entries → nothing added to the Main Menu.
|
|
177
|
+
*/
|
|
178
|
+
registerEntry(entry: MainMenuEntry): () => void;
|
|
179
|
+
}
|
|
140
180
|
/**
|
|
141
181
|
* What the host process provides to the Deck Shelves bundle. The bundle receives
|
|
142
182
|
* this at startup as `window.__SHELVES_HOST__` and uses it to register itself,
|
|
143
|
-
* invoke host methods, add routes, render Steam-native UI, and
|
|
144
|
-
*
|
|
183
|
+
* invoke host methods, add routes, render Steam-native UI, and — where the host
|
|
184
|
+
* supports them — add optional surfaces (a Quick Access Menu tab, a Main Menu
|
|
185
|
+
* entry). Optional capabilities are feature-detected: `host.qam?.…`,
|
|
186
|
+
* `host.mainMenu?.…`.
|
|
187
|
+
*
|
|
188
|
+
* In *coexistence* (another loader owns the home) a host leaves `__SHELVES_HOST__`
|
|
189
|
+
* unset so it does not disturb host selection, yet MAY still surface its own QAM
|
|
190
|
+
* tab: the bundle registers into it through the host-selection-neutral
|
|
191
|
+
* `window.__SHELVES_QAM__` (see the `Window` augmentation below).
|
|
145
192
|
*/
|
|
146
193
|
interface HostApi {
|
|
147
194
|
readonly version: typeof HOST_API_VERSION;
|
|
@@ -153,13 +200,34 @@ interface HostApi {
|
|
|
153
200
|
readonly platform: PlatformApi;
|
|
154
201
|
/** Optional so hosts without a QAM surface still satisfy the shape. */
|
|
155
202
|
readonly qam?: HostQam;
|
|
203
|
+
/** Optional Main Menu (left-rail) surface; present only on hosts that
|
|
204
|
+
* support it. Injected/shown only while it has content (see `HostMainMenu`). */
|
|
205
|
+
readonly mainMenu?: HostMainMenu;
|
|
156
206
|
}
|
|
157
207
|
/** Shape of the runtime global the host installs in the renderer. */
|
|
158
208
|
type ShelvesHostGlobal = HostApi;
|
|
159
209
|
declare global {
|
|
160
210
|
interface Window {
|
|
161
211
|
__SHELVES_HOST__?: ShelvesHostGlobal;
|
|
212
|
+
/**
|
|
213
|
+
* A host's QAM registration surface, exposed independently of the full
|
|
214
|
+
* `HostApi`. A host with a native QAM tab installs this even when it is NOT
|
|
215
|
+
* the bundle's selected host — i.e. in *coexistence*, where another loader
|
|
216
|
+
* owns the home and `__SHELVES_HOST__` is intentionally left unset so host
|
|
217
|
+
* selection is not disturbed. A bundle may register a panel here to populate
|
|
218
|
+
* that host's tab regardless of which host it selected; the surface takes no
|
|
219
|
+
* part in host selection. When the same host also owns the home this is the
|
|
220
|
+
* very same object as `__SHELVES_HOST__.qam`.
|
|
221
|
+
*/
|
|
222
|
+
__SHELVES_QAM__?: HostQam;
|
|
223
|
+
/**
|
|
224
|
+
* Panels a bundle registered before `__SHELVES_QAM__` existed. Registration
|
|
225
|
+
* is order-independent: a bundle that boots first may push its panels here,
|
|
226
|
+
* and the host drains and clears this array the moment it installs
|
|
227
|
+
* `__SHELVES_QAM__`. Equivalent to calling `registerPanel` for each.
|
|
228
|
+
*/
|
|
229
|
+
__SHELVES_QAM_PENDING__?: QamPanel[];
|
|
162
230
|
}
|
|
163
231
|
}
|
|
164
232
|
|
|
165
|
-
export { type Disposable, HOST_API_VERSION, type HostApi, type HostLifecycle, type HostNotifications, type HostQam, type HostRoutes, type HostRpc, type HostUi, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions };
|
|
233
|
+
export { type Disposable, HOST_API_VERSION, type HostApi, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostQam, type HostRoutes, type HostRpc, type HostUi, type MainMenuEntry, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deck-shelves/host — HostApi contract
|
|
2
|
+
* @deck-shelves/host — HostApi contract.
|
|
3
3
|
*
|
|
4
|
-
* The single source of truth for the boundary between a *host*
|
|
5
|
-
* host
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The single source of truth for the boundary between a *host* and the Deck
|
|
5
|
+
* Shelves bundle. Every host ships its own adapter (one per host), and every
|
|
6
|
+
* adapter fulfils this shape, so the bundle's call sites depend only on it
|
|
7
|
+
* and never on a specific host's UI library directly.
|
|
8
8
|
*
|
|
9
|
-
* Additive-only
|
|
10
|
-
*
|
|
9
|
+
* Additive-only Optional UI-surface capabilities are additive
|
|
10
|
+
* namespaces a host implements *if it can* and the bundle feature-detects:
|
|
11
|
+
* - `qam` — a Quick Access Menu tab.
|
|
12
|
+
* - `mainMenu` — an entry in the Steam Main Menu / left rail.
|
|
13
|
+
* The contract names no concrete host; a host may implement any, all, or none.
|
|
11
14
|
*
|
|
12
15
|
* Dependency-free by design (mirrors `@deck-shelves/api`): supporting data
|
|
13
|
-
* types are inlined.
|
|
14
|
-
* that get tightened against the plugin's `src/types.ts` / `runtime/platform.ts`
|
|
15
|
-
* when the contract formally supersedes the two divergent in-repo copies.
|
|
16
|
+
* types are inlined.
|
|
16
17
|
*/
|
|
17
18
|
declare const HOST_API_VERSION: "1.1.0";
|
|
18
19
|
interface PluginDescriptor {
|
|
@@ -28,9 +29,9 @@ interface HostLifecycle {
|
|
|
28
29
|
onMount(cb: () => void): void;
|
|
29
30
|
onUnmount(cb: () => void): void;
|
|
30
31
|
}
|
|
31
|
-
/** Generic RPC channel into the host backend.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
/** Generic RPC channel into the host backend. Each host routes it to the
|
|
33
|
+
* plugin's data backend through its own transport (an in-process bridge, a
|
|
34
|
+
* local HTTP server that proxies to the backend process, …). */
|
|
34
35
|
interface HostRpc {
|
|
35
36
|
call<Req = unknown, Res = unknown>(method: string, args?: Req): Promise<Res>;
|
|
36
37
|
}
|
|
@@ -47,10 +48,10 @@ interface HostNotifications {
|
|
|
47
48
|
toast(opts: ToastOptions): void;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
|
-
* Steam UI primitives the bundle renders with.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Steam UI primitives the bundle renders with. Every host resolves the SAME
|
|
52
|
+
* Steam webpack components through its own mechanism (a UI library, an
|
|
53
|
+
* injected runtime, …) — we do not reimplement the widgets, we find Steam's
|
|
54
|
+
* own and provide fallbacks.
|
|
54
55
|
*
|
|
55
56
|
* Typed as `unknown` to stay framework-agnostic and dependency-free; the bundle
|
|
56
57
|
* casts each to its React component / handler type at the call site.
|
|
@@ -76,7 +77,6 @@ interface HostUi {
|
|
|
76
77
|
showContextMenu: (menu: unknown) => void;
|
|
77
78
|
showModal: (modal: unknown) => void;
|
|
78
79
|
}
|
|
79
|
-
/** Opaque until reconciled in Batch 5 with the plugin's `ShelfSource` union. */
|
|
80
80
|
type ShelfSource = unknown;
|
|
81
81
|
interface PlatformCollection {
|
|
82
82
|
id: string;
|
|
@@ -118,7 +118,7 @@ interface PlatformApi {
|
|
|
118
118
|
getAppMetaBatch?(appids: number[]): Promise<Map<number, PlatformAppMeta>>;
|
|
119
119
|
navigateToApp(appid: number): void;
|
|
120
120
|
navigateToShelfSource?(source: ShelfSource, title?: string): void;
|
|
121
|
-
/**
|
|
121
|
+
/** Optional host/OS information a host may expose. */
|
|
122
122
|
getOSVersion?(): string;
|
|
123
123
|
checkCompatibility?(): boolean;
|
|
124
124
|
}
|
|
@@ -128,20 +128,67 @@ interface QamPanel {
|
|
|
128
128
|
id: string;
|
|
129
129
|
/** Label / accessible name. */
|
|
130
130
|
title: string;
|
|
131
|
-
/** Inline SVG markup (or a `data:` URI) used as the icon.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
/** Inline SVG markup (or a `data:` URI) used as the icon. Optional: a host
|
|
132
|
+
* with a first-class tab (a permanent presence with its own icon) falls back
|
|
133
|
+
* to that icon when omitted. */
|
|
134
|
+
icon?: string;
|
|
135
|
+
/** Render into the host-owned container; return an optional cleanup fn.
|
|
136
|
+
* Framework-agnostic — the way any host can accept a panel. Provide exactly
|
|
137
|
+
* one of `render` / `content`. */
|
|
138
|
+
render?(container: HTMLElement): void | (() => void);
|
|
139
|
+
/** …or a React node (or a zero-arg factory returning one) that a React-based
|
|
140
|
+
* host renders in its OWN React tree — no nested root, so the bundle's context
|
|
141
|
+
* providers reach the panel. Typed `unknown` to keep the contract
|
|
142
|
+
* dependency-free (cast at the call site, as with `HostUi`). Provide exactly
|
|
143
|
+
* one of `render` / `content`. */
|
|
144
|
+
content?: unknown;
|
|
135
145
|
}
|
|
136
146
|
interface HostQam {
|
|
137
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Register a QAM panel; returns an unregister function. A host may keep its
|
|
149
|
+
* QAM tab visible at all times (a first-class presence), even before any
|
|
150
|
+
* panel is registered.
|
|
151
|
+
*/
|
|
138
152
|
registerPanel(panel: QamPanel): () => void;
|
|
139
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* An entry in the Steam Main Menu (the left navigation rail). Navigational by
|
|
156
|
+
* nature: it selects a route or runs a callback (unlike a QAM panel, which
|
|
157
|
+
* renders content in place).
|
|
158
|
+
*/
|
|
159
|
+
interface MainMenuEntry {
|
|
160
|
+
/** Stable id — re-registering with the same id replaces the entry. */
|
|
161
|
+
id: string;
|
|
162
|
+
/** Label / accessible name. */
|
|
163
|
+
title: string;
|
|
164
|
+
/** Inline SVG markup (or a `data:` URI) used as the icon. */
|
|
165
|
+
icon: string;
|
|
166
|
+
/** Navigate to this registered route on selection… */
|
|
167
|
+
route?: string;
|
|
168
|
+
/** …or run this callback (exactly one of `route` / `onSelect` is required). */
|
|
169
|
+
onSelect?(): void;
|
|
170
|
+
}
|
|
171
|
+
interface HostMainMenu {
|
|
172
|
+
/**
|
|
173
|
+
* Register a Main Menu entry; returns an unregister function. Unlike the QAM
|
|
174
|
+
* tab, a host MUST NOT inject or show a Main Menu entry unless there is
|
|
175
|
+
* content to show — i.e. only while at least one entry is registered. No
|
|
176
|
+
* entries → nothing added to the Main Menu.
|
|
177
|
+
*/
|
|
178
|
+
registerEntry(entry: MainMenuEntry): () => void;
|
|
179
|
+
}
|
|
140
180
|
/**
|
|
141
181
|
* What the host process provides to the Deck Shelves bundle. The bundle receives
|
|
142
182
|
* this at startup as `window.__SHELVES_HOST__` and uses it to register itself,
|
|
143
|
-
* invoke host methods, add routes, render Steam-native UI, and
|
|
144
|
-
*
|
|
183
|
+
* invoke host methods, add routes, render Steam-native UI, and — where the host
|
|
184
|
+
* supports them — add optional surfaces (a Quick Access Menu tab, a Main Menu
|
|
185
|
+
* entry). Optional capabilities are feature-detected: `host.qam?.…`,
|
|
186
|
+
* `host.mainMenu?.…`.
|
|
187
|
+
*
|
|
188
|
+
* In *coexistence* (another loader owns the home) a host leaves `__SHELVES_HOST__`
|
|
189
|
+
* unset so it does not disturb host selection, yet MAY still surface its own QAM
|
|
190
|
+
* tab: the bundle registers into it through the host-selection-neutral
|
|
191
|
+
* `window.__SHELVES_QAM__` (see the `Window` augmentation below).
|
|
145
192
|
*/
|
|
146
193
|
interface HostApi {
|
|
147
194
|
readonly version: typeof HOST_API_VERSION;
|
|
@@ -153,13 +200,34 @@ interface HostApi {
|
|
|
153
200
|
readonly platform: PlatformApi;
|
|
154
201
|
/** Optional so hosts without a QAM surface still satisfy the shape. */
|
|
155
202
|
readonly qam?: HostQam;
|
|
203
|
+
/** Optional Main Menu (left-rail) surface; present only on hosts that
|
|
204
|
+
* support it. Injected/shown only while it has content (see `HostMainMenu`). */
|
|
205
|
+
readonly mainMenu?: HostMainMenu;
|
|
156
206
|
}
|
|
157
207
|
/** Shape of the runtime global the host installs in the renderer. */
|
|
158
208
|
type ShelvesHostGlobal = HostApi;
|
|
159
209
|
declare global {
|
|
160
210
|
interface Window {
|
|
161
211
|
__SHELVES_HOST__?: ShelvesHostGlobal;
|
|
212
|
+
/**
|
|
213
|
+
* A host's QAM registration surface, exposed independently of the full
|
|
214
|
+
* `HostApi`. A host with a native QAM tab installs this even when it is NOT
|
|
215
|
+
* the bundle's selected host — i.e. in *coexistence*, where another loader
|
|
216
|
+
* owns the home and `__SHELVES_HOST__` is intentionally left unset so host
|
|
217
|
+
* selection is not disturbed. A bundle may register a panel here to populate
|
|
218
|
+
* that host's tab regardless of which host it selected; the surface takes no
|
|
219
|
+
* part in host selection. When the same host also owns the home this is the
|
|
220
|
+
* very same object as `__SHELVES_HOST__.qam`.
|
|
221
|
+
*/
|
|
222
|
+
__SHELVES_QAM__?: HostQam;
|
|
223
|
+
/**
|
|
224
|
+
* Panels a bundle registered before `__SHELVES_QAM__` existed. Registration
|
|
225
|
+
* is order-independent: a bundle that boots first may push its panels here,
|
|
226
|
+
* and the host drains and clears this array the moment it installs
|
|
227
|
+
* `__SHELVES_QAM__`. Equivalent to calling `registerPanel` for each.
|
|
228
|
+
*/
|
|
229
|
+
__SHELVES_QAM_PENDING__?: QamPanel[];
|
|
162
230
|
}
|
|
163
231
|
}
|
|
164
232
|
|
|
165
|
-
export { type Disposable, HOST_API_VERSION, type HostApi, type HostLifecycle, type HostNotifications, type HostQam, type HostRoutes, type HostRpc, type HostUi, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions };
|
|
233
|
+
export { type Disposable, HOST_API_VERSION, type HostApi, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostQam, type HostRoutes, type HostRpc, type HostUi, type MainMenuEntry, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck-shelves/host",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Deck Shelves host contract — the HostApi types all host adapters and the bundle build against.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -66,16 +66,21 @@
|
|
|
66
66
|
"overrides": {
|
|
67
67
|
"esbuild": "^0.25.0",
|
|
68
68
|
"vite": "^6.4.2",
|
|
69
|
-
"form-data": "^4.0.6"
|
|
69
|
+
"form-data": "^4.0.6",
|
|
70
|
+
"brace-expansion@1": "^1.1.17",
|
|
71
|
+
"brace-expansion@5": "^5.0.9",
|
|
72
|
+
"js-yaml@4": "^4.3.1",
|
|
73
|
+
"nanoid@3": "^3.3.18",
|
|
74
|
+
"postcss@8": "^8.5.23"
|
|
70
75
|
}
|
|
71
76
|
},
|
|
72
77
|
"devDependencies": {
|
|
73
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
-
"eslint": "^9.39.
|
|
78
|
+
"@typescript-eslint/parser": "^8.67.0",
|
|
79
|
+
"eslint": "^9.39.5",
|
|
75
80
|
"jsdom": "^25.0.1",
|
|
76
81
|
"tsup": "^8.5.1",
|
|
77
82
|
"typescript": "^5.9.3",
|
|
78
|
-
"vitest": "^3.2.
|
|
83
|
+
"vitest": "^3.2.7"
|
|
79
84
|
},
|
|
80
85
|
"packageManager": "pnpm@10.33.0"
|
|
81
86
|
}
|