-
Notifications
You must be signed in to change notification settings - Fork 24.3k
/
execa_v5.x.x.js
117 lines (103 loc) · 2.67 KB
/
execa_v5.x.x.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
* @oncall react_native
*/
// Modified from flow-typed repo:
// https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/execa_v2.x.x/flow_v0.104.x-/execa_v2.x.x.js#L2
declare module 'execa' {
declare type StdIoOption =
| 'pipe'
| 'ipc'
| 'ignore'
| 'inherit'
| stream$Stream
| number;
declare type CommonOptions = {
argv0?: string,
cleanup?: boolean,
cwd?: string,
detached?: boolean,
encoding?: string,
env?: {[string]: string | void, ...},
extendEnv?: boolean,
gid?: number,
killSignal?: string | number,
localDir?: string,
maxBuffer?: number,
preferLocal?: boolean,
reject?: boolean,
shell?: boolean | string,
stderr?: ?StdIoOption,
stdin?: ?StdIoOption,
stdio?: 'pipe' | 'ignore' | 'inherit' | $ReadOnlyArray<?StdIoOption>,
stdout?: ?StdIoOption,
stripEof?: boolean,
timeout?: number,
uid?: number,
windowsVerbatimArguments?: boolean,
buffer?: boolean,
all?: boolean,
stripFinalNewline?: boolean,
};
declare type SyncOptions = {
...CommonOptions,
input?: string | Buffer,
};
declare type Options = {
...CommonOptions,
input?: string | Buffer | stream$Readable,
};
declare type SyncResult = {
stdout: string,
stderr: string,
exitCode: number,
failed: boolean,
signal: ?string,
command: string,
timedOut: boolean,
};
declare type Result = {
...SyncResult,
killed: boolean,
};
declare interface ExecaPromise
extends Promise<Result>,
child_process$ChildProcess {}
declare interface ExecaError extends ErrnoError {
stdout: string;
stderr: string;
failed: boolean;
signal: ?string;
command: string;
timedOut: boolean;
exitCode: number;
}
declare interface Execa {
(
file: string,
args?: $ReadOnlyArray<string>,
options?: $ReadOnly<Options>,
): ExecaPromise;
(file: string, options?: $ReadOnly<Options>): ExecaPromise;
command(command: string, options?: $ReadOnly<Options>): ExecaPromise;
commandSync(command: string, options?: $ReadOnly<Options>): ExecaPromise;
node(
path: string,
args?: $ReadOnlyArray<string>,
options?: $ReadOnly<Options>,
): void;
sync(
file: string,
args?: $ReadOnlyArray<string>,
options?: $ReadOnly<SyncOptions>,
): SyncResult;
sync(file: string, options?: $ReadOnly<SyncOptions>): SyncResult;
}
declare module.exports: Execa;
}