///
import {
ChildProcess,
ExecFileOptionsWithBufferEncoding,
ExecFileOptionsWithOtherEncoding,
ExecFileOptionsWithStringEncoding,
ExecOptions,
ForkOptions,
SpawnOptions,
} from "child_process";
/**
* Simple wrapper around the child_process module that makes use of promises
*/
export interface PromiseResult {
childProcess: ChildProcess;
stdout: Enc;
stderr: Enc;
}
export interface SpawnPromiseResult extends PromiseResult {
code: number;
}
export interface ChildProcessPromise extends Promise {
childProcess: ChildProcess;
}
export interface Options {
/**
* Pass an additional capture option to buffer the result of stdout and/or stderr
* Default: []
*/
capture?: [] | ["stdout" | "stderr"] | ["stdout", "stderr"] | ["stderr", "stdout"] | undefined;
/**
* Array of the numbers that should be interpreted as successful execution codes
* Default: [0]
*/
successfulExitCodes?: number[] | undefined;
}
export function exec(
command: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function exec(
command: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function exec(
command: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function exec(
command: Readonly,
options?: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
args: readonly string[] | null,
options: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
options: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
args: readonly string[] | null,
options: Readonly,
): ChildProcessPromise>;
export function execFile(
file: Readonly,
args?: readonly string[] | null,
options?: Readonly,
): ChildProcessPromise>;
export function spawn(
command: Readonly,
args?: readonly string[] | null,
options?: Readonly,
): ChildProcessPromise;
export function fork(
modulePath: string,
args?: readonly string[],
options?: Readonly,
): ChildProcessPromise;