-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathinterfaces.ts
72 lines (54 loc) · 1.99 KB
/
interfaces.ts
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
import * as stream from 'stream'
/**
* Interface for exec options
*/
export interface ExecOptions {
/** optional working directory. defaults to current */
cwd?: string
/** optional envvar dictionary. defaults to current process's env */
env?: {[key: string]: string}
/** optional. defaults to false */
silent?: boolean
/** optional out stream to use. Defaults to process.stdout */
outStream?: stream.Writable
/** optional err stream to use. Defaults to process.stderr */
errStream?: stream.Writable
/** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */
windowsVerbatimArguments?: boolean
/** optional. whether to fail if output to stderr. defaults to false */
failOnStdErr?: boolean
/** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
ignoreReturnCode?: boolean
/** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
delay?: number
/** optional. input to write to the process on STDIN. */
input?: Buffer
/** optional. Listeners for output. Callback functions that will be called on these events */
listeners?: ExecListeners
}
/**
* Interface for the output of getExecOutput()
*/
export interface ExecOutput {
/**The exit code of the process */
exitCode: number
/**The entire stdout of the process as a string */
stdout: string
/**The entire stderr of the process as a string */
stderr: string
}
/**
* The user defined listeners for an exec call
*/
export interface ExecListeners {
/** A call back for each buffer of stdout */
stdout?: (data: Buffer) => void
/** A call back for each buffer of stderr */
stderr?: (data: Buffer) => void
/** A call back for each line of stdout */
stdline?: (data: string) => void
/** A call back for each line of stderr */
errline?: (data: string) => void
/** A call back for each debug log */
debug?: (data: string) => void
}