import * as plugins from './plugins.js'; export interface IRunOptions { cwd?: string; } export interface ISpawnOptions { /** Working directory for the child process */ cwd?: string; /** Environment variables (merged with parent's env) */ env?: Record; /** Additional CLI arguments to pass to the script */ args?: string[]; /** * Stdio configuration * - 'pipe': Create pipes for stdin/stdout/stderr (default) * - 'inherit': Use parent's stdio * - Array: Custom configuration per stream */ stdio?: 'pipe' | 'inherit' | ['pipe' | 'inherit' | 'ignore', 'pipe' | 'inherit' | 'ignore', 'pipe' | 'inherit' | 'ignore']; /** * Optional timeout in milliseconds * If provided, process is automatically killed after timeout */ timeout?: number; /** * AbortSignal for cancellation support * Allows external cancellation of the process */ signal?: AbortSignal; } export interface ITsrunChildProcess { /** Direct access to Node's ChildProcess object */ childProcess: plugins.ChildProcess; /** Readable stream for stdout (null if stdio is 'inherit') */ stdout: plugins.Readable | null; /** Readable stream for stderr (null if stdio is 'inherit') */ stderr: plugins.Readable | null; /** Promise that resolves with the exit code when process ends */ exitCode: Promise; /** * Send signal to process * Returns true if signal was sent successfully */ kill(signal?: NodeJS.Signals): boolean; /** * Gracefully terminate the process * Tries SIGTERM first, waits 5s, then SIGKILL if still running * Returns a promise that resolves when process is terminated */ terminate(): Promise; } export declare const runPath: (pathArg: string, fromFileUrl?: string, options?: IRunOptions) => Promise; export declare const runCli: (pathArg?: string, options?: IRunOptions) => Promise; export declare const spawnPath: (filePath: string, fromFileUrl?: string | URL, options?: ISpawnOptions) => ITsrunChildProcess;