import { P as Scene, b as Engine, n as BehaviorCtor } from "./behavior-B_245qRy.js"; import { c as JsonValue } from "./rng-BsXZg3D6.js"; import { CSSProperties, ReactNode } from "react"; //#region src/react/index.d.ts /** The common surface of Game2D/Game3D the React layer relies on. */ interface GameHandle { engine: Engine; scene: Scene; renderer: { dispose(): void; /** Both renderers provide it (3D takes a z too) — world → canvas px. */ screenFromWorld?(wx: number, wy: number, wz?: number): { x: number; y: number; }; }; dispose(): void; } /** The running game (null while booting). Must be used under . */ declare function useGame(): GameHandle | null; /** The running engine (null while booting). */ declare function useEngine(): Engine | null; /** * Subscribe to a node prop by path — re-renders ONLY when the value changes * (compared per frame via engine.updated). The React-HUD bread and butter: * `const text = useNodeProp('UI/Score', 'text')`. */ declare function useNodeProp(path: string, prop: string): T | undefined; /** * Subscribe to a node signal — auto-disconnects on unmount and re-wires on * scene swaps. The handler may change between renders without re-wiring. */ declare function useSignal(path: string, signal: string, handler: (...args: unknown[]) => void): void; interface IncantoCanvasProps { /** Scene JSON (cloned internally). Pass a stable reference — a new object re-boots. */ scene: unknown; /** '2d' | '3d' (default: the scene's dimension, falling back to '2d'). */ render?: "2d" | "3d"; behaviors?: Record; physics?: "auto" | boolean; touch?: "auto" | boolean; debug?: boolean; seed?: number; fixedHz?: number; pixelRatio?: number; antialias?: boolean; /** 3D: pointer-look on the canvas. */ pointer?: boolean | { lockOnClick?: boolean; }; /** 'window' (default) | 'canvas' (tabIndex + focus scoped) | false. */ keyboard?: "window" | "canvas" | false; className?: string; style?: CSSProperties; /** Shown in the overlay until the game is ready. */ fallback?: ReactNode; onReady?: (game: GameHandle) => void; /** DOM HUD overlay — absolutely positioned over the canvas, game context inside. */ children?: ReactNode; /** @internal Test seam — replaces the createGame call. */ _gameFactory?: (opts: Record) => Promise; } declare function IncantoCanvas(props: IncantoCanvasProps): ReactNode; //#endregion export { GameHandle, IncantoCanvas, IncantoCanvasProps, useEngine, useGame, useNodeProp, useSignal };