UNPKG

1.46 kBTypeScriptView Raw
1import execa from "execa";
2type withPkg<T> = T & {
3 pkg?: unknown;
4};
5export type LernaChildProcess = withPkg<execa.ExecaChildProcess<string>>;
6export type LernaReturnValue = withPkg<execa.ExecaReturnValue<string>>;
7export type LernaOptions = withPkg<execa.Options>;
8/**
9 * Execute a command asynchronously, piping stdio by default.
10 * @param command
11 * @param args
12 * @param opts
13 * @returns
14 */
15export declare function exec(command: string, args: string[], opts?: LernaOptions): Promise<LernaReturnValue>;
16/**
17 * Execute a command synchronously.
18 * @param command
19 * @param args
20 * @param opts
21 */
22export declare function execSync(command: string, args: string[], opts?: import("execa").SyncOptions): string;
23/**
24 * Spawn a command asynchronously, _always_ inheriting stdio.
25 * @param command
26 * @param args
27 * @param opts
28 */
29export declare function spawn(command: string, args: string[], opts?: LernaOptions): Promise<LernaReturnValue>;
30/**
31 * Spawn a command asynchronously, streaming stdio with optional prefix.
32 * @param command
33 * @param args
34 * @param opts
35 * @param prefix
36 */
37export declare function spawnStreaming(command: string, args: string[], opts?: LernaOptions, prefix?: string): Promise<LernaReturnValue>;
38export declare function getChildProcessCount(): number;
39/**
40 * @param result
41 * @returns
42 */
43export declare function getExitCode(result: execa.ExecaError<string> & {
44 code?: string | number;
45}): number | undefined;
46export {};