import { normalizeArguments } from "./normalizeArguments.ts"; import { promise } from "./promise.ts"; import type { ChildProcessOptions, ChildProcessPromise, XCallback } from "../src/types.d.ts"; /** * Spawns a new process. * * __NOTE:__ On `options.stdio = "pipe"` _(default)_ generated output will be buffered unless * the option `options.buffer` is set to _false_. * * @param command Path of the executable to run as a child process. * @param argv Arguments that will be passed to the child process. * @param options Options passed to `child_process.spawn()`. */ export declare function spawn(command: string): ChildProcessPromise; export declare function spawn(command: string, options: ChildProcessOptions): ChildProcessPromise; export declare function spawn(command: string, argv: string[]): ChildProcessPromise; export declare function spawn(command: string, argv: string[], options: ChildProcessOptions): ChildProcessPromise; export declare function spawn(options: ChildProcessOptions): ChildProcessPromise; /** * Spawns a shell, executing the command inside the shell and buffering any generated output. * * @param command Path of the executable to run as a child process. * @param argv Arguments that will be passed to the child process. * @param options Options passed to `child_process.spawn()`. */ export declare function exec(command: string): ChildProcessPromise; export declare function exec(command: string, options: ChildProcessOptions): ChildProcessPromise; export declare function exec(command: string, argv: string[]): ChildProcessPromise; export declare function exec(command: string, argv: string[], options: ChildProcessOptions): ChildProcessPromise; export declare function exec(options: ChildProcessOptions): ChildProcessPromise; /** * Spawns a shell, executing the command inside the shell and sending any output to the current process. * * @param command Path of the executable to run as a child process. * @param argv Arguments that will be passed to the child process. * @param options Options passed to `child_process.spawn()`. */ export declare function run(command: string): ChildProcessPromise; export declare function run(command: string, options: ChildProcessOptions): ChildProcessPromise; export declare function run(command: string, argv: string[]): ChildProcessPromise; export declare function run(command: string, argv: string[], options: ChildProcessOptions): ChildProcessPromise; export declare function run(options: ChildProcessOptions): ChildProcessPromise; /** * A simple to use wrapper for either `exec` (with callback) or `run` (i/o piped to current process) * * @param command The command to run (should contain both the executable path and arguments) * @param buffer If provided will buffer stdout and stderr * @param callback If provided will buffer stdout and stderr, then pass the usuall result to this function * @param cwd The current working directory to call the command from (should default to `process.cwd()`) */ export declare function x(command: string): ChildProcessPromise; export declare function x(command: string, cwd: string): ChildProcessPromise; export declare function x(command: string, buffer: boolean): ChildProcessPromise; export declare function x(command: string, buffer: boolean, cwd: string): ChildProcessPromise; export declare function x(command: string, callback: XCallback): Promise; export declare function x(command: string, callback: XCallback, cwd: string): Promise; /** * Simple wrapper for `exec` to use on template strings. */ export declare function $(command: string | string[], ...values: unknown[]): ChildProcessPromise; /** * Create a wrapper for `spawn` to use on template strings. * * **NOTE:** If `options.shell` isn't a string, will default this property to `true`; otherwise behaves the same. */ export declare function create(options?: ChildProcessOptions): (command: string | string[], ...values: unknown[]) => ChildProcessPromise; import { ErrorSymbol, isSpawnError } from "./isSpawnError.ts"; export type * from "../src/types.d.ts"; export { ErrorSymbol, isSpawnError, normalizeArguments, promise, }; //# sourceMappingURL=child-process.d.ts.map