import 'reflect-metadata'; import { ChildProcess } from 'child_process'; import { CoreModels__NS__ExecuteOptions } from './core-models'; interface ResolvePromiseMsg { /** * until this string is in output of stdout */ stdout?: string | string[]; /** * until this string is in output of stderr */ stderr?: string | string[]; /** * by default only resolve when exit code is 0 */ resolveAfterAnyExitCode?: boolean; } export interface UtilsProcess__NS__ProcessStartOptions { /** * by default is process.cwd(); */ cwd?: string; /** * by default is false */ showCommand?: boolean; /** * Modify output line by line */ outputLineReplace?: (outputLineStderOrStdout: string) => string; resolvePromiseMsg?: ResolvePromiseMsg; /** * Prefix messages output from child_process */ prefix?: string; /** * Try command again after fail after n milliseconds */ tryAgainWhenFailAfter?: number; askToTryAgainOnError?: boolean; exitOnErrorCallback?: (code: number) => void; /** * Use big buffer for big webpack logs * (it may slow down smaller processes execution) */ biggerBuffer?: boolean; hideOutput?: { stdout?: boolean; stderr?: boolean; }; } /** * TODO IMPLEMENT * start async node process */ export declare const UtilsProcess__NS__startAsync: (command: string, cwd: string, options?: Omit) => Promise; /** * This let you start child process and resolve promise when some * condition is met. It is useful for example when you want to start * process and wait until some output is in stdout or stderr. */ export declare const UtilsProcess__NS__startAsyncChildProcessCommandUntil: (command: string, options: { /** * tels when to resolve promise */ untilOptions: ResolvePromiseMsg; displayOutputInParentProcess?: boolean; resolveAfterAnyExitCode?: boolean; cwd?: string; }) => Promise; export declare const UtilsProcess__NS__getGitBashPath: () => string; /** * TODO IMPLEMENT * start async node process */ export declare const UtilsProcess__NS__startInNewTerminalWindow: (command: string, options?: Pick) => any; export declare const UtilsProcess__NS__getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh"; /** * Get CPU and memory usage for a single PID. */ export declare const UtilsProcess__NS__getUsageForPid: (pid: number) => Promise<{ cpu: number; memoryInGB: number; memoryInMB: number; }>; /** * Cross-platform function to list *direct* child PIDs of a given PID. * Uses the appropriate command depending on `process.platform`. */ export declare function UtilsProcess__NS__getChildPidsOnce(pid: number): Promise; /** * Get CPU and memory usage for the current process (the Node.js process itself), * plus any child processes spawned by it. */ export declare const UtilsProcess__NS__getCurrentProcessAndChildUsage: () => Promise<{ current: { cpu: number; memoryInMB: number; }; children: Array<{ pid: number; cpu: number; memoryInMB: number; }>; }>; /** * Kills all running Java processes cross‑platform. * @returns Promise true if processes were killed, false if none found */ export declare const UtilsProcess__NS__killAllJava: () => Promise; export declare const UtilsProcess__NS__killProcess: (pidOrProcess: number | ChildProcess) => Promise; export declare const UtilsProcess__NS__killProcessOnPort: (port: number) => Promise; /** * Kills all Node.js processes except the current process. * Works on Windows, macOS, and Linux. * @returns {number} Number of processes killed */ export declare const UtilsProcess__NS__killAllOtherNodeProcesses: () => Promise; export declare const UtilsProcess__NS__isNodeVersionOk: (options?: { required?: string; log?: boolean; throwErrorIfNotOk?: boolean; }) => boolean; export declare const UtilsProcess__NS__getPathOfExecutable: (command: string) => Promise; export {};