@wasm-gaming/rsdkv5-wasm 0.1.1 → 0.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 +106 -6
- package/dist/rsdkv5/app/app.css +176 -0
- package/dist/rsdkv5/app/app.js +527 -0
- package/dist/rsdkv5/app/assets/player-knuckles.svg +757 -0
- package/dist/rsdkv5/app/assets/player-sonic.svg +720 -0
- package/dist/rsdkv5/app/assets/player-sonictails.svg +1414 -0
- package/dist/rsdkv5/app/assets/player-tails.svg +979 -0
- package/dist/rsdkv5/engine-specs.js +382 -0
- package/dist/rsdkv5/rsdkv5.js +1 -1
- package/dist/rsdkv5/rsdkv5.options.d.ts +61 -13
- package/dist/rsdkv5/rsdkv5.options.d.ts.map +1 -1
- package/dist/rsdkv5/rsdkv5.options.js +35 -21
- package/dist/rsdkv5/rsdkv5.options.js.map +1 -1
- package/dist/rsdkv5/rsdkv5.sdk.d.ts +137 -32
- package/dist/rsdkv5/rsdkv5.sdk.d.ts.map +1 -1
- package/dist/rsdkv5/rsdkv5.sdk.js +474 -181
- package/dist/rsdkv5/rsdkv5.sdk.js.map +1 -1
- package/dist/rsdkv5/rsdkv5.wasm +0 -0
- package/package.json +9 -15
- package/src/app/app.css +176 -0
- package/src/app/app.js +527 -0
- package/src/app/assets/player-knuckles.svg +757 -0
- package/src/app/assets/player-sonic.svg +720 -0
- package/src/app/assets/player-sonictails.svg +1414 -0
- package/src/app/assets/player-tails.svg +979 -0
- package/src/rsdkv5.options.ts +96 -43
- package/src/rsdkv5.sdk.ts +562 -203
- package/dist/manifest.json +0 -69
- package/dist/rsdkv5/rsdkv5.manifest.d.ts +0 -4
- package/dist/rsdkv5/rsdkv5.manifest.d.ts.map +0 -1
- package/dist/rsdkv5/rsdkv5.manifest.js +0 -39
- package/dist/rsdkv5/rsdkv5.manifest.js.map +0 -1
- package/src/rsdkv5.manifest.ts +0 -44
|
@@ -1,19 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* What RSDKv5 accepts, as types and as data.
|
|
3
|
+
*
|
|
4
|
+
* The four payloads of the wasm-gaming engine contract, closed for this engine, and
|
|
5
|
+
* {@link RSDKV5_SPEC} — the same thing as data the contract's base class reads:
|
|
6
|
+
* every default lives there and nowhere else.
|
|
7
|
+
*/
|
|
8
|
+
import type { EnginePayloads, EngineSpec } from '@wasm-gaming/engine-specs';
|
|
9
|
+
/** Bytes, or a thunk that produces them only when the engine actually needs them. */
|
|
10
|
+
export type Rsdkv5Asset = Uint8Array | ArrayBuffer | null | (() => Uint8Array | ArrayBuffer | null | Promise<Uint8Array | ArrayBuffer | null>);
|
|
11
|
+
/** The engine, written into the generated `Settings.ini`. Fixed for the life of the wasm. */
|
|
12
|
+
export interface Rsdkv5Config {
|
|
13
|
+
/** Sonic Mania's native dev menu. A host draws its own from `play.devMenu`. */
|
|
7
14
|
devMenu?: boolean;
|
|
8
|
-
/** Enables the debug hooks exposed by the web build. */
|
|
9
|
-
engineDebugMode?: boolean;
|
|
10
|
-
/** VSync the engine's SDL window. */
|
|
11
15
|
vsync?: boolean;
|
|
12
|
-
/**
|
|
16
|
+
/** RSDKv5 language index (0 = English). */
|
|
13
17
|
language?: number;
|
|
14
|
-
/**
|
|
18
|
+
/** RSDKv5 region (-1 = auto). */
|
|
15
19
|
region?: number;
|
|
20
|
+
/** Emscripten glue URL. Defaults to `./rsdkv5.js` next to the SDK. */
|
|
21
|
+
jsUrl?: string;
|
|
22
|
+
/** WASM URL. Defaults to `./rsdkv5.wasm` next to the SDK. */
|
|
23
|
+
wasmUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The session. Nothing per-session yet. */
|
|
26
|
+
export type Rsdkv5Options = Record<string, never>;
|
|
27
|
+
export interface Rsdkv5Assets {
|
|
28
|
+
/** The game's `Data.rsdk` (Sonic Mania). Required to start. */
|
|
29
|
+
data?: Rsdkv5Asset;
|
|
30
|
+
/** A ready-made `Settings.ini`; omitted, one is generated from `config`. */
|
|
31
|
+
settings?: Rsdkv5Asset;
|
|
32
|
+
}
|
|
33
|
+
/** Where this engine's files live, and whether they outlive the page. */
|
|
34
|
+
export interface Rsdkv5Storage {
|
|
35
|
+
/**
|
|
36
|
+
* Per-game folder, relative to the engine's own: files land in `rsdkv5/<namespace>/`
|
|
37
|
+
* (WASMFS `/data/rsdkv5/<namespace>`, and the OPFS folder the save is mirrored to).
|
|
38
|
+
* Segments are cleaned (`.`/`..` dropped, odd characters → `_`); a leading
|
|
39
|
+
* `rsdkv5/` is stripped once. `play.storagePath` gives the result.
|
|
40
|
+
*
|
|
41
|
+
* @defaultValue `"default"`
|
|
42
|
+
*/
|
|
43
|
+
namespace?: string;
|
|
44
|
+
/** `null` keeps nothing; otherwise the game's user files are mirrored to OPFS. */
|
|
45
|
+
persist?: 'opfs' | null;
|
|
46
|
+
}
|
|
47
|
+
export interface Rsdkv5Events {
|
|
48
|
+
/** Save files changed and were written to `rsdkv5/<namespace>/`. */
|
|
49
|
+
saves: {
|
|
50
|
+
files: string[];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface Rsdkv5Payloads extends EnginePayloads {
|
|
54
|
+
config: Rsdkv5Config;
|
|
55
|
+
options: Rsdkv5Options;
|
|
56
|
+
assets: Rsdkv5Assets;
|
|
57
|
+
storage: Rsdkv5Storage;
|
|
58
|
+
events: Rsdkv5Events;
|
|
16
59
|
}
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
60
|
+
/** The native picture, which the SDK scales to fit its mount. */
|
|
61
|
+
export declare const RSDKV5_VIDEO: {
|
|
62
|
+
readonly width: 424;
|
|
63
|
+
readonly height: 240;
|
|
64
|
+
readonly aspect: "16:9";
|
|
65
|
+
};
|
|
66
|
+
export declare const RSDKV5_SPEC: EngineSpec<Rsdkv5Payloads>;
|
|
19
67
|
//# sourceMappingURL=rsdkv5.options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsdkv5.options.d.ts","sourceRoot":"","sources":["../../src/rsdkv5.options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rsdkv5.options.d.ts","sourceRoot":"","sources":["../../src/rsdkv5.options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qFAAqF;AACrF,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,WAAW,GACX,IAAI,GACJ,CAAC,MAAM,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;AAEvF,6FAA6F;AAC7F,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,iEAAiE;AACjE,eAAO,MAAM,YAAY;;;;CAAuD,CAAC;AAEjF,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,cAAc,CAsClD,CAAC"}
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
vsync: true,
|
|
6
|
-
language: 0,
|
|
7
|
-
region: -1,
|
|
8
|
-
};
|
|
9
|
-
export const RSDKV5_OPTIONS_SCHEMA = {
|
|
10
|
-
type: 'object',
|
|
11
|
-
additionalProperties: false,
|
|
12
|
-
properties: {
|
|
1
|
+
/** The native picture, which the SDK scales to fit its mount. */
|
|
2
|
+
export const RSDKV5_VIDEO = { width: 424, height: 240, aspect: '16:9' };
|
|
3
|
+
export const RSDKV5_SPEC = {
|
|
4
|
+
config: {
|
|
13
5
|
devMenu: {
|
|
14
|
-
type: 'boolean',
|
|
15
6
|
default: false,
|
|
16
|
-
|
|
7
|
+
live: false,
|
|
8
|
+
description: "Sonic Mania's native dev menu; keep it off and draw your own from play.devMenu.",
|
|
9
|
+
},
|
|
10
|
+
vsync: { default: true, live: false, description: 'VSync in the generated Settings.ini.' },
|
|
11
|
+
language: { default: 0, live: false, description: 'RSDKv5 language index (0 = English).' },
|
|
12
|
+
region: { default: -1, live: false, description: 'RSDKv5 region (-1 = auto).' },
|
|
13
|
+
jsUrl: { live: false, description: 'Emscripten glue URL. Defaults to ./rsdkv5.js.' },
|
|
14
|
+
wasmUrl: { live: false, description: 'WASM URL. Defaults to ./rsdkv5.wasm.' },
|
|
15
|
+
},
|
|
16
|
+
options: {},
|
|
17
|
+
assets: {
|
|
18
|
+
data: {
|
|
19
|
+
allowedTypes: ['.rsdk'],
|
|
20
|
+
live: false,
|
|
21
|
+
description: 'The RSDKv5 game data pack (Sonic Mania). Required to start.',
|
|
22
|
+
},
|
|
23
|
+
settings: {
|
|
24
|
+
allowedTypes: ['.ini'],
|
|
25
|
+
live: false,
|
|
26
|
+
description: 'A ready-made Settings.ini. Omitted, one is generated from config.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
storage: {
|
|
30
|
+
namespace: {
|
|
31
|
+
default: 'default',
|
|
32
|
+
live: false,
|
|
33
|
+
description: "Folder for this game's saves, inside the engine's own rsdkv5/ folder (OPFS rsdkv5/<namespace>/).",
|
|
17
34
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
description:
|
|
35
|
+
persist: {
|
|
36
|
+
enum: ['opfs', null],
|
|
37
|
+
live: false,
|
|
38
|
+
description: "null keeps nothing; otherwise the game's user files are mirrored to OPFS.",
|
|
22
39
|
},
|
|
23
|
-
vsync: { type: 'boolean', default: true },
|
|
24
|
-
language: { type: 'integer', default: 0, minimum: 0 },
|
|
25
|
-
region: { type: 'integer', default: -1 },
|
|
26
40
|
},
|
|
27
41
|
};
|
|
28
42
|
//# sourceMappingURL=rsdkv5.options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsdkv5.options.js","sourceRoot":"","sources":["../../src/rsdkv5.options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rsdkv5.options.js","sourceRoot":"","sources":["../../src/rsdkv5.options.ts"],"names":[],"mappings":"AAqEA,iEAAiE;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAW,CAAC;AAEjF,MAAM,CAAC,MAAM,WAAW,GAA+B;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
|
|
3
|
+
*
|
|
4
|
+
* ```js
|
|
5
|
+
* import Rsdkv5SDK from '@wasm-gaming/rsdkv5-wasm';
|
|
6
|
+
*
|
|
7
|
+
* const play = await new Rsdkv5SDK()
|
|
8
|
+
* .assets({ data: () => readDataRsdk() }) // bytes, or a thunk
|
|
9
|
+
* .storage({ namespace: 'sonic-mania' }) // → OPFS rsdkv5/sonic-mania/
|
|
10
|
+
* .mount(document.querySelector('#stage'))
|
|
11
|
+
* .start();
|
|
12
|
+
*
|
|
13
|
+
* play.pause('menu'); play.resume('menu');
|
|
14
|
+
* play.devMenu.getStageList(); // the host draws its own stage select
|
|
15
|
+
* await play.destroy(); // save flushed, loop stopped, audio closed
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* One game-agnostic `rsdkv5.wasm`: `Data.rsdk` is written into the filesystem at
|
|
19
|
+
* runtime, never baked in. The working dir `/data/rsdkv5/<namespace>` is in memory;
|
|
20
|
+
* Sonic Mania writes its user files there (`SaveData.bin`, `TimeAttackDB.bin`,
|
|
21
|
+
* `ReplayDB.bin`, `Replay_*.bin`). The SDK seeds them from OPFS `rsdkv5/<namespace>/`
|
|
22
|
+
* before boot and mirrors back whatever changed (every 10 s, on pause, on page hide
|
|
23
|
+
* and on destroy).
|
|
24
|
+
*/
|
|
25
|
+
import { EnginePlayBase, EngineSDKBase, EventEmitter, type EngineInit, type EngineSDKConstructor, type EventsOf, type PayloadKind } from '@wasm-gaming/engine-specs';
|
|
26
|
+
import { type Rsdkv5Config, type Rsdkv5Options, type Rsdkv5Payloads } from './rsdkv5.options.js';
|
|
27
|
+
export type { Rsdkv5Asset, Rsdkv5Assets, Rsdkv5Config, Rsdkv5Events, Rsdkv5Options, Rsdkv5Payloads, Rsdkv5Storage, } from './rsdkv5.options.js';
|
|
28
|
+
export { RSDKV5_SPEC, RSDKV5_VIDEO } from './rsdkv5.options.js';
|
|
29
|
+
/** The launcher's handle on RSDKv5's stage list, for drawing its own dev menu. */
|
|
5
30
|
export interface RsdkDevMenuBridge {
|
|
6
31
|
getStageList(): Array<{
|
|
7
32
|
name: string;
|
|
@@ -9,36 +34,116 @@ export interface RsdkDevMenuBridge {
|
|
|
9
34
|
name: string;
|
|
10
35
|
}>;
|
|
11
36
|
}>;
|
|
12
|
-
loadStage(
|
|
13
|
-
setPaused(paused: boolean): void;
|
|
37
|
+
loadStage(category: number, stage: number): void;
|
|
14
38
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
39
|
+
/** Mania's characters, by the `characterID` its save slots store. */
|
|
40
|
+
export declare const MANIA_CHARACTERS: readonly ["Sonic & Tails", "Sonic", "Tails", "Knuckles", "Mighty", "Ray"];
|
|
41
|
+
/** Mania Mode's zones, by the `zoneID` its save slots store. */
|
|
42
|
+
export declare const MANIA_ZONES: readonly ["Green Hill", "Chemical Plant", "Studiopolis", "Flying Battery", "Press Garden", "Stardust Speedway", "Hydrocity", "Mirage Saloon", "Oil Ocean", "Lava Reef", "Metallic Madness", "Titanic Monarch", "Egg Reverie"];
|
|
43
|
+
/** One Mania Mode save slot, as `SaveData.bin` has it. */
|
|
44
|
+
export interface ManiaSaveSlot {
|
|
45
|
+
/** 0-7, the slot Mania numbers 1-8. */
|
|
46
|
+
slot: number;
|
|
47
|
+
state: 'empty' | 'progress' | 'complete';
|
|
48
|
+
/** Index into {@link MANIA_CHARACTERS}. */
|
|
49
|
+
character: number;
|
|
50
|
+
/** Index into {@link MANIA_ZONES}; meaningful while in progress. */
|
|
51
|
+
zone: number;
|
|
52
|
+
zoneName: string;
|
|
53
|
+
lives: number;
|
|
54
|
+
score: number;
|
|
55
|
+
/** How many of the seven Chaos Emeralds (the save keeps a bit mask). */
|
|
56
|
+
emeralds: number;
|
|
57
|
+
continues: number;
|
|
58
|
+
}
|
|
59
|
+
/** Mania Plus's eight regular save slots in `SaveData.bin` (Encore slots are elsewhere). */
|
|
60
|
+
export declare const MANIA_SAVE_SLOTS = 8;
|
|
27
61
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
62
|
+
* Mania Mode's save slots from `SaveData.bin` (`globals->saveRAM`, int32 LE): slot `s`
|
|
63
|
+
* is the 0x400-byte block at `0x400 * s`, fields from +0x58. A missing or short file
|
|
64
|
+
* reads as empty slots.
|
|
30
65
|
*/
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
export declare function parseManiaSaves(bytes: Uint8Array | null): ManiaSaveSlot[];
|
|
67
|
+
/** Mania Mode's save slots, read and started the way Mania's own save select does. */
|
|
68
|
+
export interface ManiaSaves {
|
|
69
|
+
/** True when this build has the bridge (older wasm builds don't). */
|
|
70
|
+
readonly available: boolean;
|
|
71
|
+
/** How many characters a new game can pick: 6 with Plus (Mighty, Ray), else 4. */
|
|
72
|
+
readonly characters: number;
|
|
73
|
+
/** The eight slots, from the save file as it is now. */
|
|
74
|
+
list(): ManiaSaveSlot[];
|
|
75
|
+
/**
|
|
76
|
+
* Resolves true once Mania has its save file loaded (it asks Mania to load it), false
|
|
77
|
+
* if that failed or took longer than `timeoutMs`.
|
|
78
|
+
*/
|
|
79
|
+
ready(timeoutMs?: number): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Start a slot: an empty one is a new game with `character` (an index into
|
|
82
|
+
* {@link MANIA_CHARACTERS}), a saved one continues with its own. Mania writes the
|
|
83
|
+
* save and loads the stage; the pause is lifted. False when the save isn't ready.
|
|
84
|
+
*/
|
|
85
|
+
start(slot: number, character?: number): boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Where an engine keeps one namespace: `<engineId>/<namespace>`, relative to the OPFS
|
|
89
|
+
* root. Identical in every wasm-gaming engine, written to move verbatim into
|
|
90
|
+
* engine-specs: segments cleaned, `.` and `..` dropped, anything outside
|
|
91
|
+
* `[A-Za-z0-9._-]` → `_`, nothing usable → `default`; a leading `<engineId>/` is
|
|
92
|
+
* stripped once.
|
|
93
|
+
*/
|
|
94
|
+
export declare function storagePath(engineId: string, namespace: unknown): {
|
|
95
|
+
namespace: string;
|
|
96
|
+
path: string;
|
|
97
|
+
prefixed: boolean;
|
|
42
98
|
};
|
|
43
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Serialise the engine config into RSDKv5U's `Settings.ini` (capital S — the engine
|
|
101
|
+
* opens exactly that name, and the Emscripten FS is case-sensitive). The v5 dialect:
|
|
102
|
+
* lowercase keys, 0/1 booleans, `dataFile=` naming the pack relative to the working dir.
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildSettingsIni(config: Rsdkv5Config): string;
|
|
105
|
+
/** The live engine: one booted RSDKv5 and its session. */
|
|
106
|
+
export declare class Rsdkv5Play extends EnginePlayBase<Rsdkv5Payloads> {
|
|
107
|
+
#private;
|
|
108
|
+
constructor(init?: EngineInit<Rsdkv5Payloads>, events?: EventEmitter<EventsOf<Rsdkv5Payloads>>);
|
|
109
|
+
get namespace(): string;
|
|
110
|
+
/** Where this session's files live, relative to the OPFS root: `rsdkv5/<namespace>`. */
|
|
111
|
+
get storagePath(): string;
|
|
112
|
+
get pausedBy(): string | null;
|
|
113
|
+
/** Mania Mode's save slots — see {@link ManiaSaves}. */
|
|
114
|
+
get saves(): ManiaSaves;
|
|
115
|
+
/** RSDKv5's stage list, for a host that draws its own stage select. */
|
|
116
|
+
get devMenu(): RsdkDevMenuBridge;
|
|
117
|
+
/**
|
|
118
|
+
* Freeze the game and its sound. The first caller owns the pause; only that
|
|
119
|
+
* owner's {@link resume} lifts it. The save is flushed.
|
|
120
|
+
*/
|
|
121
|
+
pause(owner?: string): void;
|
|
122
|
+
resume(owner?: string): void;
|
|
123
|
+
/**
|
|
124
|
+
* Silence the game without stopping it (the frames keep running). A host uses it to
|
|
125
|
+
* let Mania get somewhere — load its save file — behind its own screen. Independent
|
|
126
|
+
* of {@link pause}: a paused game stays silent either way.
|
|
127
|
+
*/
|
|
128
|
+
mute(muted?: boolean): void;
|
|
129
|
+
get muted(): boolean;
|
|
130
|
+
/** Copy the game's changed user files to OPFS `rsdkv5/<namespace>/`; emits `saves`. */
|
|
131
|
+
flushSaves(): Promise<void>;
|
|
132
|
+
protected mounted(target: HTMLElement): void;
|
|
133
|
+
protected open(_options: Rsdkv5Options): Promise<void>;
|
|
134
|
+
protected patched(_kind: PayloadKind, _patch: object): void;
|
|
135
|
+
protected close(): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
/** The factory a host constructs: static identity, the configuration chain, `start()`. */
|
|
138
|
+
export declare class Rsdkv5SDK extends EngineSDKBase<Rsdkv5Payloads> {
|
|
139
|
+
static readonly id = "rsdkv5";
|
|
140
|
+
/** Kept in step with package.json by `node scripts/sync-version.mjs`. */
|
|
141
|
+
static readonly version = "0.2.0";
|
|
142
|
+
static readonly name = "Retro Software Development Kit v3";
|
|
143
|
+
static readonly description = "RSDKv5U (Sonic Mania decompilation) compiled to WebAssembly. Ships none of the game: the player provides Data.rsdk, and it never leaves their browser.";
|
|
144
|
+
protected createPlay(init: EngineInit<Rsdkv5Payloads>, events: EventEmitter<EventsOf<Rsdkv5Payloads>>): Rsdkv5Play;
|
|
145
|
+
}
|
|
146
|
+
/** CI's conformance line: if this class stops satisfying the contract, `make test` fails. */
|
|
147
|
+
export declare const RSDKV5_ENGINE: EngineSDKConstructor<Rsdkv5Payloads>;
|
|
148
|
+
export default Rsdkv5SDK;
|
|
44
149
|
//# sourceMappingURL=rsdkv5.sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsdkv5.sdk.d.ts","sourceRoot":"","sources":["../../src/rsdkv5.sdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rsdkv5.sdk.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