mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-30 22:24:58 -06:00
- Implement navigation state tracking with optimistic UI updates - Add loading spinner and error handling for WASM initialization - Insert browser yield points during game initialization to prevent freezing - Redesign leaderboard with tabbed navigation and mock data structure - Add utility CSS classes for consistent page layouts
26 lines
708 B
TypeScript
26 lines
708 B
TypeScript
export interface PacmanModule {
|
|
canvas: HTMLCanvasElement;
|
|
_start_game?: () => void;
|
|
_stop_game?: () => void;
|
|
_restart_game?: () => void;
|
|
locateFile: (path: string) => string;
|
|
preRun: unknown[];
|
|
// Emscripten error hooks
|
|
onAbort?: (what: unknown) => void;
|
|
onRuntimeInitialized?: () => void;
|
|
}
|
|
|
|
export type LoadingError =
|
|
| { type: "timeout" }
|
|
| { type: "script"; message: string }
|
|
| { type: "runtime"; message: string };
|
|
|
|
export interface PacmanWindow extends Window {
|
|
Module?: PacmanModule;
|
|
pacmanReady?: () => void;
|
|
pacmanError?: (error: LoadingError) => void;
|
|
SDL_CANVAS_ID?: string;
|
|
}
|
|
|
|
export const getPacmanWindow = (): PacmanWindow => window as unknown as PacmanWindow;
|