import { type Resource } from "webappwiz/disposable"; import type { ProcessLike } from "../process-like/process-like.js"; import type { Child, ListeningEntry, ProcessEntry, Ps, SpawnCaptureResult, SpawnOptions, SpawnResult, StartOptions, TerminalChild, TerminalOptions } from "./ps.js"; /** What a `NodePs` speaks to; the running process by default. */ export interface NodePsOptions { proc?: ProcessLike; } export declare class NodePs implements Ps { platform: NodeJS.Platform; pid: number; hostname: string; args: string[]; self: string[]; private readonly proc; constructor(opts?: NodePsOptions); alive(pid: number): boolean; spawn(argv: string[], opts?: SpawnOptions): Promise; spawnCapture(argv: string[], opts?: SpawnOptions): Promise; start(argv: string[], opts?: StartOptions): Child; startOnTerminal(argv: string[], opts: TerminalOptions): TerminalChild; processes(): Promise; listening(): Promise; /** * Node replaces the whole environment when `env` is given, so a command * launched with the caller's two or three variables would have no PATH and * no HOME. Callers mean "and these as well", so that is what this does. * * Always built from `proc.env` rather than left undefined for Node to * inherit, so what a child sees comes through the seam either way. */ private options; cwd(): string; env(name: string): string | undefined; columns(): number | undefined; cd(path: string): void; exit(code: number): void; on(signal: string, handler: () => void): Resource; once(event: "exit", handler: () => void): Resource; }