import type { RunResult } from "../run.js";
type SignalName = "SIGUSR1";
type SignalProcess = Pick<NodeJS.Process, "off" | "on">;
type CliStream = {
    write(chunk: string): void;
};
type WriteDumpFile = (filepath: string, content: string, options: {
    encoding: "utf8";
    flag: "wx";
}) => Promise<void>;
export declare function attachSignalDumpHandler(result: PromiseLike<RunResult>, options?: {
    dumpPath?: string;
    dumpResult?: (result: PromiseLike<RunResult>) => Promise<string>;
    onError?: (error: unknown, signal: SignalName) => Promise<void> | void;
    onSnapshot?: (snapshot: string, signal: SignalName) => Promise<void> | void;
    process?: SignalProcess;
    stderr?: CliStream;
    writeFile?: WriteDumpFile;
}): () => void;
export {};
