import type { SceneHandle } from './scene'; export type ScriptResult = { commandCount: number; logs: string[]; /** Value the script returned via `return …`. `undefined` means no return. */ returnValue?: unknown; /** JSON-stringified form of `returnValue`, or an error marker if not serialisable. */ returnJson?: string; error?: { message: string; name: string; }; }; /** * Run a user script against the current map. Each helper mutates the map * eagerly (so subsequent reads see updated state) and records a Command. On * success, all commands are pushed as a single batch to the undo stack. On * error, every applied command is reverted. */ export declare function runScript(code: string, scene: SceneHandle): ScriptResult;