@gba-kit/gba-react 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bruno Macabeus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @gba-kit/gba-react
2
+
3
+ Headless React hooks for GBA emulation. Wraps [`@gba-kit/gba-browser`](../gba-browser) with proper React lifecycle management.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @gba-kit/gba-react
9
+ ```
10
+
11
+ ## Hooks
12
+
13
+ ### `useEmulator(options?)`
14
+
15
+ Creates and owns an `EmulatorBridge` instance. The instance is stable across re-renders and cleaned up on unmount.
16
+
17
+ Returns `{ emulator, state }` where `state` is reactive (`'idle' | 'paused' | 'running'`).
18
+
19
+ ```tsx
20
+ import { useEmulator } from '@gba-kit/gba-react';
21
+
22
+ function App() {
23
+ const { emulator, state } = useEmulator({
24
+ onFrame: () => {
25
+ /* called after each emulated frame */
26
+ },
27
+ onBreakpoint: (addr) => console.log('breakpoint hit at', addr),
28
+ });
29
+
30
+ return (
31
+ <div>
32
+ <p>State: {state}</p>
33
+ <button onClick={() => emulator.run()}>Run</button>
34
+ <button onClick={() => emulator.pause()}>Pause</button>
35
+ </div>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ### `useEmulatorCanvas(emulator)`
41
+
42
+ Binds a `<canvas>` element to the emulator's display output. Returns a ref to attach to your own canvas. The hook handles `attachCanvas` on mount and `detachCanvas` on unmount.
43
+
44
+ The canvas dimensions are set to 240x160 (native GBA resolution) by the emulator. Control display size with CSS.
45
+
46
+ ```tsx
47
+ import { useEmulatorCanvas } from '@gba-kit/gba-react';
48
+
49
+ function Screen({ emulator }) {
50
+ const canvasRef = useEmulatorCanvas(emulator);
51
+ return <canvas ref={canvasRef} style={{ width: 720, height: 480, imageRendering: 'pixelated' }} />;
52
+ }
53
+ ```
54
+
55
+ ### `useEmulatorKeyboard(emulator)`
56
+
57
+ Registers global `keydown`/`keyup` listeners that forward to the emulator's built-in key map. It's pure side-effect and returns nothing.
58
+
59
+ Default key map: Arrow keys = D-pad, Z = A, X = B, Enter = Start, Backspace = Select, A/S = L/R.
60
+
61
+ Omit this hook if you handle input differently (e.g. on-screen touch controls).
62
+
63
+ ```tsx
64
+ import { useEmulatorKeyboard } from '@gba-kit/gba-react';
65
+
66
+ function Game({ emulator }) {
67
+ useEmulatorKeyboard(emulator);
68
+ // ...
69
+ }
70
+ ```
71
+
72
+ ## Full Example
73
+
74
+ ```tsx
75
+ import { useEmulator, useEmulatorCanvas, useEmulatorKeyboard } from '@gba-kit/gba-react';
76
+
77
+ function GbaPlayer({ romUrl }: { romUrl: string }) {
78
+ const { emulator, state } = useEmulator();
79
+ const canvasRef = useEmulatorCanvas(emulator);
80
+ useEmulatorKeyboard(emulator);
81
+
82
+ const loadAndRun = async () => {
83
+ const res = await fetch(romUrl);
84
+ const data = await res.arrayBuffer();
85
+ emulator.loadRom(data);
86
+ emulator.run();
87
+ };
88
+
89
+ return (
90
+ <div>
91
+ {state === 'idle' ? (
92
+ <button onClick={loadAndRun}>Load ROM</button>
93
+ ) : (
94
+ <canvas ref={canvasRef} style={{ width: 480, height: 320 }} />
95
+ )}
96
+ </div>
97
+ );
98
+ }
99
+ ```
100
+
101
+ ## Exports
102
+
103
+ | Export | Description |
104
+ | --------------------- | ------------------------------------------------------ |
105
+ | `useEmulator` | Create and own an `EmulatorBridge` with reactive state |
106
+ | `useEmulatorCanvas` | Bind a canvas ref to the emulator display |
107
+ | `useEmulatorKeyboard` | Register global keyboard input listeners |
108
+
109
+ Type: `UseEmulatorOptions`
110
+
111
+ ## See Also
112
+
113
+ - [`@gba-kit/gba-browser`](../gba-browser) — The underlying browser runtime (framework-agnostic)
114
+ - [`@gba-kit/gba-node`](../gba-node) — Headless Node.js runtime for scripted emulation
@@ -0,0 +1,5 @@
1
+ export { useEmulator } from './use-emulator.js';
2
+ export type { UseEmulatorOptions } from './use-emulator.js';
3
+ export { useEmulatorCanvas } from './use-emulator-canvas.js';
4
+ export { useEmulatorKeyboard } from './use-emulator-keyboard.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { useEmulator } from './use-emulator.js';
2
+ export { useEmulatorCanvas } from './use-emulator-canvas.js';
3
+ export { useEmulatorKeyboard } from './use-emulator-keyboard.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { EmulatorBridge } from '@gba-kit/gba-browser';
2
+ import { type RefObject } from 'react';
3
+ /**
4
+ * Binds a `<canvas>` element to the emulator's display output.
5
+ *
6
+ * Returns a ref that the consumer attaches to their own `<canvas>`.
7
+ * The hook calls {@link EmulatorBridge.attachCanvas} when the canvas mounts
8
+ * and {@link EmulatorBridge.detachCanvas} when it unmounts, so the
9
+ * emulator's framebuffer is always blitted to the visible canvas.
10
+ *
11
+ * The canvas dimensions are set to 240x160 (native GBA resolution) by the
12
+ * bridge. The consumer controls the display size via CSS.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * function Screen({ emulator }: { emulator: EmulatorBridge }) {
17
+ * const canvasRef = useEmulatorCanvas(emulator);
18
+ * return <canvas ref={canvasRef} style={{ width: 720, height: 480 }} />;
19
+ * }
20
+ * ```
21
+ */
22
+ export declare function useEmulatorCanvas(emulator: EmulatorBridge): RefObject<HTMLCanvasElement | null>;
23
+ //# sourceMappingURL=use-emulator-canvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator-canvas.d.ts","sourceRoot":"","sources":["../src/use-emulator-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAgB/F"}
@@ -0,0 +1,35 @@
1
+ import { useEffect, useRef } from 'react';
2
+ /**
3
+ * Binds a `<canvas>` element to the emulator's display output.
4
+ *
5
+ * Returns a ref that the consumer attaches to their own `<canvas>`.
6
+ * The hook calls {@link EmulatorBridge.attachCanvas} when the canvas mounts
7
+ * and {@link EmulatorBridge.detachCanvas} when it unmounts, so the
8
+ * emulator's framebuffer is always blitted to the visible canvas.
9
+ *
10
+ * The canvas dimensions are set to 240x160 (native GBA resolution) by the
11
+ * bridge. The consumer controls the display size via CSS.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * function Screen({ emulator }: { emulator: EmulatorBridge }) {
16
+ * const canvasRef = useEmulatorCanvas(emulator);
17
+ * return <canvas ref={canvasRef} style={{ width: 720, height: 480 }} />;
18
+ * }
19
+ * ```
20
+ */
21
+ export function useEmulatorCanvas(emulator) {
22
+ const canvasRef = useRef(null);
23
+ useEffect(() => {
24
+ const canvas = canvasRef.current;
25
+ if (!canvas) {
26
+ return;
27
+ }
28
+ emulator.attachCanvas(canvas);
29
+ return () => {
30
+ emulator.detachCanvas();
31
+ };
32
+ }, [emulator]);
33
+ return canvasRef;
34
+ }
35
+ //# sourceMappingURL=use-emulator-canvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator-canvas.js","sourceRoot":"","sources":["../src/use-emulator-canvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAwB;IACxD,MAAM,SAAS,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;QACT,CAAC;QAED,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { EmulatorBridge } from '@gba-kit/gba-browser';
2
+ /**
3
+ * Registers global keyboard listeners that forward key events to the emulator.
4
+ *
5
+ * Uses the bridge's built-in key map (arrow keys for D-pad, Z/X for A/B,
6
+ * Enter for Start, Backspace for Select, A/S for L/R).
7
+ *
8
+ * Listeners are added on mount and removed on unmount. The hook is a pure
9
+ * side-effect — it returns nothing. Consumers that handle input differently
10
+ * (e.g. on-screen touch controls) simply omit this hook.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function Game({ emulator }: { emulator: EmulatorBridge }) {
15
+ * useEmulatorKeyboard(emulator);
16
+ * const canvasRef = useEmulatorCanvas(emulator);
17
+ * return <canvas ref={canvasRef} />;
18
+ * }
19
+ * ```
20
+ */
21
+ export declare function useEmulatorKeyboard(emulator: EmulatorBridge): void;
22
+ //# sourceMappingURL=use-emulator-keyboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator-keyboard.d.ts","sourceRoot":"","sources":["../src/use-emulator-keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAalE"}
@@ -0,0 +1,33 @@
1
+ import { useEffect } from 'react';
2
+ /**
3
+ * Registers global keyboard listeners that forward key events to the emulator.
4
+ *
5
+ * Uses the bridge's built-in key map (arrow keys for D-pad, Z/X for A/B,
6
+ * Enter for Start, Backspace for Select, A/S for L/R).
7
+ *
8
+ * Listeners are added on mount and removed on unmount. The hook is a pure
9
+ * side-effect — it returns nothing. Consumers that handle input differently
10
+ * (e.g. on-screen touch controls) simply omit this hook.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function Game({ emulator }: { emulator: EmulatorBridge }) {
15
+ * useEmulatorKeyboard(emulator);
16
+ * const canvasRef = useEmulatorCanvas(emulator);
17
+ * return <canvas ref={canvasRef} />;
18
+ * }
19
+ * ```
20
+ */
21
+ export function useEmulatorKeyboard(emulator) {
22
+ useEffect(() => {
23
+ const handleKeyDown = (e) => emulator.handleKeyDown(e);
24
+ const handleKeyUp = (e) => emulator.handleKeyUp(e);
25
+ window.addEventListener('keydown', handleKeyDown);
26
+ window.addEventListener('keyup', handleKeyUp);
27
+ return () => {
28
+ window.removeEventListener('keydown', handleKeyDown);
29
+ window.removeEventListener('keyup', handleKeyUp);
30
+ };
31
+ }, [emulator]);
32
+ }
33
+ //# sourceMappingURL=use-emulator-keyboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator-keyboard.js","sourceRoot":"","sources":["../src/use-emulator-keyboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,CAAC,CAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAElE,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAClD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAE9C,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;YACrD,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACnD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { EmulatorBridge, type EmulatorState } from '@gba-kit/gba-browser';
2
+ /**
3
+ * Options for {@link useEmulator}.
4
+ *
5
+ * All callbacks are optional. They are registered once when the hook mounts
6
+ * and updated on every render via a stable ref, so the consumer does not need
7
+ * to memoize them.
8
+ */
9
+ export interface UseEmulatorOptions {
10
+ /**
11
+ * Called after each emulated frame (during `run()`, `stepInstruction()`,
12
+ * `stepOver()`, etc.). Useful for triggering re-renders in debug views
13
+ * that display registers, memory, or disassembly.
14
+ *
15
+ * **Caution:** During normal play this fires ~60 times per second.
16
+ * Avoid expensive work here unless the emulator is paused/stepping.
17
+ */
18
+ onFrame?: () => void;
19
+ /** Called when the emulator hits an enabled breakpoint. */
20
+ onBreakpoint?: (address: number) => void;
21
+ }
22
+ /**
23
+ * Core hook that creates and owns a GBA {@link EmulatorBridge} instance.
24
+ *
25
+ * The bridge is created once and is stable for the lifetime of the component.
26
+ * The returned `state` is reactive — it triggers a re-render when the
27
+ * emulator transitions between `'idle'`, `'paused'`, and `'running'`.
28
+ *
29
+ * Cleans up the emulation loop on unmount.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * function App() {
34
+ * const { emulator, state } = useEmulator({
35
+ * onBreakpoint: (addr) => console.log('hit', addr),
36
+ * });
37
+ *
38
+ * return (
39
+ * <button onClick={() => emulator.run()}>
40
+ * {state === 'running' ? 'Pause' : 'Run'}
41
+ * </button>
42
+ * );
43
+ * }
44
+ * ```
45
+ */
46
+ export declare function useEmulator(options?: UseEmulatorOptions): {
47
+ /** The stable emulator bridge instance. Safe to pass as a prop. */
48
+ emulator: EmulatorBridge;
49
+ /** Reactive emulator state — re-renders the component on transitions. */
50
+ state: EmulatorState;
51
+ };
52
+ //# sourceMappingURL=use-emulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator.d.ts","sourceRoot":"","sources":["../src/use-emulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG;IACzD,mEAAmE;IACnE,QAAQ,EAAE,cAAc,CAAC;IACzB,yEAAyE;IACzE,KAAK,EAAE,aAAa,CAAC;CACtB,CA6BA"}
@@ -0,0 +1,52 @@
1
+ import { EmulatorBridge } from '@gba-kit/gba-browser';
2
+ import { useEffect, useRef, useState } from 'react';
3
+ /**
4
+ * Core hook that creates and owns a GBA {@link EmulatorBridge} instance.
5
+ *
6
+ * The bridge is created once and is stable for the lifetime of the component.
7
+ * The returned `state` is reactive — it triggers a re-render when the
8
+ * emulator transitions between `'idle'`, `'paused'`, and `'running'`.
9
+ *
10
+ * Cleans up the emulation loop on unmount.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function App() {
15
+ * const { emulator, state } = useEmulator({
16
+ * onBreakpoint: (addr) => console.log('hit', addr),
17
+ * });
18
+ *
19
+ * return (
20
+ * <button onClick={() => emulator.run()}>
21
+ * {state === 'running' ? 'Pause' : 'Run'}
22
+ * </button>
23
+ * );
24
+ * }
25
+ * ```
26
+ */
27
+ export function useEmulator(options) {
28
+ // Keep options in a ref so the callback closure always sees the latest
29
+ // without needing the consumer to memoize.
30
+ const optionsRef = useRef(options);
31
+ optionsRef.current = options;
32
+ const [state, setState] = useState('idle');
33
+ // Create the bridge exactly once (stable across renders).
34
+ const emulatorRef = useRef(null);
35
+ if (emulatorRef.current === null) {
36
+ emulatorRef.current = new EmulatorBridge();
37
+ }
38
+ const emulator = emulatorRef.current;
39
+ // Wire callbacks on mount; update the ref-based forwarding on every render.
40
+ useEffect(() => {
41
+ emulator.setCallbacks({
42
+ onStateChange: (s) => setState(s),
43
+ onFrame: () => optionsRef.current?.onFrame?.(),
44
+ onBreakpoint: (addr) => optionsRef.current?.onBreakpoint?.(addr),
45
+ });
46
+ return () => {
47
+ emulator.stop();
48
+ };
49
+ }, [emulator]);
50
+ return { emulator, state };
51
+ }
52
+ //# sourceMappingURL=use-emulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-emulator.js","sourceRoot":"","sources":["../src/use-emulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAsB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAuBpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IAMtD,uEAAuE;IACvE,2CAA2C;IAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAE7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,MAAM,CAAC,CAAC;IAE1D,0DAA0D;IAC1D,MAAM,WAAW,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACxD,IAAI,WAAW,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,WAAW,CAAC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;IAC7C,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;IAErC,4EAA4E;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,YAAY,CAAC;YACpB,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC;SACjE,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@gba-kit/gba-react",
3
+ "version": "0.1.0",
4
+ "description": "React hooks for GBA emulation",
5
+ "author": "macabeus",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/macabeus/gba-kit",
19
+ "directory": "packages/gba-react"
20
+ },
21
+ "homepage": "https://github.com/macabeus/gba-kit",
22
+ "bugs": "https://github.com/macabeus/gba-kit/issues",
23
+ "keywords": [
24
+ "gba",
25
+ "gameboy-advance",
26
+ "emulator",
27
+ "react",
28
+ "hooks",
29
+ "typescript"
30
+ ],
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "dependencies": {
35
+ "@gba-kit/gba-browser": "0.1.0"
36
+ },
37
+ "devDependencies": {
38
+ "@types/react": "^19.2.14",
39
+ "typescript": "^6.0.2"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^18.0.0 || ^19.0.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "check-types": "tsc --noEmit",
47
+ "lint": "eslint src/"
48
+ }
49
+ }