TypeScript type definitions are incorrect
Author: bfirshCreated Feb 28, 2026Updated Feb 28, 2026
Labelsbugpriority: mediumdifficulty: easycomponent: browser
Summary
Several issues in src/nes.d.ts:
onFramecallback typesBuffer(line 11) but the actual frame buffer is aUint32Array(or a plainnumber[]). UsingBuffer(a Node.js type) is wrong for both browser and Node environments.EmulatorDatatypes all properties asstring(lines 3-8) but they're objects returned bytoJSON()on CPU, PPU, PAPU, and mapper.Declares
stop()method (line 21) that doesn't exist on the NES class.Missing
GameGenietype declarations — no.d.tsfile forgamegenie.js.
Fix
export interface EmulatorData {
cpu: object;
mmap: object;
ppu: object;
papu: object;
}
export interface NESOptions {
onFrame?: (buffer: Uint32Array) => void;
// ...
}
export class NES {
// Remove stop(), it doesn't exist
// Add gameGenie property
gameGenie: GameGenie;
// ...
}Source: bfirsh/jsnes