-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.d.ts
130 lines (120 loc) · 5.21 KB
/
index.d.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
declare module 'terminate' {
interface TerminateOptions {
/**
* Interval to poll whether `pid` and all of the childs pids have been killed.
* @default 500
*/
pollInterval?: number;
/**
* Max time (in milliseconds) to wait for process to exit before timing out
* and calling back with an error.
* @default 5000
*/
timeout?: number;
}
/**
* Error-first callback called when everything is successfully done.
*/
interface DoneCallback {
/**
* @param error - will be `null` if no error occured.
*/
(error: Error | null): void;
}
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
*/
export default function terminate(pid: number): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"`
* if it's empty or not defined.
*/
export default function terminate(pid: number, signal: string): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"`
* if it's empty or not defined.
* @param opts - options object.
*/
export default function terminate(pid: number, signal: string, opts: TerminateOptions): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"`
* if it's empty or not defined.
* @param opts - options object.
* @param callback - if you want to know once the procesess have been terminated,
* supply a callback.
*/
export default function terminate(pid: number, signal?: string, opts?: TerminateOptions, callback?: DoneCallback): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"`
* if it's empty or not defined.
* @param callback - if you want to know once the procesess have been terminated,
* supply a callback.
*/
export default function terminate(pid: number, signal: string, callback: DoneCallback): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"`
* if it's empty or not defined.
* @param opts - options object.
* @param callback - if you want to know once the procesess have been terminated,
* supply a callback.
*/
export default function terminate(pid: number, signal: string, opts: TerminateOptions, callback: DoneCallback): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param opts - options object.
*/
export default function terminate(pid: number, opts: TerminateOptions): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param callback - if you want to know once the procesess have been terminated,
* supply a callback.
*/
export default function terminate(pid: number, opts: TerminateOptions, callback: DoneCallback): void;
/**
* `terminate` is an ultra-simple way to kill all the node processes
* by providing a process pid. It finds all child processes and shuts
* them down too, so you don't have to worry about lingering processes.
*
* @param pid - the Process ID you want to terminate.
* @param callback - if you want to know once the procesess have been terminated,
* supply a callback.
*/
export default function terminate(pid: number, callback: DoneCallback): void;
}