import type { SpawnOptions, SpawnOptionsWithoutStdio, SpawnOptionsWithStdioTuple, SpawnSyncReturns, StdioNull, StdioPipe } from 'node:child_process'; /** * Return type for spawnAsync function, based on SpawnSyncReturns but without output and error properties */ export type SpawnAsyncReturns = Omit, 'output' | 'error'>; /** * Options for spawnAsync function, extending various Node.js spawn options with additional functionality */ export type SpawnAsyncOptions = (SpawnOptionsWithoutStdio | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptionsWithStdioTuple | SpawnOptions) & { /** Input string to write to the spawned process's stdin */ input?: string; /** If true, stderr output will be merged into stdout */ mergeOutAndError?: boolean; /** If true, the spawned process will be killed when the parent process exits */ killOnExit?: boolean; /** If true, enables verbose logging of process operations */ verbose?: boolean; /** If true, stdout data will be printed to console as it's received */ printingStdout?: boolean; /** If true, stderr data will be printed to console as it's received */ printingStderr?: boolean; /** If true, blank-only lines are skipped while printing stdout/stderr in realtime */ omitBlankLinesWhilePrinting?: boolean; }; /** * Spawns a child process asynchronously and returns a promise that resolves with the process results * * This function provides a Promise-based wrapper around Node.js's spawn function with additional features: * - Automatic encoding of stdout/stderr as UTF-8 * - Option to merge stderr into stdout * - Option to automatically kill the process on parent exit * - Option to provide input via stdin * - Verbose logging capability * * @param command - The command to run * @param args - List of string arguments * @param options - Configuration options for the spawned process * @returns Promise that resolves with the process results including pid, stdout, stderr, status, and signal * @throws Will reject the promise if the process fails to spawn or encounters an error * * @example * ```typescript * const result = await spawnAsync('ls', ['-la'], { verbose: true }); * console.log(result.stdout); * ``` */ export declare function spawnAsync(command: string, args?: readonly string[], options?: SpawnAsyncOptions): Promise;