import { Checkpoint } from "../../runtime/state/checkpointStore.js"; import { type DebuggerIO } from "../types.js"; import type { Channel } from "./channel.js"; import { type Hello } from "./protocol.js"; export type ServeEvents = { hello?: (hello: Hello) => void; /** The program ended, with `value`, or by throwing `error`. */ finished?: (value: unknown, error?: string) => void; refused?: (reason: string) => void; /** A message that is not one of ours; the sender is a bug. */ malformed?: (message: unknown) => void; }; /** A checkpoint as the run sent it, rebuilt. A frame holds a function * value whenever the program passed a block or kept a function in a * variable, and reviving one needs a registry, which only a compiled * module sets as it loads. The debugger's process loads no program, so * an empty registry is set here: every function then revives to the * stub a miss gives, which is all a UI that shows the state needs. */ export declare function checkpointFromWire(wire: unknown): Checkpoint | undefined; /** Answer the run's requests with `io` until the channel closes. Returns * the function that stops listening. */ export declare function serveDebuggerIO(channel: Channel, io: DebuggerIO, events?: ServeEvents): () => void;