export type Channel = { send(message: unknown): void; /** Hand every message to `listener` until the returned function is * called. */ onMessage(listener: (message: unknown) => void): () => void; /** Run `listener` once, when the channel closes for any reason. */ onClose(listener: () => void): () => void; close(): void; /** Whether this channel keeps the process alive. The run side holds * the channel while a program is stopped waiting for the debugger's * answer, and nothing else may be keeping the process up; the rest of * the time an open session must not keep a finished program alive. A * channel with no process to keep alive ignores it. */ keepAlive(on: boolean): void; }; /** Two channels wired to each other: what one sends, the other receives * on a microtask, so a listener registered right after `send` still sees * the message, and as JSON, the way a socket delivers it, so a message a * socket would mangle (a key whose value is undefined, a Date) is * mangled here too. Closing either closes both, and a message sent just * before the close is still delivered after the close listeners ran, * where a socket delivers it first. */ export declare function memoryChannelPair(): [Channel, Channel];