UNPKG

1.34 kBTypeScriptView Raw
1/// <reference types="node" />
2import { PortablePath } from '@yarnpkg/fslib';
3import { Readable, Writable } from 'stream';
4export declare enum EndStrategy {
5 Never = 0,
6 ErrorCode = 1,
7 Always = 2
8}
9export declare type PipevpOptions = {
10 cwd: PortablePath;
11 env?: {
12 [key: string]: string | undefined;
13 };
14 end?: EndStrategy;
15 strict?: boolean;
16 stdin: Readable | null;
17 stdout: Writable;
18 stderr: Writable;
19};
20export declare function pipevp(fileName: string, args: Array<string>, { cwd, env, strict, stdin, stdout, stderr, end }: PipevpOptions): Promise<{
21 code: number;
22}>;
23export declare type ExecvpOptions = {
24 cwd: PortablePath;
25 env?: {
26 [key: string]: string | undefined;
27 };
28 encoding?: string;
29 strict?: boolean;
30};
31export declare function execvp(fileName: string, args: Array<string>, opts: ExecvpOptions & {
32 encoding: 'buffer';
33}): Promise<{
34 code: number;
35 stdout: Buffer;
36 stderr: Buffer;
37}>;
38export declare function execvp(fileName: string, args: Array<string>, opts: ExecvpOptions & {
39 encoding: string;
40}): Promise<{
41 code: number;
42 stdout: string;
43 stderr: string;
44}>;
45export declare function execvp(fileName: string, args: Array<string>, opts: ExecvpOptions): Promise<{
46 code: number;
47 stdout: string;
48 stderr: string;
49}>;