@hadoku/rooms-protocol 0.44.7 → 0.44.9
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/game-bundle.d.ts +13 -0
- package/dist/game-bundle.d.ts.map +1 -1
- package/dist/game-bundle.js +6 -3
- package/package.json +1 -1
package/dist/game-bundle.d.ts
CHANGED
|
@@ -41,6 +41,19 @@ export interface MountedGameBundle {
|
|
|
41
41
|
unmount(): void;
|
|
42
42
|
/** The context changed (theme, identity, leadership). */
|
|
43
43
|
update(ctx: GameBundleContext): void;
|
|
44
|
+
/**
|
|
45
|
+
* Draw the game's own preferences into `el`, an element inside the host's
|
|
46
|
+
* settings popout, and return the function that removes them. Called when
|
|
47
|
+
* the popout opens and the cleanup when it closes, so it may run many times
|
|
48
|
+
* over one mount. Optional: a game without preferences omits it and the
|
|
49
|
+
* host draws no section for it.
|
|
50
|
+
*
|
|
51
|
+
* `el` is in the HOST's document, outside the game's own element, so give
|
|
52
|
+
* it a shadow root of its own as `mount` does; the host's theme custom
|
|
53
|
+
* properties (`--color-*`) still inherit into it. The host runs every open
|
|
54
|
+
* cleanup before `unmount()`, and calling a cleanup again is harmless.
|
|
55
|
+
*/
|
|
56
|
+
mountSettings?(el: HTMLElement): () => void;
|
|
44
57
|
}
|
|
45
58
|
/** What a `module` entry's URL must export. */
|
|
46
59
|
export interface GameBundleModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-bundle.d.ts","sourceRoot":"","sources":["../src/game-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2EAA2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC;0EACsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;uCAGmC;IACnC,OA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,CAAC;CAChG;AAED,MAAM,MAAM,SAAS;AACnB,uCAAuC;AACrC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE;AAC9D,wEAAwE;GACtE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAG5E;AAED,kEAAkE;AAClE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAM9E"}
|
package/dist/game-bundle.js
CHANGED
|
@@ -24,7 +24,10 @@ export function isGameBundleModule(value) {
|
|
|
24
24
|
}
|
|
25
25
|
/** Whether `value` is what a bundle's `mount` must resolve to. */
|
|
26
26
|
export function isMountedGameBundle(value) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (typeof value !== 'object' || value === null)
|
|
28
|
+
return false;
|
|
29
|
+
const v = value;
|
|
30
|
+
return typeof v.unmount === 'function'
|
|
31
|
+
&& typeof v.update === 'function'
|
|
32
|
+
&& (v.mountSettings === undefined || typeof v.mountSettings === 'function');
|
|
30
33
|
}
|
package/package.json
CHANGED