import { type TIngridResponse } from '@webpod/ingrid'; export type TPsLookupEntry = { pid: string; ppid?: string; command: string; arguments: string[]; }; export type TPsLookupQuery = { pid?: number | string | (string | number)[]; command?: string; arguments?: string; ppid?: number | string; psargs?: string; }; export type TPsLookupCallback = (err: any, processList?: TPsLookupEntry[]) => void; export type TPsKillOptions = { timeout?: number; signal?: string | number | NodeJS.Signals; /** Polling interval in ms between exit checks (default 200). */ interval?: number; }; export type TPsTreeOpts = { pid: string | number; recursive?: boolean; }; export type TPsNext = (err?: any, data?: any) => void; /** * Query running processes by pid, command, arguments or ppid. * Supports both promise and callback styles. */ export declare const lookup: { (query?: TPsLookupQuery, cb?: TPsLookupCallback): Promise; sync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[]; }; /** Synchronous version of {@link lookup}. */ export declare const lookupSync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[]; /** Returns child processes of the given parent pid. */ export declare const tree: { (opts?: string | number | TPsTreeOpts, cb?: TPsLookupCallback): Promise; sync: (opts?: string | number | TPsTreeOpts, cb?: TPsLookupCallback) => TPsLookupEntry[]; }; /** Synchronous version of {@link tree}. */ export declare const treeSync: (opts?: string | number | TPsTreeOpts, cb?: TPsLookupCallback) => TPsLookupEntry[]; export declare const pickTree: (list: TPsLookupEntry[], pid: string | number, recursive?: boolean) => TPsLookupEntry[]; /** * Kills a process by pid. * @param pid - Process ID to kill * @param opts - Signal, options object, or callback * @param next - Callback invoked when kill is confirmed or timed out */ export declare const kill: (pid: string | number, opts?: TPsNext | TPsKillOptions | TPsKillOptions["signal"], next?: TPsNext) => Promise; export declare const normalizeOutput: (data: TIngridResponse) => TPsLookupEntry[]; export declare const filterProcessList: (processList: TPsLookupEntry[], query?: TPsLookupQuery) => TPsLookupEntry[]; export declare const removeWmicPrefix: (stdout: string) => string;