@theia/process 1.34.2 → 1.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/common/process-common-module.d.ts +3 -3
  4. package/lib/common/process-common-module.js +22 -22
  5. package/lib/common/process-manager-types.d.ts +35 -35
  6. package/lib/common/process-manager-types.js +23 -23
  7. package/lib/common/shell-command-builder.d.ts +49 -49
  8. package/lib/common/shell-command-builder.js +174 -174
  9. package/lib/common/shell-command-builder.slow-spec.d.ts +9 -9
  10. package/lib/common/shell-command-builder.slow-spec.js +404 -404
  11. package/lib/common/shell-quoting.d.ts +91 -91
  12. package/lib/common/shell-quoting.js +145 -145
  13. package/lib/common/shell-quoting.spec.d.ts +1 -1
  14. package/lib/common/shell-quoting.spec.js +170 -170
  15. package/lib/node/dev-null-stream.d.ts +17 -17
  16. package/lib/node/dev-null-stream.js +41 -41
  17. package/lib/node/index.d.ts +6 -6
  18. package/lib/node/index.js +33 -33
  19. package/lib/node/multi-ring-buffer.d.ts +68 -68
  20. package/lib/node/multi-ring-buffer.js +310 -310
  21. package/lib/node/multi-ring-buffer.spec.d.ts +1 -1
  22. package/lib/node/multi-ring-buffer.spec.js +422 -422
  23. package/lib/node/process-backend-module.d.ts +3 -3
  24. package/lib/node/process-backend-module.js +56 -56
  25. package/lib/node/process-manager.d.ts +33 -33
  26. package/lib/node/process-manager.js +113 -113
  27. package/lib/node/process.d.ts +95 -95
  28. package/lib/node/process.js +153 -153
  29. package/lib/node/pseudo-pty.d.ts +22 -22
  30. package/lib/node/pseudo-pty.js +38 -38
  31. package/lib/node/raw-process.d.ts +45 -45
  32. package/lib/node/raw-process.js +115 -115
  33. package/lib/node/raw-process.spec.d.ts +1 -1
  34. package/lib/node/raw-process.spec.js +164 -164
  35. package/lib/node/task-terminal-process.d.ts +10 -10
  36. package/lib/node/task-terminal-process.js +47 -47
  37. package/lib/node/terminal-process.d.ts +49 -49
  38. package/lib/node/terminal-process.js +180 -180
  39. package/lib/node/terminal-process.spec.d.ts +1 -1
  40. package/lib/node/terminal-process.spec.js +89 -89
  41. package/lib/node/test/process-test-container.d.ts +2 -2
  42. package/lib/node/test/process-test-container.js +28 -28
  43. package/lib/node/utils.d.ts +16 -16
  44. package/lib/node/utils.js +77 -77
  45. package/package.json +4 -4
  46. package/src/common/process-common-module.ts +22 -22
  47. package/src/common/process-manager-types.ts +58 -58
  48. package/src/common/shell-command-builder.slow-spec.ts +486 -486
  49. package/src/common/shell-command-builder.ts +187 -187
  50. package/src/common/shell-quoting.spec.ts +176 -176
  51. package/src/common/shell-quoting.ts +236 -236
  52. package/src/common/tests/$weird(),file=name.js +1 -1
  53. package/src/common/tests/white space.js +1 -1
  54. package/src/node/dev-null-stream.ts +47 -47
  55. package/src/node/index.ts +22 -22
  56. package/src/node/multi-ring-buffer.spec.ts +486 -486
  57. package/src/node/multi-ring-buffer.ts +348 -348
  58. package/src/node/process-backend-module.ts +67 -67
  59. package/src/node/process-manager.ts +107 -107
  60. package/src/node/process.ts +207 -207
  61. package/src/node/pseudo-pty.ts +54 -54
  62. package/src/node/raw-process.spec.ts +199 -199
  63. package/src/node/raw-process.ts +156 -156
  64. package/src/node/string-argv.d.ts +21 -21
  65. package/src/node/task-terminal-process.ts +41 -41
  66. package/src/node/terminal-process.spec.ts +104 -104
  67. package/src/node/terminal-process.ts +198 -198
  68. package/src/node/test/process-fork-test.js +22 -22
  69. package/src/node/test/process-test-container.ts +27 -27
  70. package/src/node/utils.ts +79 -79
@@ -1,154 +1,154 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- var __param = (this && this.__param) || function (paramIndex, decorator) {
27
- return function (target, key) { decorator(target, key, paramIndex); }
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.Process = exports.ProcessType = void 0;
31
- const inversify_1 = require("@theia/core/shared/inversify");
32
- const common_1 = require("@theia/core/lib/common");
33
- const node_1 = require("@theia/core/lib/node");
34
- const core_1 = require("@theia/core");
35
- const child_process_1 = require("child_process");
36
- const fs = require("fs");
37
- const process_manager_types_1 = require("../common/process-manager-types");
38
- Object.defineProperty(exports, "ProcessType", { enumerable: true, get: function () { return process_manager_types_1.ProcessType; } });
39
- let Process = class Process {
40
- constructor(processManager, logger, type, options) {
41
- this.processManager = processManager;
42
- this.logger = logger;
43
- this.type = type;
44
- this.options = options;
45
- this.startEmitter = new common_1.Emitter();
46
- this.exitEmitter = new common_1.Emitter();
47
- this.closeEmitter = new common_1.Emitter();
48
- this.errorEmitter = new common_1.Emitter();
49
- this._killed = false;
50
- this.id = this.processManager.register(this);
51
- this.initialCwd = options && options.options && 'cwd' in options.options && options.options['cwd'].toString() || __dirname;
52
- }
53
- get killed() {
54
- return this._killed;
55
- }
56
- get onStart() {
57
- return this.startEmitter.event;
58
- }
59
- /**
60
- * Wait for the process to exit, streams can still emit data.
61
- */
62
- get onExit() {
63
- return this.exitEmitter.event;
64
- }
65
- get onError() {
66
- return this.errorEmitter.event;
67
- }
68
- /**
69
- * Waits for both process exit and for all the streams to be closed.
70
- */
71
- get onClose() {
72
- return this.closeEmitter.event;
73
- }
74
- emitOnStarted() {
75
- this.startEmitter.fire({});
76
- }
77
- /**
78
- * Emit the onExit event for this process. Only one of code and signal
79
- * should be defined.
80
- */
81
- emitOnExit(code, signal) {
82
- const exitEvent = { code, signal };
83
- this.handleOnExit(exitEvent);
84
- this.exitEmitter.fire(exitEvent);
85
- }
86
- /**
87
- * Emit the onClose event for this process. Only one of code and signal
88
- * should be defined.
89
- */
90
- emitOnClose(code, signal) {
91
- this.closeEmitter.fire({ code, signal });
92
- }
93
- handleOnExit(event) {
94
- this._killed = true;
95
- const signalSuffix = event.signal ? `, signal: ${event.signal}` : '';
96
- const executable = this.isForkOptions(this.options) ? this.options.modulePath : this.options.command;
97
- this.logger.debug(`Process ${this.pid} has exited with code ${event.code}${signalSuffix}.`, executable, this.options.args);
98
- }
99
- emitOnError(err) {
100
- this.handleOnError(err);
101
- this.errorEmitter.fire(err);
102
- }
103
- async emitOnErrorAsync(error) {
104
- process.nextTick(this.emitOnError.bind(this), error);
105
- }
106
- handleOnError(error) {
107
- this._killed = true;
108
- this.logger.error(error);
109
- }
110
- isForkOptions(options) {
111
- return (0, common_1.isObject)(options) && !!options.modulePath;
112
- }
113
- /**
114
- * @returns the current working directory as a URI (usually file:// URI)
115
- */
116
- getCwdURI() {
117
- if (core_1.isOSX) {
118
- return new Promise(resolve => {
119
- (0, child_process_1.exec)('lsof -OPln -p ' + this.pid + ' | grep cwd', (error, stdout, stderr) => {
120
- if (stdout !== '') {
121
- resolve(node_1.FileUri.create(stdout.substring(stdout.indexOf('/'), stdout.length - 1)).toString());
122
- }
123
- else {
124
- resolve(node_1.FileUri.create(this.initialCwd).toString());
125
- }
126
- });
127
- });
128
- }
129
- else if (!core_1.isWindows) {
130
- return new Promise(resolve => {
131
- fs.readlink('/proc/' + this.pid + '/cwd', (err, linkedstr) => {
132
- if (err || !linkedstr) {
133
- resolve(node_1.FileUri.create(this.initialCwd).toString());
134
- }
135
- else {
136
- resolve(node_1.FileUri.create(linkedstr).toString());
137
- }
138
- });
139
- });
140
- }
141
- else {
142
- return new Promise(resolve => {
143
- resolve(node_1.FileUri.create(this.initialCwd).toString());
144
- });
145
- }
146
- }
147
- };
148
- Process = __decorate([
149
- (0, inversify_1.injectable)(),
150
- __param(2, (0, inversify_1.unmanaged)()),
151
- __metadata("design:paramtypes", [Object, Object, Number, Object])
152
- ], Process);
153
- exports.Process = Process;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
27
+ return function (target, key) { decorator(target, key, paramIndex); }
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.Process = exports.ProcessType = void 0;
31
+ const inversify_1 = require("@theia/core/shared/inversify");
32
+ const common_1 = require("@theia/core/lib/common");
33
+ const node_1 = require("@theia/core/lib/node");
34
+ const core_1 = require("@theia/core");
35
+ const child_process_1 = require("child_process");
36
+ const fs = require("fs");
37
+ const process_manager_types_1 = require("../common/process-manager-types");
38
+ Object.defineProperty(exports, "ProcessType", { enumerable: true, get: function () { return process_manager_types_1.ProcessType; } });
39
+ let Process = class Process {
40
+ constructor(processManager, logger, type, options) {
41
+ this.processManager = processManager;
42
+ this.logger = logger;
43
+ this.type = type;
44
+ this.options = options;
45
+ this.startEmitter = new common_1.Emitter();
46
+ this.exitEmitter = new common_1.Emitter();
47
+ this.closeEmitter = new common_1.Emitter();
48
+ this.errorEmitter = new common_1.Emitter();
49
+ this._killed = false;
50
+ this.id = this.processManager.register(this);
51
+ this.initialCwd = options && options.options && 'cwd' in options.options && options.options['cwd'].toString() || __dirname;
52
+ }
53
+ get killed() {
54
+ return this._killed;
55
+ }
56
+ get onStart() {
57
+ return this.startEmitter.event;
58
+ }
59
+ /**
60
+ * Wait for the process to exit, streams can still emit data.
61
+ */
62
+ get onExit() {
63
+ return this.exitEmitter.event;
64
+ }
65
+ get onError() {
66
+ return this.errorEmitter.event;
67
+ }
68
+ /**
69
+ * Waits for both process exit and for all the streams to be closed.
70
+ */
71
+ get onClose() {
72
+ return this.closeEmitter.event;
73
+ }
74
+ emitOnStarted() {
75
+ this.startEmitter.fire({});
76
+ }
77
+ /**
78
+ * Emit the onExit event for this process. Only one of code and signal
79
+ * should be defined.
80
+ */
81
+ emitOnExit(code, signal) {
82
+ const exitEvent = { code, signal };
83
+ this.handleOnExit(exitEvent);
84
+ this.exitEmitter.fire(exitEvent);
85
+ }
86
+ /**
87
+ * Emit the onClose event for this process. Only one of code and signal
88
+ * should be defined.
89
+ */
90
+ emitOnClose(code, signal) {
91
+ this.closeEmitter.fire({ code, signal });
92
+ }
93
+ handleOnExit(event) {
94
+ this._killed = true;
95
+ const signalSuffix = event.signal ? `, signal: ${event.signal}` : '';
96
+ const executable = this.isForkOptions(this.options) ? this.options.modulePath : this.options.command;
97
+ this.logger.debug(`Process ${this.pid} has exited with code ${event.code}${signalSuffix}.`, executable, this.options.args);
98
+ }
99
+ emitOnError(err) {
100
+ this.handleOnError(err);
101
+ this.errorEmitter.fire(err);
102
+ }
103
+ async emitOnErrorAsync(error) {
104
+ process.nextTick(this.emitOnError.bind(this), error);
105
+ }
106
+ handleOnError(error) {
107
+ this._killed = true;
108
+ this.logger.error(error);
109
+ }
110
+ isForkOptions(options) {
111
+ return (0, common_1.isObject)(options) && !!options.modulePath;
112
+ }
113
+ /**
114
+ * @returns the current working directory as a URI (usually file:// URI)
115
+ */
116
+ getCwdURI() {
117
+ if (core_1.isOSX) {
118
+ return new Promise(resolve => {
119
+ (0, child_process_1.exec)('lsof -OPln -p ' + this.pid + ' | grep cwd', (error, stdout, stderr) => {
120
+ if (stdout !== '') {
121
+ resolve(node_1.FileUri.create(stdout.substring(stdout.indexOf('/'), stdout.length - 1)).toString());
122
+ }
123
+ else {
124
+ resolve(node_1.FileUri.create(this.initialCwd).toString());
125
+ }
126
+ });
127
+ });
128
+ }
129
+ else if (!core_1.isWindows) {
130
+ return new Promise(resolve => {
131
+ fs.readlink('/proc/' + this.pid + '/cwd', (err, linkedstr) => {
132
+ if (err || !linkedstr) {
133
+ resolve(node_1.FileUri.create(this.initialCwd).toString());
134
+ }
135
+ else {
136
+ resolve(node_1.FileUri.create(linkedstr).toString());
137
+ }
138
+ });
139
+ });
140
+ }
141
+ else {
142
+ return new Promise(resolve => {
143
+ resolve(node_1.FileUri.create(this.initialCwd).toString());
144
+ });
145
+ }
146
+ }
147
+ };
148
+ Process = __decorate([
149
+ (0, inversify_1.injectable)(),
150
+ __param(2, (0, inversify_1.unmanaged)()),
151
+ __metadata("design:paramtypes", [Object, Object, Number, Object])
152
+ ], Process);
153
+ exports.Process = Process;
154
154
  //# sourceMappingURL=process.js.map
@@ -1,23 +1,23 @@
1
- import { IPty } from 'node-pty';
2
- import { Event } from '@theia/core';
3
- export declare class PseudoPty implements IPty {
4
- readonly pid: number;
5
- readonly cols: number;
6
- readonly rows: number;
7
- readonly process: string;
8
- handleFlowControl: boolean;
9
- readonly onData: Event<string>;
10
- readonly onExit: Event<{
11
- exitCode: number;
12
- signal?: number;
13
- }>;
14
- on(event: string, listener: (data: string) => void): void;
15
- on(event: string, listener: (exitCode: number, signal?: number) => void): void;
16
- on(event: string, listener: (error?: string) => void): void;
17
- resize(columns: number, rows: number): void;
18
- write(data: string): void;
19
- kill(signal?: string): void;
20
- pause(): void;
21
- resume(): void;
22
- }
1
+ import { IPty } from 'node-pty';
2
+ import { Event } from '@theia/core';
3
+ export declare class PseudoPty implements IPty {
4
+ readonly pid: number;
5
+ readonly cols: number;
6
+ readonly rows: number;
7
+ readonly process: string;
8
+ handleFlowControl: boolean;
9
+ readonly onData: Event<string>;
10
+ readonly onExit: Event<{
11
+ exitCode: number;
12
+ signal?: number;
13
+ }>;
14
+ on(event: string, listener: (data: string) => void): void;
15
+ on(event: string, listener: (exitCode: number, signal?: number) => void): void;
16
+ on(event: string, listener: (error?: string) => void): void;
17
+ resize(columns: number, rows: number): void;
18
+ write(data: string): void;
19
+ kill(signal?: string): void;
20
+ pause(): void;
21
+ resume(): void;
22
+ }
23
23
  //# sourceMappingURL=pseudo-pty.d.ts.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2020 Alibaba Inc. and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.PseudoPty = void 0;
19
- const core_1 = require("@theia/core");
20
- class PseudoPty {
21
- constructor() {
22
- this.pid = -1;
23
- this.cols = -1;
24
- this.rows = -1;
25
- this.process = '';
26
- this.handleFlowControl = false;
27
- this.onData = core_1.Event.None;
28
- this.onExit = core_1.Event.None;
29
- }
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
- on(event, listener) { }
32
- resize(columns, rows) { }
33
- write(data) { }
34
- kill(signal) { }
35
- pause() { }
36
- resume() { }
37
- }
38
- exports.PseudoPty = PseudoPty;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2020 Alibaba Inc. and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PseudoPty = void 0;
19
+ const core_1 = require("@theia/core");
20
+ class PseudoPty {
21
+ constructor() {
22
+ this.pid = -1;
23
+ this.cols = -1;
24
+ this.rows = -1;
25
+ this.process = '';
26
+ this.handleFlowControl = false;
27
+ this.onData = core_1.Event.None;
28
+ this.onExit = core_1.Event.None;
29
+ }
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ on(event, listener) { }
32
+ resize(columns, rows) { }
33
+ write(data) { }
34
+ kill(signal) { }
35
+ pause() { }
36
+ resume() { }
37
+ }
38
+ exports.PseudoPty = PseudoPty;
39
39
  //# sourceMappingURL=pseudo-pty.js.map
@@ -1,46 +1,46 @@
1
- /// <reference types="node" />
2
- import { ProcessManager } from './process-manager';
3
- import { ILogger } from '@theia/core/lib/common';
4
- import { Process, ProcessOptions, ForkOptions } from './process';
5
- import { ChildProcess } from 'child_process';
6
- import * as stream from 'stream';
7
- export { DevNullStream } from './dev-null-stream';
8
- export declare const RawProcessOptions: unique symbol;
9
- /**
10
- * Options to spawn a new process (`spawn`).
11
- *
12
- * For more information please refer to the spawn function of Node's
13
- * child_process module:
14
- *
15
- * https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
16
- */
17
- export interface RawProcessOptions extends ProcessOptions {
18
- }
19
- /**
20
- * Options to fork a new process using the current Node interpreter (`fork`).
21
- *
22
- * For more information please refer to the fork function of Node's
23
- * `child_process` module:
24
- *
25
- * https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options
26
- */
27
- export interface RawForkOptions extends ForkOptions {
28
- }
29
- export declare const RawProcessFactory: unique symbol;
30
- export interface RawProcessFactory {
31
- (options: RawProcessOptions | RawForkOptions): RawProcess;
32
- }
33
- export declare class RawProcess extends Process {
34
- /**
35
- * If the process fails to launch, it will be undefined.
36
- */
37
- readonly process: ChildProcess | undefined;
38
- readonly outputStream: stream.Readable;
39
- readonly errorStream: stream.Readable;
40
- readonly inputStream: stream.Writable;
41
- constructor(// eslint-disable-next-line @typescript-eslint/indent
42
- options: RawProcessOptions | RawForkOptions, processManager: ProcessManager, logger: ILogger);
43
- get pid(): number;
44
- kill(signal?: string): void;
45
- }
1
+ /// <reference types="node" />
2
+ import { ProcessManager } from './process-manager';
3
+ import { ILogger } from '@theia/core/lib/common';
4
+ import { Process, ProcessOptions, ForkOptions } from './process';
5
+ import { ChildProcess } from 'child_process';
6
+ import * as stream from 'stream';
7
+ export { DevNullStream } from './dev-null-stream';
8
+ export declare const RawProcessOptions: unique symbol;
9
+ /**
10
+ * Options to spawn a new process (`spawn`).
11
+ *
12
+ * For more information please refer to the spawn function of Node's
13
+ * child_process module:
14
+ *
15
+ * https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
16
+ */
17
+ export interface RawProcessOptions extends ProcessOptions {
18
+ }
19
+ /**
20
+ * Options to fork a new process using the current Node interpreter (`fork`).
21
+ *
22
+ * For more information please refer to the fork function of Node's
23
+ * `child_process` module:
24
+ *
25
+ * https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options
26
+ */
27
+ export interface RawForkOptions extends ForkOptions {
28
+ }
29
+ export declare const RawProcessFactory: unique symbol;
30
+ export interface RawProcessFactory {
31
+ (options: RawProcessOptions | RawForkOptions): RawProcess;
32
+ }
33
+ export declare class RawProcess extends Process {
34
+ /**
35
+ * If the process fails to launch, it will be undefined.
36
+ */
37
+ readonly process: ChildProcess | undefined;
38
+ readonly outputStream: stream.Readable;
39
+ readonly errorStream: stream.Readable;
40
+ readonly inputStream: stream.Writable;
41
+ constructor(// eslint-disable-next-line @typescript-eslint/indent
42
+ options: RawProcessOptions | RawForkOptions, processManager: ProcessManager, logger: ILogger);
43
+ get pid(): number;
44
+ kill(signal?: string): void;
45
+ }
46
46
  //# sourceMappingURL=raw-process.d.ts.map