spawn-rx 2.0.12 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,88 +1,84 @@
1
- import 'rxjs/add/observable/of';
2
- import 'rxjs/add/observable/merge';
3
- import 'rxjs/add/operator/pluck';
4
- import 'rxjs/add/operator/reduce';
5
- import { Observable } from 'rxjs/Observable';
6
- /**
7
- * Finds the actual executable and parameters to run on Windows. This method
8
- * mimics the POSIX behavior of being able to run scripts as executables by
9
- * replacing the passed-in executable with the script runner, for PowerShell,
10
- * CMD, and node scripts.
11
- *
12
- * This method also does the work of running down PATH, which spawn on Windows
13
- * also doesn't do, unlike on POSIX.
14
- *
15
- * @param {string} exe The executable to run
16
- * @param {Array<string>} args The arguments to run
17
- *
18
- * @return {Object} The cmd and args to run
19
- * @property {string} cmd The command to pass to spawn
20
- * @property {Array<string>} args The arguments to pass to spawn
21
- */
22
- export declare function findActualExecutable(exe: string, args: Array<string>): {
23
- cmd: string;
24
- args: Array<string>;
25
- };
26
- /**
27
- * Spawns a process but detached from the current process. The process is put
28
- * into its own Process Group that can be killed by unsubscribing from the
29
- * return Observable.
30
- *
31
- * @param {string} exe The executable to run
32
- * @param {Array<string>} params The parameters to pass to the child
33
- * @param {Object} opts Options to pass to spawn.
34
- *
35
- * @return {Observable<string>} Returns an Observable that when subscribed
36
- * to, will create a detached process. The
37
- * process output will be streamed to this
38
- * Observable, and if unsubscribed from, the
39
- * process will be terminated early. If the
40
- * process terminates with a non-zero value,
41
- * the Observable will terminate with onError.
42
- */
43
- export declare function spawnDetached(exe: string, params: Array<string>, opts?: any): Observable<string>;
44
- /**
45
- * Spawns a process attached as a child of the current process.
46
- *
47
- * @param {string} exe The executable to run
48
- * @param {Array<string>} params The parameters to pass to the child
49
- * @param {Object} opts Options to pass to spawn.
50
- *
51
- * @return {Observable<string>} Returns an Observable that when subscribed
52
- * to, will create a child process. The
53
- * process output will be streamed to this
54
- * Observable, and if unsubscribed from, the
55
- * process will be terminated early. If the
56
- * process terminates with a non-zero value,
57
- * the Observable will terminate with onError.
58
- */
59
- export declare function spawn<T = string>(exe: string, params?: Array<string>, opts?: any): Observable<T>;
60
- /**
61
- * Spawns a process but detached from the current process. The process is put
62
- * into its own Process Group.
63
- *
64
- * @param {string} exe The executable to run
65
- * @param {Array<string>} params The parameters to pass to the child
66
- * @param {Object} opts Options to pass to spawn.
67
- *
68
- * @return {Promise<string>} Returns an Promise that represents a detached
69
- * process. The value returned is the process
70
- * output. If the process terminates with a
71
- * non-zero value, the Promise will resolve with
72
- * an Error.
73
- */
74
- export declare function spawnDetachedPromise(exe: string, params: Array<string>, opts?: any): Promise<string>;
75
- /**
76
- * Spawns a process as a child process.
77
- *
78
- * @param {string} exe The executable to run
79
- * @param {Array<string>} params The parameters to pass to the child
80
- * @param {Object} opts Options to pass to spawn.
81
- *
82
- * @return {Promise<string>} Returns an Promise that represents a child
83
- * process. The value returned is the process
84
- * output. If the process terminates with a
85
- * non-zero value, the Promise will resolve with
86
- * an Error.
87
- */
88
- export declare function spawnPromise(exe: string, params: Array<string>, opts?: any): Promise<string>;
1
+ import { Observable } from 'rxjs';
2
+ /**
3
+ * Finds the actual executable and parameters to run on Windows. This method
4
+ * mimics the POSIX behavior of being able to run scripts as executables by
5
+ * replacing the passed-in executable with the script runner, for PowerShell,
6
+ * CMD, and node scripts.
7
+ *
8
+ * This method also does the work of running down PATH, which spawn on Windows
9
+ * also doesn't do, unlike on POSIX.
10
+ *
11
+ * @param {string} exe The executable to run
12
+ * @param {Array<string>} args The arguments to run
13
+ *
14
+ * @return {Object} The cmd and args to run
15
+ * @property {string} cmd The command to pass to spawn
16
+ * @property {Array<string>} args The arguments to pass to spawn
17
+ */
18
+ export declare function findActualExecutable(exe: string, args: Array<string>): {
19
+ cmd: string;
20
+ args: Array<string>;
21
+ };
22
+ /**
23
+ * Spawns a process but detached from the current process. The process is put
24
+ * into its own Process Group that can be killed by unsubscribing from the
25
+ * return Observable.
26
+ *
27
+ * @param {string} exe The executable to run
28
+ * @param {Array<string>} params The parameters to pass to the child
29
+ * @param {Object} opts Options to pass to spawn.
30
+ *
31
+ * @return {Observable<string>} Returns an Observable that when subscribed
32
+ * to, will create a detached process. The
33
+ * process output will be streamed to this
34
+ * Observable, and if unsubscribed from, the
35
+ * process will be terminated early. If the
36
+ * process terminates with a non-zero value,
37
+ * the Observable will terminate with onError.
38
+ */
39
+ export declare function spawnDetached(exe: string, params: Array<string>, opts?: any): Observable<string>;
40
+ /**
41
+ * Spawns a process attached as a child of the current process.
42
+ *
43
+ * @param {string} exe The executable to run
44
+ * @param {Array<string>} params The parameters to pass to the child
45
+ * @param {Object} opts Options to pass to spawn.
46
+ *
47
+ * @return {Observable<string>} Returns an Observable that when subscribed
48
+ * to, will create a child process. The
49
+ * process output will be streamed to this
50
+ * Observable, and if unsubscribed from, the
51
+ * process will be terminated early. If the
52
+ * process terminates with a non-zero value,
53
+ * the Observable will terminate with onError.
54
+ */
55
+ export declare function spawn<T = string>(exe: string, params?: Array<string>, opts?: any): Observable<T>;
56
+ /**
57
+ * Spawns a process but detached from the current process. The process is put
58
+ * into its own Process Group.
59
+ *
60
+ * @param {string} exe The executable to run
61
+ * @param {Array<string>} params The parameters to pass to the child
62
+ * @param {Object} opts Options to pass to spawn.
63
+ *
64
+ * @return {Promise<string>} Returns an Promise that represents a detached
65
+ * process. The value returned is the process
66
+ * output. If the process terminates with a
67
+ * non-zero value, the Promise will resolve with
68
+ * an Error.
69
+ */
70
+ export declare function spawnDetachedPromise(exe: string, params: Array<string>, opts?: any): Promise<string>;
71
+ /**
72
+ * Spawns a process as a child process.
73
+ *
74
+ * @param {string} exe The executable to run
75
+ * @param {Array<string>} params The parameters to pass to the child
76
+ * @param {Object} opts Options to pass to spawn.
77
+ *
78
+ * @return {Promise<string>} Returns an Promise that represents a child
79
+ * process. The value returned is the process
80
+ * output. If the process terminates with a
81
+ * non-zero value, the Promise will resolve with
82
+ * an Error.
83
+ */
84
+ export declare function spawnPromise(exe: string, params: Array<string>, opts?: any): Promise<string>;