import type { Context } from "../context.ts"; import { type ExecutionEnv, ExecutionError, FileError, type FileInfo, type Result, type ShellExecOptions, type ShellExecResult, type TextLineReader } from "../types.ts"; /** * Ordered `taskkill` launchers to try, most reliable first. * * `spawn("taskkill", ...)` relies on a PATH lookup, so any session whose PATH lost * `%SystemRoot%\System32` (a POSIX-style PATH inherited from a Git Bash/MSYS launcher, * a truncated user PATH, a locked-down service account) fails to resolve it. A broken PATH * must not cost us the process-tree kill, so every absolute System32 location that actually * exists is tried before the bare PATH-resolved name. */ export declare function windowsTaskkillCandidates(env?: NodeJS.ProcessEnv): string[]; /** * Kill a process and all its children on Windows via `taskkill /T`. * * Synchronous on purpose. A caller that tears down and exits in the same tick would never * observe an asynchronous killer's `error` event, leaving the target alive. `spawnSync` * also reports a failed executable lookup on its returned `error` field instead of * emitting it, so a PATH without `%SystemRoot%\System32` can no longer surface as an * uncaught `spawn taskkill ENOENT`. * * The direct `process.kill` at the end is a degraded last resort reached only when no * `taskkill.exe` can be launched at all. It maps to `TerminateProcess`, which does not * touch descendants; nothing in-process can walk a Windows process tree without an * external tool, so this still beats leaving the whole tree running. */ export declare function killWindowsProcessTree(pid: number, taskkillPaths?: string[]): void; export declare class NodeExecutionEnv implements ExecutionEnv { cwd: string; private shellPath?; private shellEnv?; private activeChildPids; constructor(options: { cwd: string; shellPath?: string; shellEnv?: NodeJS.ProcessEnv; }); absolutePath(path: string, _context: Context): Promise>; joinPath(parts: string[], _context: Context): Promise>; exec(command: string, options: ShellExecOptions | undefined, context: Context): Promise>; openTextLineReader(path: string, context: Context): Promise>; readTextFile(path: string, context: Context): Promise>; readTextLines(path: string, options: { maxLines?: number; } | undefined, context: Context): Promise>; readBinaryFile(path: string, context: Context): Promise>; writeFile(path: string, content: string | Uint8Array, context: Context): Promise>; appendFile(path: string, content: string | Uint8Array, context: Context): Promise>; renameFile(sourcePath: string, destinationPath: string, context: Context): Promise>; fileInfo(path: string, context: Context): Promise>; listDir(path: string, context: Context): Promise>; canonicalPath(path: string, context: Context): Promise>; exists(path: string, context: Context): Promise>; createDir(path: string, options: { recursive?: boolean; } | undefined, context: Context): Promise>; remove(path: string, options: { recursive?: boolean; force?: boolean; } | undefined, context: Context): Promise>; createTempDir(prefix: string | undefined, context: Context): Promise>; createTempFile(options: { prefix?: string; suffix?: string; } | undefined, context: Context): Promise>; cleanup(_context: Context): Promise; } //# sourceMappingURL=nodejs.d.ts.map