This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
global.d.ts
63 lines (57 loc) · 1.58 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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;
pause: (paused: boolean) => void;
};
rom: ArrayBuffer | undefined;
statusCallback: ((status: GBAStatus) => void) | undefined;
injectSaveFile: (
buffer: ArrayBuffer | null,
playAs: 'mario' | 'luigi',
script?: any
) => 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>;
GBA_KEYCODE_LEFT: number;
GBA_KEYCODE_RIGHT: number;
GBA_KEYCODE_UP: number;
GBA_KEYCODE_DOWN: number;
GBA_KEYCODE_A: number;
GBA_KEYCODE_B: number;
GBA_KEYCODE_START: number;
GBA_KEYCODE_SELECT: number;
GBA_KEYCODE_L: number;
GBA_KEYCODE_R: number;
GBA_GAMEPAD_LEFT: number;
GBA_GAMEPAD_RIGHT: number;
GBA_GAMEPAD_UP: number;
GBA_GAMEPAD_DOWN: number;
GBA_GAMEPAD_A: number;
GBA_GAMEPAD_B: number;
GBA_GAMEPAD_START: number;
GBA_GAMEPAD_SELECT: number;
GBA_GAMEPAD_L: number;
GBA_GAMEPAD_R: number;
}