import child from 'node:child_process'; import type { ShellProcess } from '../types/shell'; export declare const shell: { /** * Spawns a shell command * - Start child process with the command * - Listen to data output events and collect them * @param command The command to run, e.g. echo, cat, slack.exe * @param args The arguments for the command, e.g. 'hi', '--skip-update' * @param shellOpts Options to customize shell execution * @returns command output */ spawnProcess: (command: string, args: string[], shellOpts?: Partial) => ShellProcess; /** * Run shell command synchronously * - Execute child process with the command * - Wait for the command to complete and return the standard output * @param command The command to run, e.g. echo, cat, slack.exe * @param args The arguments for the command, e.g. 'hi', '--skip-update' * @param shellOpts various shell spawning options available to customize * @returns command stdout */ runCommandSync: (command: string, args: string[], shellOpts?: Partial) => string; /** * Logic to wait for child process to finish executing * - Check if the close event was emitted, else wait for 1 sec * - Error out if > 30 sec * @param shell shell object */ checkIfFinished: (proc: ShellProcess) => Promise; /** * Sleep function used to wait for cli to finish executing */ sleep: (timeout?: number) => Promise; /** * Remove all the ANSI color and style encoding * @param text string */ removeANSIcolors: (text: string) => string; /** * Wait for output * @param expString expected string * @param shell */ waitForOutput: (expString: string, proc: ShellProcess, opts?: { /** @description How long to wait for expected output in milliseconds. Defaults to 10 seconds. */ timeout?: number; }) => Promise; assembleShellEnv: () => Record; kill: (proc: ShellProcess) => Promise; }; //# sourceMappingURL=shell.d.ts.map