@hopple/sdk 0.1.0-rc.2 → 0.1.0-rc.3
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 +53 -28
- package/index.d.ts +41 -37
- package/index.js +41 -3585
- package/package.json +3 -6
- package/hopple-sdk.min.js +0 -155
package/README.md
CHANGED
|
@@ -42,23 +42,25 @@ Both are named in the project's hopple config (`hopple.config.ts`, `.js` or
|
|
|
42
42
|
like. `npx hopple create my-game` sets up the recommended way (Vite, with the
|
|
43
43
|
config in TypeScript); see [`hopple create`](https://docs.hopple.app/cli.md#hopple-create).
|
|
44
44
|
|
|
45
|
-
The host loads the page into a frame sandboxed with only `allow-scripts
|
|
46
|
-
`allow-pointer-lock
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **No network.** A game can't fetch, open a socket or load anything from
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
The host loads the page into a frame sandboxed with only `allow-scripts`,
|
|
46
|
+
`allow-same-origin` and `allow-pointer-lock`, every version on an origin of
|
|
47
|
+
its own. That has some consequences you need to plan for:
|
|
48
|
+
|
|
49
|
+
- **Its output directory is published.** `hopple publish` uploads the
|
|
50
|
+
directory the page is in, with the page as its `index.html`, and it refuses
|
|
51
|
+
a page that loads a file the directory doesn't hold. Refer to files
|
|
52
|
+
relatively. A page beside its config is published alone.
|
|
53
|
+
- **No network.** A game can't fetch, open a socket or load anything from
|
|
54
|
+
another host. It may load its own files, and `data:` and `blob:` URLs.
|
|
55
|
+
Anything the game could send out could carry what it knows about the
|
|
56
|
+
player.
|
|
57
|
+
- **No `localStorage`, `sessionStorage`, IndexedDB, Cache Storage or
|
|
58
|
+
cookies.** Whatever a game stored would be cleared every time its page
|
|
59
|
+
loads, so the runtime makes each of them throw an error naming
|
|
60
|
+
`Hopple.save`, and `hopple check` refuses a game that uses them. Use
|
|
61
|
+
[`sdk.save`](#save) instead.
|
|
62
|
+
- **Every address relative, no `<base>`, and UTF-8 pages.** `hopple check`
|
|
63
|
+
refuses the rest.
|
|
62
64
|
- **No `alert`, `confirm` or `prompt`.** They are blocked in the sandbox.
|
|
63
65
|
- **Sound may need a tap inside the game first.** Browsers only allow audio
|
|
64
66
|
after a user gesture in the frame. Sound routed through
|
|
@@ -67,15 +69,35 @@ The host loads the page into a frame sandboxed with only `allow-scripts` and
|
|
|
67
69
|
|
|
68
70
|
## Getting started
|
|
69
71
|
|
|
70
|
-
The SDK
|
|
72
|
+
The SDK is not part of your game. It is **the runtime**, which whatever runs
|
|
73
|
+
the game serves beside it, and your page loads as its first script:
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<script src="_rt/1/hopple.js"></script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The runtime defines the global `Hopple`, holding everything this guide
|
|
80
|
+
describes. Because it is served rather than built into the game, a fix to the
|
|
81
|
+
SDK (input, on-screen controls, audio, layout, the loop, save) reaches every
|
|
82
|
+
game without a rebuild. `_rt/1/` is the newest release of major 1; a change
|
|
83
|
+
that would break games is a new major, which a game takes by changing its
|
|
84
|
+
tag. Keep the address relative, as above: Hopple serves a game at the root of
|
|
85
|
+
its own origin, and a host like itch.io under a path, with `_rt/` beside
|
|
86
|
+
`index.html` either way.
|
|
71
87
|
|
|
72
88
|
- **With a bundler** (Vite, esbuild, webpack, Rollup, Parcel, Bun):
|
|
73
|
-
`npm install @hopple/sdk` and import it.
|
|
74
|
-
every doc comment, in `node_modules/@hopple/sdk/index.d.ts
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
(`
|
|
78
|
-
|
|
89
|
+
`npm install @hopple/sdk` and import it. The package is the SDK's types,
|
|
90
|
+
with every doc comment, in `node_modules/@hopple/sdk/index.d.ts`, and a
|
|
91
|
+
stub of a few lines that forwards each import to `Hopple`: your bundle
|
|
92
|
+
carries the stub, never the SDK. Set your bundler to write relative
|
|
93
|
+
addresses (Vite: `base: './'`).
|
|
94
|
+
- **Without one:** use the global `Hopple` directly
|
|
95
|
+
(`const sdk = await Hopple.init()` in a module script or an async function).
|
|
96
|
+
|
|
97
|
+
`hopple check`, `hopple publish` and the server refuse a page that doesn't
|
|
98
|
+
load the runtime first, or that carries a copy of the SDK. Games published
|
|
99
|
+
before the runtime keep the SDK they bundled, and get no runtime fixes until
|
|
100
|
+
they are rebuilt this way.
|
|
79
101
|
|
|
80
102
|
A `hopple.config.json` can point its `"$schema"` at
|
|
81
103
|
`./node_modules/@hopple/sdk/config.schema.json` for an editor to check it; a
|
|
@@ -719,12 +741,15 @@ sdk.pause.on(async (paused) => { // the host asked; return a promise to make i
|
|
|
719
741
|
- [ ] Print button labels from `sdk.input.mapping`, and read input once per frame.
|
|
720
742
|
- [ ] Route every sound through `sdk.audio.output` or `media`, or multiply it by `sdk.audio.volume(channel)`, and obey mute.
|
|
721
743
|
- [ ] Keep `sdk.pause` up to date, separately from the loop.
|
|
722
|
-
- [ ]
|
|
744
|
+
- [ ] Load the runtime as the page's first script, `<script src="_rt/1/hopple.js"></script>`, and import `@hopple/sdk` rather than bundling a copy.
|
|
745
|
+
- [ ] Refer to every file relatively, and publish the output directory.
|
|
723
746
|
|
|
724
747
|
## License
|
|
725
748
|
|
|
726
|
-
MIT; see `LICENSE`.
|
|
727
|
-
|
|
749
|
+
MIT; see `LICENSE`. A game carries the stub, which carries its one-line
|
|
750
|
+
notice, `/*! @hopple/sdk <version> | Copyright (c) 2026 The Hopple authors | MIT License */`.
|
|
728
751
|
Bundlers keep comments that start with `/*!` unless they minify them away:
|
|
729
752
|
with Vite, set `build.rolldownOptions.output.comments.legal` to `true`, as a
|
|
730
|
-
`hopple create` project does. The
|
|
753
|
+
`hopple create` project does. The runtime, which is the SDK itself, is MIT
|
|
754
|
+
too, and is served beside the game rather than carried in it. The license
|
|
755
|
+
covers the code, not the Hopple name or logo.
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
1
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/achievement.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* The largest value progress will carry.
|
|
4
4
|
*
|
|
@@ -28,7 +28,7 @@ type AchievementResult = {
|
|
|
28
28
|
progress?: number;
|
|
29
29
|
};
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
31
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/analytics.d.ts
|
|
32
32
|
/**
|
|
33
33
|
* What a game says happened.
|
|
34
34
|
*
|
|
@@ -59,7 +59,7 @@ type AnalyticsValue = string | number | boolean;
|
|
|
59
59
|
/** @group Analytics */
|
|
60
60
|
type AnalyticsProps = Record<string, AnalyticsValue>;
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
62
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/audio.d.ts
|
|
63
63
|
/**
|
|
64
64
|
* How loud the game is allowed to be, which is the host's to decide and the
|
|
65
65
|
* game's to obey.
|
|
@@ -164,7 +164,7 @@ declare const AUDIO_FULL: AudioState;
|
|
|
164
164
|
*/
|
|
165
165
|
declare function audioVolumeOf(state: AudioState, channel?: string): number;
|
|
166
166
|
//#endregion
|
|
167
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
167
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/errors.d.ts
|
|
168
168
|
/**
|
|
169
169
|
* How a call fails.
|
|
170
170
|
*
|
|
@@ -234,7 +234,7 @@ declare class BridgeError extends Error {
|
|
|
234
234
|
constructor(error: ProtocolError);
|
|
235
235
|
}
|
|
236
236
|
//#endregion
|
|
237
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
237
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/envelope.d.ts
|
|
238
238
|
/**
|
|
239
239
|
* `p` is the protocol version, carried on every message rather than only at the
|
|
240
240
|
* handshake, because a message that arrives without context still has to be
|
|
@@ -275,7 +275,7 @@ type Envelope = {
|
|
|
275
275
|
data: unknown;
|
|
276
276
|
};
|
|
277
277
|
//#endregion
|
|
278
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
278
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/input.d.ts
|
|
279
279
|
/**
|
|
280
280
|
* What the host says about how this game is being played.
|
|
281
281
|
*
|
|
@@ -386,7 +386,7 @@ type InputChangeCause =
|
|
|
386
386
|
/** A player changed how the on-screen controls behave. */
|
|
387
387
|
'setting';
|
|
388
388
|
//#endregion
|
|
389
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
389
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/panel.d.ts
|
|
390
390
|
/**
|
|
391
391
|
* The pages of the panel this version of the protocol has a name for.
|
|
392
392
|
*
|
|
@@ -416,7 +416,7 @@ type PageId =
|
|
|
416
416
|
/** @group Panels */
|
|
417
417
|
declare const PAGES: readonly PageId[];
|
|
418
418
|
//#endregion
|
|
419
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
419
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/pause.d.ts
|
|
420
420
|
/**
|
|
421
421
|
* Whether the game is holding still, which the host may ask for and only the
|
|
422
422
|
* game can answer.
|
|
@@ -489,7 +489,7 @@ declare const PAUSE_STATES: readonly PauseState[];
|
|
|
489
489
|
*/
|
|
490
490
|
declare const PAUSE_NONE: PauseState;
|
|
491
491
|
//#endregion
|
|
492
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
492
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/save.d.ts
|
|
493
493
|
/**
|
|
494
494
|
* The one thing a game may keep.
|
|
495
495
|
*
|
|
@@ -540,7 +540,7 @@ type SaveStored = {
|
|
|
540
540
|
bytes: number;
|
|
541
541
|
};
|
|
542
542
|
//#endregion
|
|
543
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
543
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/score.d.ts
|
|
544
544
|
/**
|
|
545
545
|
* What a player did, as one number.
|
|
546
546
|
*
|
|
@@ -616,7 +616,7 @@ type ScoreStanding = {
|
|
|
616
616
|
of?: number;
|
|
617
617
|
};
|
|
618
618
|
//#endregion
|
|
619
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
619
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/share.d.ts
|
|
620
620
|
/**
|
|
621
621
|
* A link to this game, offered to the player by the host.
|
|
622
622
|
*
|
|
@@ -715,7 +715,7 @@ type ShareMeta = {
|
|
|
715
715
|
[key: string]: ShareMetaValue;
|
|
716
716
|
};
|
|
717
717
|
//#endregion
|
|
718
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
718
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/methods.d.ts
|
|
719
719
|
/**
|
|
720
720
|
* How far a game has got with its own preparation.
|
|
721
721
|
*
|
|
@@ -895,7 +895,7 @@ type DeviceInfo = {
|
|
|
895
895
|
tier: DeviceTier;
|
|
896
896
|
};
|
|
897
897
|
//#endregion
|
|
898
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
898
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/listeners.d.ts
|
|
899
899
|
/**
|
|
900
900
|
* The one way anything here is listened to: `on(listener)` hands back the
|
|
901
901
|
* function that stops it.
|
|
@@ -924,7 +924,7 @@ type DeviceInfo = {
|
|
|
924
924
|
*/
|
|
925
925
|
type Unsubscribe = () => void;
|
|
926
926
|
//#endregion
|
|
927
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
927
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/protocol/src/transport.d.ts
|
|
928
928
|
/** @group Bridge */
|
|
929
929
|
type Transport = {
|
|
930
930
|
send(message: Envelope): void;
|
|
@@ -1022,7 +1022,7 @@ declare global {
|
|
|
1022
1022
|
var __HOPPLE_SET_SHIM__: ((shim: HoppleShim) => void) | undefined;
|
|
1023
1023
|
}
|
|
1024
1024
|
//#endregion
|
|
1025
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
1025
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/manifest/src/manifest.d.ts
|
|
1026
1026
|
/**
|
|
1027
1027
|
* What a game says about itself.
|
|
1028
1028
|
*
|
|
@@ -1919,7 +1919,7 @@ type HoppleConfig = {
|
|
|
1919
1919
|
manifest: GameManifest;
|
|
1920
1920
|
};
|
|
1921
1921
|
//#endregion
|
|
1922
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
1922
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/achievements.d.ts
|
|
1923
1923
|
/**
|
|
1924
1924
|
* Where this player stands on one achievement.
|
|
1925
1925
|
*
|
|
@@ -1994,6 +1994,9 @@ type Achievements<Id extends string = string, Measured extends string = Id> = {
|
|
|
1994
1994
|
* Legitimate on a measured achievement too, and it finishes it: the progress
|
|
1995
1995
|
* goes to the target rather than leaving something unlocked at 40 of 100.
|
|
1996
1996
|
*
|
|
1997
|
+
* Cheap to call every frame: one already unlocked, or already sent, is not
|
|
1998
|
+
* sent again.
|
|
1999
|
+
*
|
|
1997
2000
|
* An id this game's manifest never declared is reported to `onError`, as an
|
|
1998
2001
|
* author's mistake and not a player's.
|
|
1999
2002
|
*/
|
|
@@ -2004,7 +2007,8 @@ type Achievements<Id extends string = string, Measured extends string = Id> = {
|
|
|
2004
2007
|
* *At 40*, not *add one*. The host keeps whichever value the manifest calls
|
|
2005
2008
|
* better — the larger on an ordinary count, the smaller on a best time — so
|
|
2006
2009
|
* reporting the same number twice does nothing, and reporting a worse one is
|
|
2007
|
-
* not a regression. Reaching the target unlocks it.
|
|
2010
|
+
* not a regression. Reaching the target unlocks it. The same value as the
|
|
2011
|
+
* last one sent is not sent again, so this is cheap to call every frame.
|
|
2008
2012
|
*
|
|
2009
2013
|
* Against an achievement declared as a flag, the host refuses it and the
|
|
2010
2014
|
* refusal is reported to `onError`: there is no target to move toward, and a
|
|
@@ -2013,7 +2017,7 @@ type Achievements<Id extends string = string, Measured extends string = Id> = {
|
|
|
2013
2017
|
progress(id: Measured, value: number): void;
|
|
2014
2018
|
};
|
|
2015
2019
|
//#endregion
|
|
2016
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2020
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/analytics.d.ts
|
|
2017
2021
|
/**
|
|
2018
2022
|
* @group Analytics
|
|
2019
2023
|
* @category Important
|
|
@@ -2030,7 +2034,7 @@ type Analytics<Events extends object = Record<string, AnalyticsProps>> = {
|
|
|
2030
2034
|
track<Event extends keyof Events & string>(name: Event, props?: Events[Event]): void;
|
|
2031
2035
|
};
|
|
2032
2036
|
//#endregion
|
|
2033
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2037
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/audio.d.ts
|
|
2034
2038
|
/**
|
|
2035
2039
|
* Something about the game's sound changed: the host's order, the player's
|
|
2036
2040
|
* mute, a fader. Read what you need — `volume(channel)`, `allowed` — and apply
|
|
@@ -2123,7 +2127,7 @@ type Audio<Channel extends string = string> = {
|
|
|
2123
2127
|
media(element: HTMLMediaElement, channel?: Channel): Unsubscribe;
|
|
2124
2128
|
};
|
|
2125
2129
|
//#endregion
|
|
2126
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2130
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/info.d.ts
|
|
2127
2131
|
/**
|
|
2128
2132
|
* What the host said, frozen.
|
|
2129
2133
|
*
|
|
@@ -2141,7 +2145,7 @@ type Info = Readonly<{
|
|
|
2141
2145
|
device: Readonly<DeviceInfo>;
|
|
2142
2146
|
}>;
|
|
2143
2147
|
//#endregion
|
|
2144
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2148
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/layout.d.ts
|
|
2145
2149
|
/**
|
|
2146
2150
|
* How much of each edge belongs to the host. CSS pixels.
|
|
2147
2151
|
*
|
|
@@ -2251,7 +2255,7 @@ type InsetPolicy = {
|
|
|
2251
2255
|
*/
|
|
2252
2256
|
declare function insetsFrom(obstructions: readonly Obstruction[], frame: Size, policy?: InsetPolicy): Insets;
|
|
2253
2257
|
//#endregion
|
|
2254
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2258
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/names.d.ts
|
|
2255
2259
|
/**
|
|
2256
2260
|
* The keys of a declared map, or `string` where the map is not a literal one —
|
|
2257
2261
|
* which is what a manifest typed as the wide `GameManifest` gives — and
|
|
@@ -2358,7 +2362,7 @@ type EventProps<M> = M extends {
|
|
|
2358
2362
|
*/
|
|
2359
2363
|
type StickName = 'pad.left.stick' | 'pad.right.stick' | 'pad.stick' | `controls.${string}`;
|
|
2360
2364
|
//#endregion
|
|
2361
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2365
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/input/state.d.ts
|
|
2362
2366
|
/**
|
|
2363
2367
|
* Where the pointer is, in the frame's own coordinates.
|
|
2364
2368
|
*
|
|
@@ -2419,7 +2423,7 @@ type InputSnapshot<Action extends string = string> = {
|
|
|
2419
2423
|
pointer: PointerState | null;
|
|
2420
2424
|
};
|
|
2421
2425
|
//#endregion
|
|
2422
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2426
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/input/controls.d.ts
|
|
2423
2427
|
/**
|
|
2424
2428
|
* The name a host leaves its input shim under.
|
|
2425
2429
|
*
|
|
@@ -2599,7 +2603,7 @@ declare function isInputShim(value: unknown): value is InputShim;
|
|
|
2599
2603
|
*/
|
|
2600
2604
|
declare const INPUT_CONTRACT = 4;
|
|
2601
2605
|
//#endregion
|
|
2602
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2606
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/input/bindings.d.ts
|
|
2603
2607
|
/**
|
|
2604
2608
|
* The standard mapping's buttons, by index, as the names this SDK uses.
|
|
2605
2609
|
*
|
|
@@ -2651,7 +2655,7 @@ declare function servesScheme(binding: string, scheme: InputScheme): boolean;
|
|
|
2651
2655
|
*/
|
|
2652
2656
|
declare function labelFor(binding: string, scheme: InputScheme): string;
|
|
2653
2657
|
//#endregion
|
|
2654
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2658
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/input/index.d.ts
|
|
2655
2659
|
/**
|
|
2656
2660
|
* How far a stick moves before it counts, where no shim has an opinion.
|
|
2657
2661
|
*
|
|
@@ -2787,7 +2791,7 @@ type Controls<Layout extends string = string> = {
|
|
|
2787
2791
|
readonly available: boolean;
|
|
2788
2792
|
};
|
|
2789
2793
|
//#endregion
|
|
2790
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2794
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/lifecycle.d.ts
|
|
2791
2795
|
/** @group Lifecycle */
|
|
2792
2796
|
type LifecycleListener = (phase: Phase, previous: Phase) => void | Promise<void>;
|
|
2793
2797
|
/**
|
|
@@ -2806,7 +2810,7 @@ type Lifecycle = {
|
|
|
2806
2810
|
on(listener: LifecycleListener): Unsubscribe;
|
|
2807
2811
|
};
|
|
2808
2812
|
//#endregion
|
|
2809
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2813
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/loop.d.ts
|
|
2810
2814
|
/**
|
|
2811
2815
|
* The host has let the game run its loop, or stopped it. Return a promise to
|
|
2812
2816
|
* make the host wait.
|
|
@@ -2860,7 +2864,7 @@ type Loop = {
|
|
|
2860
2864
|
tick(frame: FrameCallback): Unsubscribe;
|
|
2861
2865
|
};
|
|
2862
2866
|
//#endregion
|
|
2863
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2867
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/panel.d.ts
|
|
2864
2868
|
/**
|
|
2865
2869
|
* Where the host's panel stands over the game.
|
|
2866
2870
|
*
|
|
@@ -2969,7 +2973,7 @@ type Panel = {
|
|
|
2969
2973
|
open(page: PageId): void;
|
|
2970
2974
|
};
|
|
2971
2975
|
//#endregion
|
|
2972
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
2976
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/pause.d.ts
|
|
2973
2977
|
/**
|
|
2974
2978
|
* The host has asked for a pause, or for the game to carry on.
|
|
2975
2979
|
*
|
|
@@ -3030,7 +3034,7 @@ type Pause = {
|
|
|
3030
3034
|
on(listener: PauseListener): Unsubscribe;
|
|
3031
3035
|
};
|
|
3032
3036
|
//#endregion
|
|
3033
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3037
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/resources.d.ts
|
|
3034
3038
|
/**
|
|
3035
3039
|
* The host has let the game hold its resources again, or asked for them back.
|
|
3036
3040
|
* Return a promise to make the host wait until they have gone, or come back.
|
|
@@ -3060,7 +3064,7 @@ type Resources = {
|
|
|
3060
3064
|
on(listener: ResourcesListener): Unsubscribe;
|
|
3061
3065
|
};
|
|
3062
3066
|
//#endregion
|
|
3063
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3067
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/save.d.ts
|
|
3064
3068
|
/**
|
|
3065
3069
|
* What a game gets back from a read: its own schema number, and its state.
|
|
3066
3070
|
*
|
|
@@ -3149,7 +3153,7 @@ type Save = {
|
|
|
3149
3153
|
readonly maxBytes: number;
|
|
3150
3154
|
};
|
|
3151
3155
|
//#endregion
|
|
3152
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3156
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/score.d.ts
|
|
3153
3157
|
/**
|
|
3154
3158
|
* Where this player stands on every board, as far as anybody has said.
|
|
3155
3159
|
*
|
|
@@ -3226,7 +3230,7 @@ type Score<Board extends string = string> = {
|
|
|
3226
3230
|
}): Promise<ScoreResult>;
|
|
3227
3231
|
};
|
|
3228
3232
|
//#endregion
|
|
3229
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3233
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/share.d.ts
|
|
3230
3234
|
/**
|
|
3231
3235
|
* @group Share
|
|
3232
3236
|
* @category Important
|
|
@@ -3298,7 +3302,7 @@ type Share = {
|
|
|
3298
3302
|
}): void;
|
|
3299
3303
|
};
|
|
3300
3304
|
//#endregion
|
|
3301
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3305
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/init.d.ts
|
|
3302
3306
|
/**
|
|
3303
3307
|
* What `init` hands back: every namespace a game has, on one object.
|
|
3304
3308
|
*
|
|
@@ -3603,7 +3607,7 @@ type InitOptions = {
|
|
|
3603
3607
|
*/
|
|
3604
3608
|
declare function init<M extends object = GameManifest>(options?: InitOptions): Promise<GameSdk<M>>;
|
|
3605
3609
|
//#endregion
|
|
3606
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3610
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/transport.d.ts
|
|
3607
3611
|
/**
|
|
3608
3612
|
* How long a game with no shim and no parent waits for one to turn up.
|
|
3609
3613
|
*
|
|
@@ -3633,7 +3637,7 @@ type HostTransportOptions = {
|
|
|
3633
3637
|
*/
|
|
3634
3638
|
declare function hostTransport(options?: HostTransportOptions): Promise<Transport>;
|
|
3635
3639
|
//#endregion
|
|
3636
|
-
//#region ../../../../../../../tmp/hopple-sdk-types-
|
|
3640
|
+
//#region ../../../../../../../tmp/hopple-sdk-types-DAYaix/game/src/shim.d.ts
|
|
3637
3641
|
/**
|
|
3638
3642
|
* Whether an arbitrary value is a shim this SDK knows how to speak to.
|
|
3639
3643
|
*
|