forked from city41/smaghetti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
36 lines (32 loc) · 1000 Bytes
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
type GBAStatus = 'reset' | 'ready-to-inject' | 'level-ready' | 'crashed';
interface _GameBoyAdvance {
new (): _GameBoyAdvance;
setCanvas: (canvas: HTMLCanvasElement) => void;
setBios: (bios: ArrayBuffer) => void;
setRom: (rom: ArrayBuffer) => void;
runStable: () => void;
pause: () => void;
reset: () => void;
setSavedata: (data: ArrayBuffer) => void;
downloadSavedata: () => void;
audio: {
masterVolume: number;
context: AudioContext;
};
rom: ArrayBuffer | undefined;
statusCallback: ((status: GBAStatus) => void) | undefined;
injectSaveFile: (buffer: ArrayBuffer) => void;
_shouldMute?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
freeze: () => any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
defrost: (saveState: any) => void;
video: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
freeze: () => any;
};
}
interface Window {
GameBoyAdvance: _GameBoyAdvance;
_gba: InstanceType<_GameBoyAdvance>;
}