/** * Guards a spawned child process and its stdio streams against unhandled * 'error' events. Attaches a single 'error' listener to the process and to * each present stdio stream (stdin/stdout/stderr), forwarding every emitted * error to the supplied callback along with the stream that produced it. * * The helper does not terminate the process; routing the error to the * caller's existing failure path is the callback's responsibility. * * Returns a teardown function that removes every listener it registered. The * teardown function is idempotent and safe to call multiple times. */ import type { ChildProcess } from 'node:child_process'; export type ChildProcessStreamSource = 'process' | 'stdin' | 'stdout' | 'stderr'; type ChildProcessStreamErrorHandler = (error: Error, source: ChildProcessStreamSource) => void; export declare function guardChildProcessStreams(child: ChildProcess, onError: ChildProcessStreamErrorHandler): () => void; export {}; //# sourceMappingURL=child-process-guard.d.ts.map