import { type ChildProcess, type ForkOptions, type SpawnOptions } from 'node:child_process'; export interface SupervisedChildExit { code: number | null; signal: NodeJS.Signals | null; } export type SupervisedChildLaunch = { kind: 'spawn'; command: string; args?: readonly string[]; options?: Omit; } | { kind: 'fork'; modulePath: string; args?: readonly string[]; options?: Omit; }; export interface SupervisedChildOptions { stopTimeoutMs?: number; pollIntervalMs?: number; } type ExitHandler = (exit: SupervisedChildExit) => void; type ErrorHandler = (error: Error) => void; /** * Neutral owner for one detached child process group. Domain wrappers keep * readiness probes, transports, and cleanup policy; this class owns only * launch, unexpected-exit observation, and two-stage group termination. */ export declare class SupervisedChild { private readonly launch; private readonly options; private child_; private pid_; private stopping; private stopPromise; private readonly exitHandlers; private readonly errorHandlers; constructor(launch: SupervisedChildLaunch, options?: SupervisedChildOptions); get pid(): number | null; onExit(handler: ExitHandler): () => void; onError(handler: ErrorHandler): () => void; start(): Promise; stop(): Promise; private doStop; private notifyExit; private notifyError; } export {}; //# sourceMappingURL=supervised-child.d.ts.map