import { type ChildProcess, type ChildProcessByStdio, type SpawnOptions, type SpawnOptionsWithStdioTuple, type SpawnSyncOptionsWithStringEncoding, type SpawnSyncReturns, type StdioNull, type StdioPipe } from "node:child_process"; import type { Readable } from "node:stream"; export interface WaitForChildProcessResult { /** Process exit code, or null if the process did not exit cleanly. */ code: number | null; /** True when the hard deadline fired and we force-killed the process tree. */ forcedKill: boolean; } export declare function spawnProcess(command: string, args: string[], options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; export declare function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess; export declare function spawnProcessSync(command: string, args: string[], options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; /** * Wait for a child process to terminate without hanging on inherited stdio handles. * * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe * handles. In that case the child emits `exit`, but `close` can hang forever even * though the original process is already gone. We wait briefly for stdio to end, * then forcibly stop tracking the inherited handles. * * As an escape hatch, a hard deadline (default 30 minutes, env-overridable via * SPECTRAL_BASH_HARD_DEADLINE_MS) force-kills the process tree and resolves the * promise so callers can never hang indefinitely on a pipe held open by a * detached descendant. */ export declare function waitForChildProcess(child: ChildProcess, hardDeadlineMs?: number): Promise; //# sourceMappingURL=child-process.d.ts.map