import type { EngineCore } from "./engine-core"; import { type EngineCommand, type EngineEvent } from "./worker-protocol"; /** * Command router for the engine worker, split out from the worker entry so it * can be exercised directly: the entry runs `self`-scoped side effects at module * load and so cannot be imported outside a worker realm, but this function takes * its collaborators as arguments, so a test can host a real EngineCore behind a * fake port. * * Each posted EngineCommand maps to one EngineCore method. Fire-and-forget * commands post nothing; awaitable ones post exactly one terminal ResponseEvent * carrying their requestId (the builder's success event, or an error event if * the engine throws). MirrorEvents leave separately through EngineCore's emit. */ export type PostEngineEvent = (event: EngineEvent) => void; export declare function handleEngineCommand(engine: EngineCore, command: EngineCommand, post: PostEngineEvent): Promise;