@types/node 14.18.61 → 14.18.63
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.
- node v14.18/README.md +1 -1
- node v14.18/assert.d.ts +33 -31
- node v14.18/async_hooks.d.ts +27 -20
- node v14.18/buffer.d.ts +4 -4
- node v14.18/child_process.d.ts +191 -62
- node v14.18/cluster.d.ts +59 -28
- node v14.18/console.d.ts +6 -6
- node v14.18/constants.d.ts +12 -11
- node v14.18/crypto.d.ts +232 -228
- node v14.18/dgram.d.ts +50 -14
- node v14.18/dns.d.ts +183 -54
- node v14.18/domain.d.ts +4 -4
- node v14.18/events.d.ts +4 -4
- node v14.18/fs/promises.d.ts +87 -25
- node v14.18/fs.d.ts +404 -104
- node v14.18/globals.d.ts +33 -16
- node v14.18/http.d.ts +201 -201
- node v14.18/http2.d.ts +340 -93
- node v14.18/https.d.ts +107 -105
- node v14.18/inspector.d.ts +4 -4
- node v14.18/module.d.ts +4 -4
- node v14.18/net.d.ts +27 -12
- node v14.18/os.d.ts +4 -4
- node v14.18/package.json +2 -2
- node v14.18/path.d.ts +5 -5
- node v14.18/perf_hooks.d.ts +5 -5
- node v14.18/process.d.ts +61 -22
- node v14.18/punycode.d.ts +3 -3
- node v14.18/querystring.d.ts +15 -5
- node v14.18/readline.d.ts +16 -6
- node v14.18/repl.d.ts +13 -7
- node v14.18/stream.d.ts +160 -100
- node v14.18/string_decoder.d.ts +3 -3
- node v14.18/timers.d.ts +3 -3
- node v14.18/tls.d.ts +109 -27
- node v14.18/trace_events.d.ts +3 -3
- node v14.18/ts4.8/assert.d.ts +33 -31
- node v14.18/ts4.8/async_hooks.d.ts +27 -20
- node v14.18/ts4.8/buffer.d.ts +4 -4
- node v14.18/ts4.8/child_process.d.ts +191 -62
- node v14.18/ts4.8/cluster.d.ts +59 -28
- node v14.18/ts4.8/console.d.ts +6 -6
- node v14.18/ts4.8/constants.d.ts +12 -11
- node v14.18/ts4.8/crypto.d.ts +232 -228
- node v14.18/ts4.8/dgram.d.ts +50 -14
- node v14.18/ts4.8/dns.d.ts +183 -54
- node v14.18/ts4.8/domain.d.ts +4 -4
- node v14.18/ts4.8/events.d.ts +4 -4
- node v14.18/ts4.8/fs/promises.d.ts +87 -25
- node v14.18/ts4.8/fs.d.ts +404 -104
- node v14.18/ts4.8/globals.d.ts +33 -16
- node v14.18/ts4.8/http.d.ts +200 -200
- node v14.18/ts4.8/http2.d.ts +340 -93
- node v14.18/ts4.8/https.d.ts +107 -105
- node v14.18/ts4.8/inspector.d.ts +4 -4
- node v14.18/ts4.8/module.d.ts +4 -4
- node v14.18/ts4.8/net.d.ts +27 -12
- node v14.18/ts4.8/os.d.ts +4 -4
- node v14.18/ts4.8/path.d.ts +5 -5
- node v14.18/ts4.8/perf_hooks.d.ts +5 -5
- node v14.18/ts4.8/process.d.ts +61 -22
- node v14.18/ts4.8/punycode.d.ts +3 -3
- node v14.18/ts4.8/querystring.d.ts +15 -5
- node v14.18/ts4.8/readline.d.ts +16 -6
- node v14.18/ts4.8/repl.d.ts +13 -7
- node v14.18/ts4.8/stream.d.ts +160 -100
- node v14.18/ts4.8/string_decoder.d.ts +3 -3
- node v14.18/ts4.8/timers.d.ts +3 -3
- node v14.18/ts4.8/tls.d.ts +109 -27
- node v14.18/ts4.8/trace_events.d.ts +3 -3
- node v14.18/ts4.8/tty.d.ts +4 -4
- node v14.18/ts4.8/url.d.ts +21 -12
- node v14.18/ts4.8/util.d.ts +102 -40
- node v14.18/ts4.8/v8.d.ts +4 -5
- node v14.18/ts4.8/vm.d.ts +7 -7
- node v14.18/ts4.8/wasi.d.ts +3 -4
- node v14.18/ts4.8/worker_threads.d.ts +8 -8
- node v14.18/ts4.8/zlib.d.ts +13 -13
- node v14.18/tty.d.ts +4 -4
- node v14.18/url.d.ts +21 -12
- node v14.18/util.d.ts +102 -40
- node v14.18/v8.d.ts +4 -5
- node v14.18/vm.d.ts +7 -7
- node v14.18/wasi.d.ts +3 -4
- node v14.18/worker_threads.d.ts +8 -8
- node v14.18/zlib.d.ts +13 -13
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import { BaseEncodingOptions } from
|
|
3
|
-
import * as events from
|
|
4
|
-
import * as net from
|
|
5
|
-
import {
|
|
1
|
+
declare module "child_process" {
|
|
2
|
+
import { BaseEncodingOptions } from "fs";
|
|
3
|
+
import * as events from "events";
|
|
4
|
+
import * as net from "net";
|
|
5
|
+
import { Pipe, Readable, Stream, Writable } from "stream";
|
|
6
6
|
|
|
7
7
|
type Serializable = string | object | number | boolean;
|
|
8
8
|
type SendHandle = net.Socket | net.Server;
|
|
@@ -17,7 +17,7 @@ declare module 'node:child_process' {
|
|
|
17
17
|
Readable | null, // stdout
|
|
18
18
|
Readable | null, // stderr
|
|
19
19
|
Readable | Writable | null | undefined, // extra
|
|
20
|
-
Readable | Writable | null | undefined // extra
|
|
20
|
+
Readable | Writable | null | undefined, // extra
|
|
21
21
|
];
|
|
22
22
|
readonly killed: boolean;
|
|
23
23
|
readonly pid: number;
|
|
@@ -29,7 +29,12 @@ declare module 'node:child_process' {
|
|
|
29
29
|
kill(signal?: NodeJS.Signals | number): boolean;
|
|
30
30
|
send(message: Serializable, callback?: (error: Error | null) => void): boolean;
|
|
31
31
|
send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
|
|
32
|
-
send(
|
|
32
|
+
send(
|
|
33
|
+
message: Serializable,
|
|
34
|
+
sendHandle?: SendHandle,
|
|
35
|
+
options?: MessageOptions,
|
|
36
|
+
callback?: (error: Error | null) => void,
|
|
37
|
+
): boolean;
|
|
33
38
|
disconnect(): void;
|
|
34
39
|
unref(): void;
|
|
35
40
|
ref(): void;
|
|
@@ -79,10 +84,16 @@ declare module 'node:child_process' {
|
|
|
79
84
|
prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
80
85
|
|
|
81
86
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
82
|
-
prependOnceListener(
|
|
87
|
+
prependOnceListener(
|
|
88
|
+
event: "close",
|
|
89
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
90
|
+
): this;
|
|
83
91
|
prependOnceListener(event: "disconnect", listener: () => void): this;
|
|
84
92
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
85
|
-
prependOnceListener(
|
|
93
|
+
prependOnceListener(
|
|
94
|
+
event: "exit",
|
|
95
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
96
|
+
): this;
|
|
86
97
|
prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
87
98
|
}
|
|
88
99
|
|
|
@@ -96,7 +107,7 @@ declare module 'node:child_process' {
|
|
|
96
107
|
Readable, // stdout
|
|
97
108
|
Readable, // stderr
|
|
98
109
|
Readable | Writable | null | undefined, // extra, no modification
|
|
99
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
110
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
100
111
|
];
|
|
101
112
|
}
|
|
102
113
|
|
|
@@ -114,7 +125,7 @@ declare module 'node:child_process' {
|
|
|
114
125
|
O,
|
|
115
126
|
E,
|
|
116
127
|
Readable | Writable | null | undefined, // extra, no modification
|
|
117
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
128
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
118
129
|
];
|
|
119
130
|
}
|
|
120
131
|
|
|
@@ -122,9 +133,13 @@ declare module 'node:child_process' {
|
|
|
122
133
|
keepOpen?: boolean | undefined;
|
|
123
134
|
}
|
|
124
135
|
|
|
125
|
-
type StdioOptions =
|
|
136
|
+
type StdioOptions =
|
|
137
|
+
| "pipe"
|
|
138
|
+
| "ignore"
|
|
139
|
+
| "inherit"
|
|
140
|
+
| Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>;
|
|
126
141
|
|
|
127
|
-
type SerializationType =
|
|
142
|
+
type SerializationType = "json" | "advanced";
|
|
128
143
|
|
|
129
144
|
interface MessagingOptions {
|
|
130
145
|
/**
|
|
@@ -173,11 +188,11 @@ declare module 'node:child_process' {
|
|
|
173
188
|
}
|
|
174
189
|
|
|
175
190
|
interface SpawnOptionsWithoutStdio extends SpawnOptions {
|
|
176
|
-
stdio?:
|
|
191
|
+
stdio?: "pipe" | Array<null | undefined | "pipe"> | undefined;
|
|
177
192
|
}
|
|
178
193
|
|
|
179
|
-
type StdioNull =
|
|
180
|
-
type StdioPipe = undefined | null |
|
|
194
|
+
type StdioNull = "inherit" | "ignore" | Stream;
|
|
195
|
+
type StdioPipe = undefined | null | "pipe";
|
|
181
196
|
|
|
182
197
|
interface SpawnOptionsWithStdioTuple<
|
|
183
198
|
Stdin extends StdioNull | StdioPipe,
|
|
@@ -226,7 +241,11 @@ declare module 'node:child_process' {
|
|
|
226
241
|
function spawn(command: string, options: SpawnOptions): ChildProcess;
|
|
227
242
|
|
|
228
243
|
// overloads of spawn with 'args'
|
|
229
|
-
function spawn(
|
|
244
|
+
function spawn(
|
|
245
|
+
command: string,
|
|
246
|
+
args?: ReadonlyArray<string>,
|
|
247
|
+
options?: SpawnOptionsWithoutStdio,
|
|
248
|
+
): ChildProcessWithoutNullStreams;
|
|
230
249
|
|
|
231
250
|
function spawn(
|
|
232
251
|
command: string,
|
|
@@ -293,13 +312,24 @@ declare module 'node:child_process' {
|
|
|
293
312
|
}
|
|
294
313
|
|
|
295
314
|
// no `options` definitely means stdout/stderr are `string`.
|
|
296
|
-
function exec(
|
|
315
|
+
function exec(
|
|
316
|
+
command: string,
|
|
317
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
318
|
+
): ChildProcess;
|
|
297
319
|
|
|
298
320
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
299
|
-
function exec(
|
|
321
|
+
function exec(
|
|
322
|
+
command: string,
|
|
323
|
+
options: { encoding: "buffer" | null } & ExecOptions,
|
|
324
|
+
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
325
|
+
): ChildProcess;
|
|
300
326
|
|
|
301
327
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
302
|
-
function exec(
|
|
328
|
+
function exec(
|
|
329
|
+
command: string,
|
|
330
|
+
options: { encoding: BufferEncoding } & ExecOptions,
|
|
331
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
332
|
+
): ChildProcess;
|
|
303
333
|
|
|
304
334
|
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
305
335
|
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
@@ -310,7 +340,11 @@ declare module 'node:child_process' {
|
|
|
310
340
|
): ChildProcess;
|
|
311
341
|
|
|
312
342
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
313
|
-
function exec(
|
|
343
|
+
function exec(
|
|
344
|
+
command: string,
|
|
345
|
+
options: ExecOptions,
|
|
346
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
347
|
+
): ChildProcess;
|
|
314
348
|
|
|
315
349
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
316
350
|
function exec(
|
|
@@ -325,11 +359,23 @@ declare module 'node:child_process' {
|
|
|
325
359
|
|
|
326
360
|
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
|
327
361
|
namespace exec {
|
|
328
|
-
function __promisify__(command: string): PromiseWithChild<{ stdout: string
|
|
329
|
-
function __promisify__(
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
362
|
+
function __promisify__(command: string): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
363
|
+
function __promisify__(
|
|
364
|
+
command: string,
|
|
365
|
+
options: { encoding: "buffer" | null } & ExecOptions,
|
|
366
|
+
): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
|
|
367
|
+
function __promisify__(
|
|
368
|
+
command: string,
|
|
369
|
+
options: { encoding: BufferEncoding } & ExecOptions,
|
|
370
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
371
|
+
function __promisify__(
|
|
372
|
+
command: string,
|
|
373
|
+
options: ExecOptions,
|
|
374
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
375
|
+
function __promisify__(
|
|
376
|
+
command: string,
|
|
377
|
+
options?: (BaseEncodingOptions & ExecOptions) | null,
|
|
378
|
+
): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
|
|
333
379
|
}
|
|
334
380
|
|
|
335
381
|
interface ExecFileOptions extends CommonOptions {
|
|
@@ -342,27 +388,42 @@ declare module 'node:child_process' {
|
|
|
342
388
|
encoding: BufferEncoding;
|
|
343
389
|
}
|
|
344
390
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
|
345
|
-
encoding:
|
|
391
|
+
encoding: "buffer" | null;
|
|
346
392
|
}
|
|
347
393
|
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
|
348
394
|
encoding: BufferEncoding;
|
|
349
395
|
}
|
|
350
396
|
type ExecFileException =
|
|
351
|
-
& Omit<ExecException,
|
|
352
|
-
& Omit<NodeJS.ErrnoException,
|
|
397
|
+
& Omit<ExecException, "code">
|
|
398
|
+
& Omit<NodeJS.ErrnoException, "code">
|
|
353
399
|
& { code?: string | number | undefined | null };
|
|
354
400
|
|
|
355
401
|
function execFile(file: string): ChildProcess;
|
|
356
402
|
function execFile(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
|
|
357
403
|
function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
|
|
358
|
-
function execFile(
|
|
404
|
+
function execFile(
|
|
405
|
+
file: string,
|
|
406
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
407
|
+
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
|
408
|
+
): ChildProcess;
|
|
359
409
|
|
|
360
410
|
// no `options` definitely means stdout/stderr are `string`.
|
|
361
|
-
function execFile(
|
|
362
|
-
|
|
411
|
+
function execFile(
|
|
412
|
+
file: string,
|
|
413
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
414
|
+
): ChildProcess;
|
|
415
|
+
function execFile(
|
|
416
|
+
file: string,
|
|
417
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
418
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
419
|
+
): ChildProcess;
|
|
363
420
|
|
|
364
421
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
365
|
-
function execFile(
|
|
422
|
+
function execFile(
|
|
423
|
+
file: string,
|
|
424
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
425
|
+
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
426
|
+
): ChildProcess;
|
|
366
427
|
function execFile(
|
|
367
428
|
file: string,
|
|
368
429
|
args: ReadonlyArray<string> | undefined | null,
|
|
@@ -371,7 +432,11 @@ declare module 'node:child_process' {
|
|
|
371
432
|
): ChildProcess;
|
|
372
433
|
|
|
373
434
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
374
|
-
function execFile(
|
|
435
|
+
function execFile(
|
|
436
|
+
file: string,
|
|
437
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
438
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
439
|
+
): ChildProcess;
|
|
375
440
|
function execFile(
|
|
376
441
|
file: string,
|
|
377
442
|
args: ReadonlyArray<string> | undefined | null,
|
|
@@ -394,49 +459,89 @@ declare module 'node:child_process' {
|
|
|
394
459
|
): ChildProcess;
|
|
395
460
|
|
|
396
461
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
397
|
-
function execFile(
|
|
462
|
+
function execFile(
|
|
463
|
+
file: string,
|
|
464
|
+
options: ExecFileOptions,
|
|
465
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
466
|
+
): ChildProcess;
|
|
398
467
|
function execFile(
|
|
399
468
|
file: string,
|
|
400
469
|
args: ReadonlyArray<string> | undefined | null,
|
|
401
470
|
options: ExecFileOptions,
|
|
402
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
|
|
471
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
403
472
|
): ChildProcess;
|
|
404
473
|
|
|
405
474
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
406
475
|
function execFile(
|
|
407
476
|
file: string,
|
|
408
477
|
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
|
409
|
-
callback:
|
|
478
|
+
callback:
|
|
479
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
480
|
+
| undefined
|
|
481
|
+
| null,
|
|
410
482
|
): ChildProcess;
|
|
411
483
|
function execFile(
|
|
412
484
|
file: string,
|
|
413
485
|
args: ReadonlyArray<string> | undefined | null,
|
|
414
486
|
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
|
415
|
-
callback:
|
|
487
|
+
callback:
|
|
488
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
489
|
+
| undefined
|
|
490
|
+
| null,
|
|
416
491
|
): ChildProcess;
|
|
417
492
|
|
|
418
493
|
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
|
419
494
|
namespace execFile {
|
|
420
|
-
function __promisify__(file: string): PromiseWithChild<{ stdout: string
|
|
421
|
-
function __promisify__(
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
function __promisify__(
|
|
426
|
-
|
|
495
|
+
function __promisify__(file: string): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
496
|
+
function __promisify__(
|
|
497
|
+
file: string,
|
|
498
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
499
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
500
|
+
function __promisify__(
|
|
501
|
+
file: string,
|
|
502
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
503
|
+
): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
|
|
504
|
+
function __promisify__(
|
|
505
|
+
file: string,
|
|
506
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
507
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
508
|
+
): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
|
|
509
|
+
function __promisify__(
|
|
510
|
+
file: string,
|
|
511
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
512
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
513
|
+
function __promisify__(
|
|
514
|
+
file: string,
|
|
515
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
516
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
517
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
518
|
+
function __promisify__(
|
|
519
|
+
file: string,
|
|
520
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
521
|
+
): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
|
|
427
522
|
function __promisify__(
|
|
428
523
|
file: string,
|
|
429
524
|
args: ReadonlyArray<string> | undefined | null,
|
|
430
525
|
options: ExecFileOptionsWithOtherEncoding,
|
|
431
|
-
): PromiseWithChild<{ stdout: string | Buffer
|
|
432
|
-
function __promisify__(
|
|
433
|
-
|
|
434
|
-
|
|
526
|
+
): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
|
|
527
|
+
function __promisify__(
|
|
528
|
+
file: string,
|
|
529
|
+
options: ExecFileOptions,
|
|
530
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
435
531
|
function __promisify__(
|
|
436
532
|
file: string,
|
|
437
533
|
args: ReadonlyArray<string> | undefined | null,
|
|
534
|
+
options: ExecFileOptions,
|
|
535
|
+
): PromiseWithChild<{ stdout: string; stderr: string }>;
|
|
536
|
+
function __promisify__(
|
|
537
|
+
file: string,
|
|
438
538
|
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
|
439
|
-
): PromiseWithChild<{ stdout: string | Buffer
|
|
539
|
+
): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
|
|
540
|
+
function __promisify__(
|
|
541
|
+
file: string,
|
|
542
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
543
|
+
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
|
544
|
+
): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
|
|
440
545
|
}
|
|
441
546
|
|
|
442
547
|
interface ForkOptions extends ProcessEnvOptions, MessagingOptions {
|
|
@@ -463,13 +568,13 @@ declare module 'node:child_process' {
|
|
|
463
568
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
464
569
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
465
570
|
maxBuffer?: number | undefined;
|
|
466
|
-
encoding?: BufferEncoding |
|
|
571
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
467
572
|
}
|
|
468
573
|
interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
|
469
574
|
encoding: BufferEncoding;
|
|
470
575
|
}
|
|
471
576
|
interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
|
472
|
-
encoding?:
|
|
577
|
+
encoding?: "buffer" | null | undefined;
|
|
473
578
|
}
|
|
474
579
|
interface SpawnSyncReturns<T> {
|
|
475
580
|
pid: number;
|
|
@@ -484,9 +589,21 @@ declare module 'node:child_process' {
|
|
|
484
589
|
function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
|
485
590
|
function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
|
486
591
|
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
|
|
487
|
-
function spawnSync(
|
|
488
|
-
|
|
489
|
-
|
|
592
|
+
function spawnSync(
|
|
593
|
+
command: string,
|
|
594
|
+
args?: ReadonlyArray<string>,
|
|
595
|
+
options?: SpawnSyncOptionsWithStringEncoding,
|
|
596
|
+
): SpawnSyncReturns<string>;
|
|
597
|
+
function spawnSync(
|
|
598
|
+
command: string,
|
|
599
|
+
args?: ReadonlyArray<string>,
|
|
600
|
+
options?: SpawnSyncOptionsWithBufferEncoding,
|
|
601
|
+
): SpawnSyncReturns<Buffer>;
|
|
602
|
+
function spawnSync(
|
|
603
|
+
command: string,
|
|
604
|
+
args?: ReadonlyArray<string>,
|
|
605
|
+
options?: SpawnSyncOptions,
|
|
606
|
+
): SpawnSyncReturns<string | Buffer>;
|
|
490
607
|
|
|
491
608
|
interface ExecSyncOptions extends CommonOptions {
|
|
492
609
|
input?: string | Uint8Array | undefined;
|
|
@@ -503,13 +620,13 @@ declare module 'node:child_process' {
|
|
|
503
620
|
shell?: string | undefined;
|
|
504
621
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
505
622
|
maxBuffer?: number | undefined;
|
|
506
|
-
encoding?: BufferEncoding |
|
|
623
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
507
624
|
}
|
|
508
625
|
interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
|
|
509
626
|
encoding: BufferEncoding;
|
|
510
627
|
}
|
|
511
628
|
interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
|
512
|
-
encoding?:
|
|
629
|
+
encoding?: "buffer" | null | undefined;
|
|
513
630
|
}
|
|
514
631
|
function execSync(command: string): Buffer;
|
|
515
632
|
function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
|
|
@@ -544,10 +661,22 @@ declare module 'node:child_process' {
|
|
|
544
661
|
function execFileSync(command: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
|
545
662
|
function execFileSync(command: string, options?: ExecFileSyncOptions): string | Buffer;
|
|
546
663
|
function execFileSync(command: string, args: ReadonlyArray<string>): Buffer;
|
|
547
|
-
function execFileSync(
|
|
548
|
-
|
|
549
|
-
|
|
664
|
+
function execFileSync(
|
|
665
|
+
command: string,
|
|
666
|
+
args: ReadonlyArray<string>,
|
|
667
|
+
options: ExecFileSyncOptionsWithStringEncoding,
|
|
668
|
+
): string;
|
|
669
|
+
function execFileSync(
|
|
670
|
+
command: string,
|
|
671
|
+
args: ReadonlyArray<string>,
|
|
672
|
+
options: ExecFileSyncOptionsWithBufferEncoding,
|
|
673
|
+
): Buffer;
|
|
674
|
+
function execFileSync(
|
|
675
|
+
command: string,
|
|
676
|
+
args?: ReadonlyArray<string>,
|
|
677
|
+
options?: ExecFileSyncOptions,
|
|
678
|
+
): string | Buffer;
|
|
550
679
|
}
|
|
551
|
-
declare module
|
|
552
|
-
export * from
|
|
680
|
+
declare module "node:child_process" {
|
|
681
|
+
export * from "child_process";
|
|
553
682
|
}
|
node v14.18/ts4.8/cluster.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import * as child from
|
|
3
|
-
import EventEmitter = require(
|
|
4
|
-
import * as net from
|
|
1
|
+
declare module "cluster" {
|
|
2
|
+
import * as child from "child_process";
|
|
3
|
+
import EventEmitter = require("events");
|
|
4
|
+
import * as net from "net";
|
|
5
5
|
|
|
6
6
|
// interfaces
|
|
7
|
-
type SerializationType =
|
|
7
|
+
type SerializationType = "json" | "advanced";
|
|
8
8
|
interface ClusterSettings {
|
|
9
9
|
execArgv?: string[] | undefined; // default: process.execArgv
|
|
10
10
|
exec?: string | undefined;
|
|
@@ -22,13 +22,17 @@ declare module 'node:cluster' {
|
|
|
22
22
|
interface Address {
|
|
23
23
|
address: string;
|
|
24
24
|
port: number;
|
|
25
|
-
addressType: number | "udp4" | "udp6";
|
|
25
|
+
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
class Worker extends EventEmitter {
|
|
29
29
|
id: number;
|
|
30
30
|
process: child.ChildProcess;
|
|
31
|
-
send(
|
|
31
|
+
send(
|
|
32
|
+
message: child.Serializable,
|
|
33
|
+
sendHandle?: child.SendHandle,
|
|
34
|
+
callback?: (error: Error | null) => void,
|
|
35
|
+
): boolean;
|
|
32
36
|
kill(signal?: string): void;
|
|
33
37
|
destroy(signal?: string): void;
|
|
34
38
|
disconnect(): void;
|
|
@@ -50,7 +54,7 @@ declare module 'node:cluster' {
|
|
|
50
54
|
addListener(event: "error", listener: (error: Error) => void): this;
|
|
51
55
|
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
|
52
56
|
addListener(event: "listening", listener: (address: Address) => void): this;
|
|
53
|
-
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;
|
|
57
|
+
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
54
58
|
addListener(event: "online", listener: () => void): this;
|
|
55
59
|
|
|
56
60
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
@@ -66,7 +70,7 @@ declare module 'node:cluster' {
|
|
|
66
70
|
on(event: "error", listener: (error: Error) => void): this;
|
|
67
71
|
on(event: "exit", listener: (code: number, signal: string) => void): this;
|
|
68
72
|
on(event: "listening", listener: (address: Address) => void): this;
|
|
69
|
-
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;
|
|
73
|
+
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
70
74
|
on(event: "online", listener: () => void): this;
|
|
71
75
|
|
|
72
76
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -74,7 +78,7 @@ declare module 'node:cluster' {
|
|
|
74
78
|
once(event: "error", listener: (error: Error) => void): this;
|
|
75
79
|
once(event: "exit", listener: (code: number, signal: string) => void): this;
|
|
76
80
|
once(event: "listening", listener: (address: Address) => void): this;
|
|
77
|
-
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;
|
|
81
|
+
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
78
82
|
once(event: "online", listener: () => void): this;
|
|
79
83
|
|
|
80
84
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -82,7 +86,7 @@ declare module 'node:cluster' {
|
|
|
82
86
|
prependListener(event: "error", listener: (error: Error) => void): this;
|
|
83
87
|
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
|
84
88
|
prependListener(event: "listening", listener: (address: Address) => void): this;
|
|
85
|
-
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;
|
|
89
|
+
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
86
90
|
prependListener(event: "online", listener: () => void): this;
|
|
87
91
|
|
|
88
92
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -90,7 +94,7 @@ declare module 'node:cluster' {
|
|
|
90
94
|
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
|
91
95
|
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
|
92
96
|
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
|
|
93
|
-
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;
|
|
97
|
+
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
94
98
|
prependOnceListener(event: "online", listener: () => void): this;
|
|
95
99
|
}
|
|
96
100
|
|
|
@@ -124,7 +128,10 @@ declare module 'node:cluster' {
|
|
|
124
128
|
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
125
129
|
addListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
126
130
|
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
127
|
-
addListener(
|
|
131
|
+
addListener(
|
|
132
|
+
event: "message",
|
|
133
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
134
|
+
): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
128
135
|
addListener(event: "online", listener: (worker: Worker) => void): this;
|
|
129
136
|
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
130
137
|
|
|
@@ -142,7 +149,7 @@ declare module 'node:cluster' {
|
|
|
142
149
|
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
143
150
|
on(event: "fork", listener: (worker: Worker) => void): this;
|
|
144
151
|
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
145
|
-
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
|
152
|
+
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
146
153
|
on(event: "online", listener: (worker: Worker) => void): this;
|
|
147
154
|
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
148
155
|
|
|
@@ -151,7 +158,7 @@ declare module 'node:cluster' {
|
|
|
151
158
|
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
152
159
|
once(event: "fork", listener: (worker: Worker) => void): this;
|
|
153
160
|
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
154
|
-
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
|
161
|
+
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
155
162
|
once(event: "online", listener: (worker: Worker) => void): this;
|
|
156
163
|
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
157
164
|
|
|
@@ -160,7 +167,10 @@ declare module 'node:cluster' {
|
|
|
160
167
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
161
168
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
162
169
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
163
|
-
prependListener(
|
|
170
|
+
prependListener(
|
|
171
|
+
event: "message",
|
|
172
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
173
|
+
): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
164
174
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
165
175
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
166
176
|
|
|
@@ -170,7 +180,10 @@ declare module 'node:cluster' {
|
|
|
170
180
|
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
171
181
|
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
172
182
|
// the handle is a net.Socket or net.Server object, or undefined.
|
|
173
|
-
prependOnceListener(
|
|
183
|
+
prependOnceListener(
|
|
184
|
+
event: "message",
|
|
185
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
186
|
+
): this;
|
|
174
187
|
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
|
175
188
|
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
176
189
|
}
|
|
@@ -203,8 +216,11 @@ declare module 'node:cluster' {
|
|
|
203
216
|
function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
204
217
|
function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
205
218
|
function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
206
|
-
|
|
207
|
-
function addListener(
|
|
219
|
+
// the handle is a net.Socket or net.Server object, or undefined.
|
|
220
|
+
function addListener(
|
|
221
|
+
event: "message",
|
|
222
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
223
|
+
): Cluster;
|
|
208
224
|
function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
209
225
|
function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
210
226
|
|
|
@@ -222,7 +238,10 @@ declare module 'node:cluster' {
|
|
|
222
238
|
function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
223
239
|
function on(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
224
240
|
function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
225
|
-
function on(
|
|
241
|
+
function on(
|
|
242
|
+
event: "message",
|
|
243
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
244
|
+
): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
|
226
245
|
function on(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
227
246
|
function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
228
247
|
|
|
@@ -231,7 +250,10 @@ declare module 'node:cluster' {
|
|
|
231
250
|
function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
232
251
|
function once(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
233
252
|
function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
234
|
-
function once(
|
|
253
|
+
function once(
|
|
254
|
+
event: "message",
|
|
255
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
256
|
+
): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
|
235
257
|
function once(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
236
258
|
function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
237
259
|
|
|
@@ -247,23 +269,32 @@ declare module 'node:cluster' {
|
|
|
247
269
|
function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
248
270
|
function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
249
271
|
function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
250
|
-
|
|
251
|
-
function prependListener(
|
|
272
|
+
// the handle is a net.Socket or net.Server object, or undefined.
|
|
273
|
+
function prependListener(
|
|
274
|
+
event: "message",
|
|
275
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
276
|
+
): Cluster;
|
|
252
277
|
function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
253
278
|
function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
254
279
|
|
|
255
280
|
function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
|
|
256
281
|
function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
257
|
-
function prependOnceListener(
|
|
282
|
+
function prependOnceListener(
|
|
283
|
+
event: "exit",
|
|
284
|
+
listener: (worker: Worker, code: number, signal: string) => void,
|
|
285
|
+
): Cluster;
|
|
258
286
|
function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
259
287
|
function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
260
|
-
|
|
261
|
-
function prependOnceListener(
|
|
288
|
+
// the handle is a net.Socket or net.Server object, or undefined.
|
|
289
|
+
function prependOnceListener(
|
|
290
|
+
event: "message",
|
|
291
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
292
|
+
): Cluster;
|
|
262
293
|
function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
263
294
|
function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
264
295
|
|
|
265
296
|
function eventNames(): string[];
|
|
266
297
|
}
|
|
267
|
-
declare module
|
|
268
|
-
export * from
|
|
298
|
+
declare module "node:cluster" {
|
|
299
|
+
export * from "cluster";
|
|
269
300
|
}
|