@types/node 16.18.53 → 16.18.54
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 v16.18/README.md +1 -1
- node v16.18/assert/strict.d.ts +4 -4
- node v16.18/assert.d.ts +48 -24
- node v16.18/async_hooks.d.ts +10 -7
- node v16.18/buffer.d.ts +47 -24
- node v16.18/child_process.d.ts +262 -122
- node v16.18/cluster.d.ts +107 -89
- node v16.18/console.d.ts +7 -7
- node v16.18/constants.d.ts +12 -11
- node v16.18/crypto.d.ts +738 -267
- node v16.18/dgram.d.ts +81 -45
- node v16.18/diagnostics_channel.d.ts +3 -3
- node v16.18/dns/promises.d.ts +28 -25
- node v16.18/dns.d.ts +202 -61
- node v16.18/domain.d.ts +4 -4
- node v16.18/events.d.ts +15 -7
- node v16.18/fs/promises.d.ts +93 -64
- node v16.18/fs.d.ts +485 -290
- node v16.18/globals.d.ts +13 -13
- node v16.18/http.d.ts +177 -177
- node v16.18/http2.d.ts +628 -376
- node v16.18/https.d.ts +107 -105
- node v16.18/module.d.ts +11 -8
- node v16.18/net.d.ts +106 -87
- node v16.18/os.d.ts +7 -7
- node v16.18/package.json +2 -2
- node v16.18/path.d.ts +13 -13
- node v16.18/perf_hooks.d.ts +17 -15
- node v16.18/process.d.ts +144 -124
- node v16.18/punycode.d.ts +3 -3
- node v16.18/querystring.d.ts +14 -4
- node v16.18/readline.d.ts +64 -54
- node v16.18/repl.d.ts +67 -61
- node v16.18/stream/consumers.d.ts +4 -4
- node v16.18/stream/promises.d.ts +56 -15
- node v16.18/stream/web.d.ts +19 -19
- node v16.18/stream.d.ts +314 -216
- node v16.18/string_decoder.d.ts +3 -3
- node v16.18/test.d.ts +2 -2
- node v16.18/timers/promises.d.ts +4 -4
- node v16.18/timers.d.ts +23 -8
- node v16.18/tls.d.ts +150 -71
- node v16.18/trace_events.d.ts +3 -3
- node v16.18/ts4.8/assert/strict.d.ts +4 -4
- node v16.18/ts4.8/assert.d.ts +48 -24
- node v16.18/ts4.8/async_hooks.d.ts +10 -7
- node v16.18/ts4.8/buffer.d.ts +47 -24
- node v16.18/ts4.8/child_process.d.ts +262 -122
- node v16.18/ts4.8/cluster.d.ts +107 -89
- node v16.18/ts4.8/console.d.ts +7 -7
- node v16.18/ts4.8/constants.d.ts +12 -11
- node v16.18/ts4.8/crypto.d.ts +738 -267
- node v16.18/ts4.8/dgram.d.ts +81 -45
- node v16.18/ts4.8/diagnostics_channel.d.ts +3 -3
- node v16.18/ts4.8/dns/promises.d.ts +28 -25
- node v16.18/ts4.8/dns.d.ts +202 -61
- node v16.18/ts4.8/domain.d.ts +4 -4
- node v16.18/ts4.8/events.d.ts +15 -7
- node v16.18/ts4.8/fs/promises.d.ts +93 -64
- node v16.18/ts4.8/fs.d.ts +485 -290
- node v16.18/ts4.8/globals.d.ts +13 -13
- node v16.18/ts4.8/http.d.ts +176 -176
- node v16.18/ts4.8/http2.d.ts +628 -376
- node v16.18/ts4.8/https.d.ts +107 -105
- node v16.18/ts4.8/module.d.ts +11 -8
- node v16.18/ts4.8/net.d.ts +106 -87
- node v16.18/ts4.8/os.d.ts +7 -7
- node v16.18/ts4.8/path.d.ts +13 -13
- node v16.18/ts4.8/perf_hooks.d.ts +17 -15
- node v16.18/ts4.8/process.d.ts +144 -124
- node v16.18/ts4.8/punycode.d.ts +3 -3
- node v16.18/ts4.8/querystring.d.ts +14 -4
- node v16.18/ts4.8/readline.d.ts +64 -54
- node v16.18/ts4.8/repl.d.ts +67 -61
- node v16.18/ts4.8/stream/consumers.d.ts +4 -4
- node v16.18/ts4.8/stream/promises.d.ts +56 -15
- node v16.18/ts4.8/stream/web.d.ts +19 -19
- node v16.18/ts4.8/stream.d.ts +309 -214
- node v16.18/ts4.8/string_decoder.d.ts +3 -3
- node v16.18/ts4.8/test.d.ts +2 -2
- node v16.18/ts4.8/timers/promises.d.ts +4 -4
- node v16.18/ts4.8/timers.d.ts +23 -8
- node v16.18/ts4.8/tls.d.ts +150 -71
- node v16.18/ts4.8/trace_events.d.ts +3 -3
- node v16.18/ts4.8/tty.d.ts +10 -10
- node v16.18/ts4.8/url.d.ts +26 -14
- node v16.18/ts4.8/util.d.ts +122 -51
- node v16.18/ts4.8/v8.d.ts +4 -4
- node v16.18/ts4.8/vm.d.ts +18 -18
- node v16.18/ts4.8/wasi.d.ts +3 -3
- node v16.18/ts4.8/worker_threads.d.ts +77 -77
- node v16.18/ts4.8/zlib.d.ts +9 -9
- node v16.18/tty.d.ts +10 -10
- node v16.18/url.d.ts +26 -14
- node v16.18/util.d.ts +122 -51
- node v16.18/v8.d.ts +4 -4
- node v16.18/vm.d.ts +18 -18
- node v16.18/wasi.d.ts +3 -3
- node v16.18/worker_threads.d.ts +77 -77
- node v16.18/zlib.d.ts +9 -9
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
* stalling the event loop while spawned processes complete.
|
|
63
63
|
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/child_process.js)
|
|
64
64
|
*/
|
|
65
|
-
declare module
|
|
66
|
-
import { ObjectEncodingOptions } from
|
|
67
|
-
import {
|
|
68
|
-
import * as net from
|
|
69
|
-
import {
|
|
70
|
-
import { URL } from
|
|
65
|
+
declare module "child_process" {
|
|
66
|
+
import { ObjectEncodingOptions } from "node:fs";
|
|
67
|
+
import { Abortable, EventEmitter } from "node:events";
|
|
68
|
+
import * as net from "node:net";
|
|
69
|
+
import { Pipe, Readable, Stream, Writable } from "node:stream";
|
|
70
|
+
import { URL } from "node:url";
|
|
71
71
|
type Serializable = string | object | number | boolean | bigint;
|
|
72
72
|
type SendHandle = net.Socket | net.Server;
|
|
73
73
|
/**
|
|
@@ -186,7 +186,7 @@ declare module 'child_process' {
|
|
|
186
186
|
// stderr
|
|
187
187
|
Readable | Writable | null | undefined,
|
|
188
188
|
// extra
|
|
189
|
-
Readable | Writable | null | undefined // extra
|
|
189
|
+
Readable | Writable | null | undefined, // extra
|
|
190
190
|
];
|
|
191
191
|
/**
|
|
192
192
|
* The `subprocess.killed` property indicates whether the child process
|
|
@@ -454,7 +454,12 @@ declare module 'child_process' {
|
|
|
454
454
|
*/
|
|
455
455
|
send(message: Serializable, callback?: (error: Error | null) => void): boolean;
|
|
456
456
|
send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
|
|
457
|
-
send(
|
|
457
|
+
send(
|
|
458
|
+
message: Serializable,
|
|
459
|
+
sendHandle?: SendHandle,
|
|
460
|
+
options?: MessageOptions,
|
|
461
|
+
callback?: (error: Error | null) => void,
|
|
462
|
+
): boolean;
|
|
458
463
|
/**
|
|
459
464
|
* Closes the IPC channel between parent and child, allowing the child to exit
|
|
460
465
|
* gracefully once there are no other connections keeping it alive. After calling
|
|
@@ -520,47 +525,53 @@ declare module 'child_process' {
|
|
|
520
525
|
* 6. spawn
|
|
521
526
|
*/
|
|
522
527
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
523
|
-
addListener(event:
|
|
524
|
-
addListener(event:
|
|
525
|
-
addListener(event:
|
|
526
|
-
addListener(event:
|
|
527
|
-
addListener(event:
|
|
528
|
-
addListener(event:
|
|
528
|
+
addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
529
|
+
addListener(event: "disconnect", listener: () => void): this;
|
|
530
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
531
|
+
addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
532
|
+
addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
533
|
+
addListener(event: "spawn", listener: () => void): this;
|
|
529
534
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
530
|
-
emit(event:
|
|
531
|
-
emit(event:
|
|
532
|
-
emit(event:
|
|
533
|
-
emit(event:
|
|
534
|
-
emit(event:
|
|
535
|
-
emit(event:
|
|
535
|
+
emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
|
|
536
|
+
emit(event: "disconnect"): boolean;
|
|
537
|
+
emit(event: "error", err: Error): boolean;
|
|
538
|
+
emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
|
|
539
|
+
emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
|
|
540
|
+
emit(event: "spawn", listener: () => void): boolean;
|
|
536
541
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
537
|
-
on(event:
|
|
538
|
-
on(event:
|
|
539
|
-
on(event:
|
|
540
|
-
on(event:
|
|
541
|
-
on(event:
|
|
542
|
-
on(event:
|
|
542
|
+
on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
543
|
+
on(event: "disconnect", listener: () => void): this;
|
|
544
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
545
|
+
on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
546
|
+
on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
547
|
+
on(event: "spawn", listener: () => void): this;
|
|
543
548
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
544
|
-
once(event:
|
|
545
|
-
once(event:
|
|
546
|
-
once(event:
|
|
547
|
-
once(event:
|
|
548
|
-
once(event:
|
|
549
|
-
once(event:
|
|
549
|
+
once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
550
|
+
once(event: "disconnect", listener: () => void): this;
|
|
551
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
552
|
+
once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
553
|
+
once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
554
|
+
once(event: "spawn", listener: () => void): this;
|
|
550
555
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
551
|
-
prependListener(event:
|
|
552
|
-
prependListener(event:
|
|
553
|
-
prependListener(event:
|
|
554
|
-
prependListener(event:
|
|
555
|
-
prependListener(event:
|
|
556
|
-
prependListener(event:
|
|
556
|
+
prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
557
|
+
prependListener(event: "disconnect", listener: () => void): this;
|
|
558
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
559
|
+
prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
560
|
+
prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
561
|
+
prependListener(event: "spawn", listener: () => void): this;
|
|
557
562
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
558
|
-
prependOnceListener(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
prependOnceListener(event:
|
|
563
|
-
prependOnceListener(event:
|
|
563
|
+
prependOnceListener(
|
|
564
|
+
event: "close",
|
|
565
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
566
|
+
): this;
|
|
567
|
+
prependOnceListener(event: "disconnect", listener: () => void): this;
|
|
568
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
569
|
+
prependOnceListener(
|
|
570
|
+
event: "exit",
|
|
571
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
572
|
+
): this;
|
|
573
|
+
prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
574
|
+
prependOnceListener(event: "spawn", listener: () => void): this;
|
|
564
575
|
}
|
|
565
576
|
// return this object when stdio option is undefined or not specified
|
|
566
577
|
interface ChildProcessWithoutNullStreams extends ChildProcess {
|
|
@@ -574,11 +585,13 @@ declare module 'child_process' {
|
|
|
574
585
|
// stderr
|
|
575
586
|
Readable | Writable | null | undefined,
|
|
576
587
|
// extra, no modification
|
|
577
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
588
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
578
589
|
];
|
|
579
590
|
}
|
|
580
591
|
// return this object when stdio option is a tuple of 3
|
|
581
|
-
interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
|
|
592
|
+
interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
|
|
593
|
+
extends ChildProcess
|
|
594
|
+
{
|
|
582
595
|
stdin: I;
|
|
583
596
|
stdout: O;
|
|
584
597
|
stderr: E;
|
|
@@ -588,15 +601,15 @@ declare module 'child_process' {
|
|
|
588
601
|
E,
|
|
589
602
|
Readable | Writable | null | undefined,
|
|
590
603
|
// extra, no modification
|
|
591
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
604
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
592
605
|
];
|
|
593
606
|
}
|
|
594
607
|
interface MessageOptions {
|
|
595
608
|
keepOpen?: boolean | undefined;
|
|
596
609
|
}
|
|
597
|
-
type IOType =
|
|
598
|
-
type StdioOptions = IOType | Array<IOType |
|
|
599
|
-
type SerializationType =
|
|
610
|
+
type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
|
|
611
|
+
type StdioOptions = IOType | Array<IOType | "ipc" | Stream | number | null | undefined>;
|
|
612
|
+
type SerializationType = "json" | "advanced";
|
|
600
613
|
interface MessagingOptions extends Abortable {
|
|
601
614
|
/**
|
|
602
615
|
* Specify the kind of serialization used for sending messages between processes.
|
|
@@ -650,10 +663,14 @@ declare module 'child_process' {
|
|
|
650
663
|
interface SpawnOptionsWithoutStdio extends SpawnOptions {
|
|
651
664
|
stdio?: StdioPipeNamed | StdioPipe[] | undefined;
|
|
652
665
|
}
|
|
653
|
-
type StdioNull =
|
|
654
|
-
type StdioPipeNamed =
|
|
666
|
+
type StdioNull = "inherit" | "ignore" | Stream;
|
|
667
|
+
type StdioPipeNamed = "pipe" | "overlapped";
|
|
655
668
|
type StdioPipe = undefined | null | StdioPipeNamed;
|
|
656
|
-
interface SpawnOptionsWithStdioTuple<
|
|
669
|
+
interface SpawnOptionsWithStdioTuple<
|
|
670
|
+
Stdin extends StdioNull | StdioPipe,
|
|
671
|
+
Stdout extends StdioNull | StdioPipe,
|
|
672
|
+
Stderr extends StdioNull | StdioPipe,
|
|
673
|
+
> extends SpawnOptions {
|
|
657
674
|
stdio: [Stdin, Stdout, Stderr];
|
|
658
675
|
}
|
|
659
676
|
/**
|
|
@@ -776,25 +793,85 @@ declare module 'child_process' {
|
|
|
776
793
|
* @param args List of string arguments.
|
|
777
794
|
*/
|
|
778
795
|
function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
|
|
779
|
-
function spawn(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
function spawn(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
796
|
+
function spawn(
|
|
797
|
+
command: string,
|
|
798
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
|
|
799
|
+
): ChildProcessByStdio<Writable, Readable, Readable>;
|
|
800
|
+
function spawn(
|
|
801
|
+
command: string,
|
|
802
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
|
|
803
|
+
): ChildProcessByStdio<Writable, Readable, null>;
|
|
804
|
+
function spawn(
|
|
805
|
+
command: string,
|
|
806
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
|
|
807
|
+
): ChildProcessByStdio<Writable, null, Readable>;
|
|
808
|
+
function spawn(
|
|
809
|
+
command: string,
|
|
810
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
|
|
811
|
+
): ChildProcessByStdio<null, Readable, Readable>;
|
|
812
|
+
function spawn(
|
|
813
|
+
command: string,
|
|
814
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
|
|
815
|
+
): ChildProcessByStdio<Writable, null, null>;
|
|
816
|
+
function spawn(
|
|
817
|
+
command: string,
|
|
818
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
|
|
819
|
+
): ChildProcessByStdio<null, Readable, null>;
|
|
820
|
+
function spawn(
|
|
821
|
+
command: string,
|
|
822
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
|
|
823
|
+
): ChildProcessByStdio<null, null, Readable>;
|
|
824
|
+
function spawn(
|
|
825
|
+
command: string,
|
|
826
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
|
|
827
|
+
): ChildProcessByStdio<null, null, null>;
|
|
787
828
|
function spawn(command: string, options: SpawnOptions): ChildProcess;
|
|
788
829
|
// overloads of spawn with 'args'
|
|
789
|
-
function spawn(
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
function spawn(
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
830
|
+
function spawn(
|
|
831
|
+
command: string,
|
|
832
|
+
args?: ReadonlyArray<string>,
|
|
833
|
+
options?: SpawnOptionsWithoutStdio,
|
|
834
|
+
): ChildProcessWithoutNullStreams;
|
|
835
|
+
function spawn(
|
|
836
|
+
command: string,
|
|
837
|
+
args: ReadonlyArray<string>,
|
|
838
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
|
|
839
|
+
): ChildProcessByStdio<Writable, Readable, Readable>;
|
|
840
|
+
function spawn(
|
|
841
|
+
command: string,
|
|
842
|
+
args: ReadonlyArray<string>,
|
|
843
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
|
|
844
|
+
): ChildProcessByStdio<Writable, Readable, null>;
|
|
845
|
+
function spawn(
|
|
846
|
+
command: string,
|
|
847
|
+
args: ReadonlyArray<string>,
|
|
848
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
|
|
849
|
+
): ChildProcessByStdio<Writable, null, Readable>;
|
|
850
|
+
function spawn(
|
|
851
|
+
command: string,
|
|
852
|
+
args: ReadonlyArray<string>,
|
|
853
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
|
|
854
|
+
): ChildProcessByStdio<null, Readable, Readable>;
|
|
855
|
+
function spawn(
|
|
856
|
+
command: string,
|
|
857
|
+
args: ReadonlyArray<string>,
|
|
858
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
|
|
859
|
+
): ChildProcessByStdio<Writable, null, null>;
|
|
860
|
+
function spawn(
|
|
861
|
+
command: string,
|
|
862
|
+
args: ReadonlyArray<string>,
|
|
863
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
|
|
864
|
+
): ChildProcessByStdio<null, Readable, null>;
|
|
865
|
+
function spawn(
|
|
866
|
+
command: string,
|
|
867
|
+
args: ReadonlyArray<string>,
|
|
868
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
|
|
869
|
+
): ChildProcessByStdio<null, null, Readable>;
|
|
870
|
+
function spawn(
|
|
871
|
+
command: string,
|
|
872
|
+
args: ReadonlyArray<string>,
|
|
873
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
|
|
874
|
+
): ChildProcessByStdio<null, null, null>;
|
|
798
875
|
function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
|
|
799
876
|
interface ExecOptions extends CommonOptions {
|
|
800
877
|
shell?: string | undefined;
|
|
@@ -899,14 +976,17 @@ declare module 'child_process' {
|
|
|
899
976
|
* @param command The command to run, with space-separated arguments.
|
|
900
977
|
* @param callback called with the output when process terminates.
|
|
901
978
|
*/
|
|
902
|
-
function exec(
|
|
979
|
+
function exec(
|
|
980
|
+
command: string,
|
|
981
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
982
|
+
): ChildProcess;
|
|
903
983
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
904
984
|
function exec(
|
|
905
985
|
command: string,
|
|
906
986
|
options: {
|
|
907
|
-
encoding:
|
|
987
|
+
encoding: "buffer" | null;
|
|
908
988
|
} & ExecOptions,
|
|
909
|
-
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void
|
|
989
|
+
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
910
990
|
): ChildProcess;
|
|
911
991
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
912
992
|
function exec(
|
|
@@ -914,7 +994,7 @@ declare module 'child_process' {
|
|
|
914
994
|
options: {
|
|
915
995
|
encoding: BufferEncoding;
|
|
916
996
|
} & ExecOptions,
|
|
917
|
-
callback?: (error: ExecException | null, stdout: string, stderr: string) => void
|
|
997
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
918
998
|
): ChildProcess;
|
|
919
999
|
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
920
1000
|
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
@@ -923,15 +1003,19 @@ declare module 'child_process' {
|
|
|
923
1003
|
options: {
|
|
924
1004
|
encoding: BufferEncoding;
|
|
925
1005
|
} & ExecOptions,
|
|
926
|
-
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1006
|
+
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
927
1007
|
): ChildProcess;
|
|
928
1008
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
929
|
-
function exec(
|
|
1009
|
+
function exec(
|
|
1010
|
+
command: string,
|
|
1011
|
+
options: ExecOptions,
|
|
1012
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
1013
|
+
): ChildProcess;
|
|
930
1014
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
931
1015
|
function exec(
|
|
932
1016
|
command: string,
|
|
933
1017
|
options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
|
|
934
|
-
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1018
|
+
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
935
1019
|
): ChildProcess;
|
|
936
1020
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
937
1021
|
child: ChildProcess;
|
|
@@ -944,8 +1028,8 @@ declare module 'child_process' {
|
|
|
944
1028
|
function __promisify__(
|
|
945
1029
|
command: string,
|
|
946
1030
|
options: {
|
|
947
|
-
encoding:
|
|
948
|
-
} & ExecOptions
|
|
1031
|
+
encoding: "buffer" | null;
|
|
1032
|
+
} & ExecOptions,
|
|
949
1033
|
): PromiseWithChild<{
|
|
950
1034
|
stdout: Buffer;
|
|
951
1035
|
stderr: Buffer;
|
|
@@ -954,21 +1038,21 @@ declare module 'child_process' {
|
|
|
954
1038
|
command: string,
|
|
955
1039
|
options: {
|
|
956
1040
|
encoding: BufferEncoding;
|
|
957
|
-
} & ExecOptions
|
|
1041
|
+
} & ExecOptions,
|
|
958
1042
|
): PromiseWithChild<{
|
|
959
1043
|
stdout: string;
|
|
960
1044
|
stderr: string;
|
|
961
1045
|
}>;
|
|
962
1046
|
function __promisify__(
|
|
963
1047
|
command: string,
|
|
964
|
-
options: ExecOptions
|
|
1048
|
+
options: ExecOptions,
|
|
965
1049
|
): PromiseWithChild<{
|
|
966
1050
|
stdout: string;
|
|
967
1051
|
stderr: string;
|
|
968
1052
|
}>;
|
|
969
1053
|
function __promisify__(
|
|
970
1054
|
command: string,
|
|
971
|
-
options?: (ObjectEncodingOptions & ExecOptions) | null
|
|
1055
|
+
options?: (ObjectEncodingOptions & ExecOptions) | null,
|
|
972
1056
|
): PromiseWithChild<{
|
|
973
1057
|
stdout: string | Buffer;
|
|
974
1058
|
stderr: string | Buffer;
|
|
@@ -985,14 +1069,14 @@ declare module 'child_process' {
|
|
|
985
1069
|
encoding: BufferEncoding;
|
|
986
1070
|
}
|
|
987
1071
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
|
988
|
-
encoding:
|
|
1072
|
+
encoding: "buffer" | null;
|
|
989
1073
|
}
|
|
990
1074
|
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
|
991
1075
|
encoding: BufferEncoding;
|
|
992
1076
|
}
|
|
993
1077
|
type ExecFileException =
|
|
994
|
-
& Omit<ExecException,
|
|
995
|
-
& Omit<NodeJS.ErrnoException,
|
|
1078
|
+
& Omit<ExecException, "code">
|
|
1079
|
+
& Omit<NodeJS.ErrnoException, "code">
|
|
996
1080
|
& { code?: string | number | undefined | null };
|
|
997
1081
|
/**
|
|
998
1082
|
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
|
@@ -1058,56 +1142,92 @@ declare module 'child_process' {
|
|
|
1058
1142
|
* @param callback Called with the output when process terminates.
|
|
1059
1143
|
*/
|
|
1060
1144
|
function execFile(file: string): ChildProcess;
|
|
1061
|
-
function execFile(
|
|
1145
|
+
function execFile(
|
|
1146
|
+
file: string,
|
|
1147
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1148
|
+
): ChildProcess;
|
|
1062
1149
|
function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
|
|
1063
|
-
function execFile(
|
|
1150
|
+
function execFile(
|
|
1151
|
+
file: string,
|
|
1152
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1153
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1154
|
+
): ChildProcess;
|
|
1064
1155
|
// no `options` definitely means stdout/stderr are `string`.
|
|
1065
|
-
function execFile(
|
|
1066
|
-
|
|
1156
|
+
function execFile(
|
|
1157
|
+
file: string,
|
|
1158
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1159
|
+
): ChildProcess;
|
|
1160
|
+
function execFile(
|
|
1161
|
+
file: string,
|
|
1162
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1163
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1164
|
+
): ChildProcess;
|
|
1067
1165
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
1068
|
-
function execFile(
|
|
1166
|
+
function execFile(
|
|
1167
|
+
file: string,
|
|
1168
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1169
|
+
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1170
|
+
): ChildProcess;
|
|
1069
1171
|
function execFile(
|
|
1070
1172
|
file: string,
|
|
1071
1173
|
args: ReadonlyArray<string> | undefined | null,
|
|
1072
1174
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1073
|
-
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
|
|
1175
|
+
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1074
1176
|
): ChildProcess;
|
|
1075
1177
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
1076
|
-
function execFile(
|
|
1178
|
+
function execFile(
|
|
1179
|
+
file: string,
|
|
1180
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1181
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1182
|
+
): ChildProcess;
|
|
1077
1183
|
function execFile(
|
|
1078
1184
|
file: string,
|
|
1079
1185
|
args: ReadonlyArray<string> | undefined | null,
|
|
1080
1186
|
options: ExecFileOptionsWithStringEncoding,
|
|
1081
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
|
|
1187
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1082
1188
|
): ChildProcess;
|
|
1083
1189
|
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
1084
1190
|
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
1085
|
-
function execFile(
|
|
1191
|
+
function execFile(
|
|
1192
|
+
file: string,
|
|
1193
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1194
|
+
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1195
|
+
): ChildProcess;
|
|
1086
1196
|
function execFile(
|
|
1087
1197
|
file: string,
|
|
1088
1198
|
args: ReadonlyArray<string> | undefined | null,
|
|
1089
1199
|
options: ExecFileOptionsWithOtherEncoding,
|
|
1090
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1200
|
+
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1091
1201
|
): ChildProcess;
|
|
1092
1202
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
1093
|
-
function execFile(
|
|
1203
|
+
function execFile(
|
|
1204
|
+
file: string,
|
|
1205
|
+
options: ExecFileOptions,
|
|
1206
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1207
|
+
): ChildProcess;
|
|
1094
1208
|
function execFile(
|
|
1095
1209
|
file: string,
|
|
1096
1210
|
args: ReadonlyArray<string> | undefined | null,
|
|
1097
1211
|
options: ExecFileOptions,
|
|
1098
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
|
|
1212
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1099
1213
|
): ChildProcess;
|
|
1100
1214
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1101
1215
|
function execFile(
|
|
1102
1216
|
file: string,
|
|
1103
1217
|
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1104
|
-
callback:
|
|
1218
|
+
callback:
|
|
1219
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1220
|
+
| undefined
|
|
1221
|
+
| null,
|
|
1105
1222
|
): ChildProcess;
|
|
1106
1223
|
function execFile(
|
|
1107
1224
|
file: string,
|
|
1108
1225
|
args: ReadonlyArray<string> | undefined | null,
|
|
1109
1226
|
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1110
|
-
callback:
|
|
1227
|
+
callback:
|
|
1228
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1229
|
+
| undefined
|
|
1230
|
+
| null,
|
|
1111
1231
|
): ChildProcess;
|
|
1112
1232
|
namespace execFile {
|
|
1113
1233
|
function __promisify__(file: string): PromiseWithChild<{
|
|
@@ -1116,14 +1236,14 @@ declare module 'child_process' {
|
|
|
1116
1236
|
}>;
|
|
1117
1237
|
function __promisify__(
|
|
1118
1238
|
file: string,
|
|
1119
|
-
args: ReadonlyArray<string> | undefined | null
|
|
1239
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1120
1240
|
): PromiseWithChild<{
|
|
1121
1241
|
stdout: string;
|
|
1122
1242
|
stderr: string;
|
|
1123
1243
|
}>;
|
|
1124
1244
|
function __promisify__(
|
|
1125
1245
|
file: string,
|
|
1126
|
-
options: ExecFileOptionsWithBufferEncoding
|
|
1246
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1127
1247
|
): PromiseWithChild<{
|
|
1128
1248
|
stdout: Buffer;
|
|
1129
1249
|
stderr: Buffer;
|
|
@@ -1131,14 +1251,14 @@ declare module 'child_process' {
|
|
|
1131
1251
|
function __promisify__(
|
|
1132
1252
|
file: string,
|
|
1133
1253
|
args: ReadonlyArray<string> | undefined | null,
|
|
1134
|
-
options: ExecFileOptionsWithBufferEncoding
|
|
1254
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1135
1255
|
): PromiseWithChild<{
|
|
1136
1256
|
stdout: Buffer;
|
|
1137
1257
|
stderr: Buffer;
|
|
1138
1258
|
}>;
|
|
1139
1259
|
function __promisify__(
|
|
1140
1260
|
file: string,
|
|
1141
|
-
options: ExecFileOptionsWithStringEncoding
|
|
1261
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1142
1262
|
): PromiseWithChild<{
|
|
1143
1263
|
stdout: string;
|
|
1144
1264
|
stderr: string;
|
|
@@ -1146,14 +1266,14 @@ declare module 'child_process' {
|
|
|
1146
1266
|
function __promisify__(
|
|
1147
1267
|
file: string,
|
|
1148
1268
|
args: ReadonlyArray<string> | undefined | null,
|
|
1149
|
-
options: ExecFileOptionsWithStringEncoding
|
|
1269
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1150
1270
|
): PromiseWithChild<{
|
|
1151
1271
|
stdout: string;
|
|
1152
1272
|
stderr: string;
|
|
1153
1273
|
}>;
|
|
1154
1274
|
function __promisify__(
|
|
1155
1275
|
file: string,
|
|
1156
|
-
options: ExecFileOptionsWithOtherEncoding
|
|
1276
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1157
1277
|
): PromiseWithChild<{
|
|
1158
1278
|
stdout: string | Buffer;
|
|
1159
1279
|
stderr: string | Buffer;
|
|
@@ -1161,14 +1281,14 @@ declare module 'child_process' {
|
|
|
1161
1281
|
function __promisify__(
|
|
1162
1282
|
file: string,
|
|
1163
1283
|
args: ReadonlyArray<string> | undefined | null,
|
|
1164
|
-
options: ExecFileOptionsWithOtherEncoding
|
|
1284
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1165
1285
|
): PromiseWithChild<{
|
|
1166
1286
|
stdout: string | Buffer;
|
|
1167
1287
|
stderr: string | Buffer;
|
|
1168
1288
|
}>;
|
|
1169
1289
|
function __promisify__(
|
|
1170
1290
|
file: string,
|
|
1171
|
-
options: ExecFileOptions
|
|
1291
|
+
options: ExecFileOptions,
|
|
1172
1292
|
): PromiseWithChild<{
|
|
1173
1293
|
stdout: string;
|
|
1174
1294
|
stderr: string;
|
|
@@ -1176,14 +1296,14 @@ declare module 'child_process' {
|
|
|
1176
1296
|
function __promisify__(
|
|
1177
1297
|
file: string,
|
|
1178
1298
|
args: ReadonlyArray<string> | undefined | null,
|
|
1179
|
-
options: ExecFileOptions
|
|
1299
|
+
options: ExecFileOptions,
|
|
1180
1300
|
): PromiseWithChild<{
|
|
1181
1301
|
stdout: string;
|
|
1182
1302
|
stderr: string;
|
|
1183
1303
|
}>;
|
|
1184
1304
|
function __promisify__(
|
|
1185
1305
|
file: string,
|
|
1186
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
|
|
1306
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1187
1307
|
): PromiseWithChild<{
|
|
1188
1308
|
stdout: string | Buffer;
|
|
1189
1309
|
stderr: string | Buffer;
|
|
@@ -1191,7 +1311,7 @@ declare module 'child_process' {
|
|
|
1191
1311
|
function __promisify__(
|
|
1192
1312
|
file: string,
|
|
1193
1313
|
args: ReadonlyArray<string> | undefined | null,
|
|
1194
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
|
|
1314
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1195
1315
|
): PromiseWithChild<{
|
|
1196
1316
|
stdout: string | Buffer;
|
|
1197
1317
|
stderr: string | Buffer;
|
|
@@ -1268,13 +1388,13 @@ declare module 'child_process' {
|
|
|
1268
1388
|
interface SpawnSyncOptions extends CommonSpawnOptions {
|
|
1269
1389
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1270
1390
|
maxBuffer?: number | undefined;
|
|
1271
|
-
encoding?: BufferEncoding |
|
|
1391
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
1272
1392
|
}
|
|
1273
1393
|
interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
|
1274
1394
|
encoding: BufferEncoding;
|
|
1275
1395
|
}
|
|
1276
1396
|
interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
|
1277
|
-
encoding?:
|
|
1397
|
+
encoding?: "buffer" | null | undefined;
|
|
1278
1398
|
}
|
|
1279
1399
|
interface SpawnSyncReturns<T> {
|
|
1280
1400
|
pid: number;
|
|
@@ -1305,9 +1425,21 @@ declare module 'child_process' {
|
|
|
1305
1425
|
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
|
1306
1426
|
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
|
|
1307
1427
|
function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
|
|
1308
|
-
function spawnSync(
|
|
1309
|
-
|
|
1310
|
-
|
|
1428
|
+
function spawnSync(
|
|
1429
|
+
command: string,
|
|
1430
|
+
args: ReadonlyArray<string>,
|
|
1431
|
+
options: SpawnSyncOptionsWithStringEncoding,
|
|
1432
|
+
): SpawnSyncReturns<string>;
|
|
1433
|
+
function spawnSync(
|
|
1434
|
+
command: string,
|
|
1435
|
+
args: ReadonlyArray<string>,
|
|
1436
|
+
options: SpawnSyncOptionsWithBufferEncoding,
|
|
1437
|
+
): SpawnSyncReturns<Buffer>;
|
|
1438
|
+
function spawnSync(
|
|
1439
|
+
command: string,
|
|
1440
|
+
args?: ReadonlyArray<string>,
|
|
1441
|
+
options?: SpawnSyncOptions,
|
|
1442
|
+
): SpawnSyncReturns<string | Buffer>;
|
|
1311
1443
|
interface CommonExecOptions extends CommonOptions {
|
|
1312
1444
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1313
1445
|
/**
|
|
@@ -1322,7 +1454,7 @@ declare module 'child_process' {
|
|
|
1322
1454
|
stdio?: StdioOptions | undefined;
|
|
1323
1455
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
1324
1456
|
maxBuffer?: number | undefined;
|
|
1325
|
-
encoding?: BufferEncoding |
|
|
1457
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
1326
1458
|
}
|
|
1327
1459
|
interface ExecSyncOptions extends CommonExecOptions {
|
|
1328
1460
|
shell?: string | undefined;
|
|
@@ -1331,7 +1463,7 @@ declare module 'child_process' {
|
|
|
1331
1463
|
encoding: BufferEncoding;
|
|
1332
1464
|
}
|
|
1333
1465
|
interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
|
1334
|
-
encoding?:
|
|
1466
|
+
encoding?: "buffer" | null | undefined;
|
|
1335
1467
|
}
|
|
1336
1468
|
/**
|
|
1337
1469
|
* The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
|
|
@@ -1360,7 +1492,7 @@ declare module 'child_process' {
|
|
|
1360
1492
|
encoding: BufferEncoding;
|
|
1361
1493
|
}
|
|
1362
1494
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1363
|
-
encoding?:
|
|
1495
|
+
encoding?: "buffer" | null; // specify `null`.
|
|
1364
1496
|
}
|
|
1365
1497
|
/**
|
|
1366
1498
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
|
@@ -1387,10 +1519,18 @@ declare module 'child_process' {
|
|
|
1387
1519
|
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
|
1388
1520
|
function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
|
|
1389
1521
|
function execFileSync(file: string, args: ReadonlyArray<string>): Buffer;
|
|
1390
|
-
function execFileSync(
|
|
1391
|
-
|
|
1522
|
+
function execFileSync(
|
|
1523
|
+
file: string,
|
|
1524
|
+
args: ReadonlyArray<string>,
|
|
1525
|
+
options: ExecFileSyncOptionsWithStringEncoding,
|
|
1526
|
+
): string;
|
|
1527
|
+
function execFileSync(
|
|
1528
|
+
file: string,
|
|
1529
|
+
args: ReadonlyArray<string>,
|
|
1530
|
+
options: ExecFileSyncOptionsWithBufferEncoding,
|
|
1531
|
+
): Buffer;
|
|
1392
1532
|
function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
|
|
1393
1533
|
}
|
|
1394
|
-
declare module
|
|
1395
|
-
export * from
|
|
1534
|
+
declare module "node:child_process" {
|
|
1535
|
+
export * from "child_process";
|
|
1396
1536
|
}
|