@applitools/utils
Version:
37 lines (36 loc) • 1.42 kB
TypeScript
/// <reference types="node" />
import { ExecOptions, SpawnOptions } from 'child_process';
export declare function executeAndControlProcess(command: string, args?: any[], options?: {
spawnOptions?: SpawnOptions;
timeout?: number;
}): {
subProcess: import("child_process").ChildProcess;
exitPromise: Promise<unknown>;
};
export declare function executeProcess(command: string, args?: any[], options?: {
spawnOptions?: SpawnOptions;
timeout?: number;
}): Promise<unknown>;
export declare function sh(command: string, options?: {
spawnOptions?: SpawnOptions;
timeout?: number;
}): Promise<unknown>;
export declare function execute(command: string, options?: ExecOptions): Promise<{
stdout: string;
stderr: string;
code: number;
}>;
/**
* Best-effort resident memory (bytes) of `rootPid` and all of its descendant
* processes — approximates the real RAM a multi-process app (e.g. a Chromium
* browser: browser + renderers + GPU) consumes, which the V8 JS heap does NOT.
*
* Purely additive observability: resolves to `null` on ANY failure (unsupported
* platform, parse/permission error, missing tools, root process already gone).
* Never throws to the caller. Browser builds always resolve `null`.
*/
export declare function sampleProcessTreeMemory(rootPid: number, options?: {
logger?: {
log: (...args: any[]) => void;
};
}): Promise<number | null>;