@types/node 18.17.18 → 18.18.0
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 v18.17 → node v18.18}/README.md +1 -1
- node v18.18/assert/strict.d.ts +8 -0
- {node v18.17/ts4.8 → node v18.18}/assert.d.ts +48 -24
- {node v18.17 → node v18.18}/async_hooks.d.ts +10 -7
- {node v18.17 → node v18.18}/buffer.d.ts +32 -34
- {node v18.17 → node v18.18}/child_process.d.ts +267 -122
- {node v18.17/ts4.8 → node v18.18}/cluster.d.ts +107 -89
- {node v18.17/ts4.8 → node v18.18}/console.d.ts +7 -7
- node v18.18/constants.d.ts +19 -0
- {node v18.17 → node v18.18}/crypto.d.ts +746 -268
- {node v18.17/ts4.8 → node v18.18}/dgram.d.ts +86 -45
- {node v18.17 → node v18.18}/diagnostics_channel.d.ts +3 -3
- {node v18.17 → node v18.18}/dns/promises.d.ts +28 -25
- {node v18.17/ts4.8 → node v18.18}/dns.d.ts +203 -62
- node v18.18/dom-events.d.ts +122 -0
- {node v18.17/ts4.8 → node v18.18}/domain.d.ts +4 -4
- {node v18.17 → node v18.18}/events.d.ts +50 -7
- {node v18.17 → node v18.18}/fs/promises.d.ts +107 -73
- {node v18.17 → node v18.18}/fs.d.ts +513 -311
- {node v18.17 → node v18.18}/globals.d.ts +38 -18
- {node v18.17 → node v18.18}/http.d.ts +185 -185
- {node v18.17 → node v18.18}/http2.d.ts +628 -376
- {node v18.17/ts4.8 → node v18.18}/https.d.ts +107 -105
- {node v18.17 → node v18.18}/index.d.ts +1 -1
- {node v18.17/ts4.8 → node v18.18}/module.d.ts +56 -12
- {node v18.17/ts4.8 → node v18.18}/net.d.ts +123 -99
- {node v18.17/ts4.8 → node v18.18}/os.d.ts +7 -7
- {node v18.17 → node v18.18}/package.json +2 -2
- {node v18.17/ts4.8 → node v18.18}/path.d.ts +13 -13
- {node v18.17/ts4.8 → node v18.18}/perf_hooks.d.ts +20 -19
- {node v18.17/ts4.8 → node v18.18}/process.d.ts +155 -125
- {node v18.17 → node v18.18}/punycode.d.ts +3 -3
- {node v18.17/ts4.8 → node v18.18}/querystring.d.ts +14 -4
- {node v18.17 → node v18.18}/readline/promises.d.ts +5 -5
- {node v18.17/ts4.8 → node v18.18}/readline.d.ts +69 -56
- {node v18.17/ts4.8 → node v18.18}/repl.d.ts +67 -61
- {node v18.17 → node v18.18}/stream/consumers.d.ts +4 -4
- node v18.18/stream/promises.d.ts +83 -0
- {node v18.17 → node v18.18}/stream/web.d.ts +26 -20
- {node v18.17 → node v18.18}/stream.d.ts +361 -226
- {node v18.17/ts4.8 → node v18.18}/string_decoder.d.ts +3 -3
- {node v18.17 → node v18.18}/test.d.ts +131 -131
- {node v18.17 → node v18.18}/timers/promises.d.ts +4 -4
- {node v18.17 → node v18.18}/timers.d.ts +34 -9
- {node v18.17 → node v18.18}/tls.d.ts +151 -71
- {node v18.17/ts4.8 → node v18.18}/trace_events.d.ts +3 -3
- node v18.18/ts4.8/assert/strict.d.ts +8 -0
- {node v18.17 → node v18.18/ts4.8}/assert.d.ts +48 -24
- {node v18.17 → node v18.18}/ts4.8/async_hooks.d.ts +10 -7
- {node v18.17 → node v18.18}/ts4.8/buffer.d.ts +32 -34
- {node v18.17 → node v18.18}/ts4.8/child_process.d.ts +267 -122
- {node v18.17 → node v18.18/ts4.8}/cluster.d.ts +107 -89
- {node v18.17 → node v18.18/ts4.8}/console.d.ts +7 -7
- node v18.18/ts4.8/constants.d.ts +19 -0
- {node v18.17 → node v18.18}/ts4.8/crypto.d.ts +746 -268
- {node v18.17 → node v18.18/ts4.8}/dgram.d.ts +86 -45
- {node v18.17 → node v18.18}/ts4.8/diagnostics_channel.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/dns/promises.d.ts +28 -25
- {node v18.17 → node v18.18/ts4.8}/dns.d.ts +203 -62
- node v18.18/ts4.8/dom-events.d.ts +122 -0
- {node v18.17 → node v18.18/ts4.8}/domain.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/events.d.ts +50 -7
- {node v18.17 → node v18.18}/ts4.8/fs/promises.d.ts +107 -73
- {node v18.17 → node v18.18}/ts4.8/fs.d.ts +514 -312
- {node v18.17 → node v18.18}/ts4.8/globals.d.ts +68 -47
- {node v18.17 → node v18.18}/ts4.8/http.d.ts +185 -185
- {node v18.17 → node v18.18}/ts4.8/http2.d.ts +628 -376
- {node v18.17 → node v18.18/ts4.8}/https.d.ts +107 -105
- {node v18.17 → node v18.18/ts4.8}/module.d.ts +56 -12
- {node v18.17 → node v18.18/ts4.8}/net.d.ts +117 -93
- {node v18.17 → node v18.18/ts4.8}/os.d.ts +7 -7
- {node v18.17 → node v18.18/ts4.8}/path.d.ts +13 -13
- {node v18.17 → node v18.18/ts4.8}/perf_hooks.d.ts +20 -19
- {node v18.17 → node v18.18/ts4.8}/process.d.ts +155 -125
- {node v18.17 → node v18.18}/ts4.8/punycode.d.ts +3 -3
- {node v18.17 → node v18.18/ts4.8}/querystring.d.ts +14 -4
- {node v18.17 → node v18.18}/ts4.8/readline/promises.d.ts +5 -5
- {node v18.17 → node v18.18/ts4.8}/readline.d.ts +69 -56
- {node v18.17 → node v18.18/ts4.8}/repl.d.ts +67 -61
- {node v18.17 → node v18.18}/ts4.8/stream/consumers.d.ts +4 -4
- node v18.18/ts4.8/stream/promises.d.ts +83 -0
- {node v18.17 → node v18.18}/ts4.8/stream/web.d.ts +26 -20
- {node v18.17 → node v18.18}/ts4.8/stream.d.ts +490 -217
- {node v18.17 → node v18.18/ts4.8}/string_decoder.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/test.d.ts +144 -130
- {node v18.17 → node v18.18}/ts4.8/timers/promises.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/timers.d.ts +41 -9
- {node v18.17 → node v18.18}/ts4.8/tls.d.ts +151 -71
- {node v18.17 → node v18.18/ts4.8}/trace_events.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/tty.d.ts +10 -10
- {node v18.17 → node v18.18}/ts4.8/url.d.ts +39 -18
- {node v18.17 → node v18.18}/ts4.8/util.d.ts +178 -117
- {node v18.17 → node v18.18}/ts4.8/v8.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/vm.d.ts +60 -42
- {node v18.17 → node v18.18}/ts4.8/wasi.d.ts +3 -3
- {node v18.17 → node v18.18/ts4.8}/worker_threads.d.ts +82 -85
- {node v18.17 → node v18.18/ts4.8}/zlib.d.ts +9 -9
- {node v18.17 → node v18.18}/tty.d.ts +10 -10
- {node v18.17 → node v18.18}/url.d.ts +39 -18
- {node v18.17 → node v18.18}/util.d.ts +178 -117
- {node v18.17 → node v18.18}/v8.d.ts +4 -4
- {node v18.17 → node v18.18}/vm.d.ts +60 -42
- {node v18.17 → node v18.18}/wasi.d.ts +3 -3
- {node v18.17/ts4.8 → node v18.18}/worker_threads.d.ts +82 -85
- {node v18.17/ts4.8 → node v18.18}/zlib.d.ts +9 -9
- node v18.17/assert/strict.d.ts +0 -8
- node v18.17/constants.d.ts +0 -18
- node v18.17/dom-events.d.ts +0 -126
- node v18.17/stream/promises.d.ts +0 -42
- node v18.17/ts4.8/assert/strict.d.ts +0 -8
- node v18.17/ts4.8/constants.d.ts +0 -18
- node v18.17/ts4.8/dom-events.d.ts +0 -126
- node v18.17/ts4.8/stream/promises.d.ts +0 -42
- {node v18.17 → node v18.18}/LICENSE +0 -0
- {node v18.17 → node v18.18}/globals.global.d.ts +0 -0
- {node v18.17 → node v18.18}/inspector.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/globals.global.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/index.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/inspector.d.ts +0 -0
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
* stalling the event loop while spawned processes complete.
|
|
66
66
|
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js)
|
|
67
67
|
*/
|
|
68
|
-
declare module
|
|
69
|
-
import { ObjectEncodingOptions } from
|
|
70
|
-
import {
|
|
71
|
-
import * as net from
|
|
72
|
-
import {
|
|
73
|
-
import { URL } from
|
|
68
|
+
declare module "child_process" {
|
|
69
|
+
import { ObjectEncodingOptions } from "node:fs";
|
|
70
|
+
import { Abortable, EventEmitter } from "node:events";
|
|
71
|
+
import * as net from "node:net";
|
|
72
|
+
import { Pipe, Readable, Stream, Writable } from "node:stream";
|
|
73
|
+
import { URL } from "node:url";
|
|
74
74
|
type Serializable = string | object | number | boolean | bigint;
|
|
75
75
|
type SendHandle = net.Socket | net.Server;
|
|
76
76
|
/**
|
|
@@ -189,7 +189,7 @@ declare module 'child_process' {
|
|
|
189
189
|
// stderr
|
|
190
190
|
Readable | Writable | null | undefined,
|
|
191
191
|
// extra
|
|
192
|
-
Readable | Writable | null | undefined // extra
|
|
192
|
+
Readable | Writable | null | undefined, // extra
|
|
193
193
|
];
|
|
194
194
|
/**
|
|
195
195
|
* The `subprocess.killed` property indicates whether the child process
|
|
@@ -305,6 +305,11 @@ declare module 'child_process' {
|
|
|
305
305
|
* @since v0.1.90
|
|
306
306
|
*/
|
|
307
307
|
kill(signal?: NodeJS.Signals | number): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Calls {@link ChildProcess.kill} with `'SIGTERM'`.
|
|
310
|
+
* @since v18.18.0
|
|
311
|
+
*/
|
|
312
|
+
[Symbol.dispose](): void;
|
|
308
313
|
/**
|
|
309
314
|
* When an IPC channel has been established between the parent and child (
|
|
310
315
|
* i.e. when using {@link fork}), the `subprocess.send()` method can
|
|
@@ -457,7 +462,12 @@ declare module 'child_process' {
|
|
|
457
462
|
*/
|
|
458
463
|
send(message: Serializable, callback?: (error: Error | null) => void): boolean;
|
|
459
464
|
send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
|
|
460
|
-
send(
|
|
465
|
+
send(
|
|
466
|
+
message: Serializable,
|
|
467
|
+
sendHandle?: SendHandle,
|
|
468
|
+
options?: MessageOptions,
|
|
469
|
+
callback?: (error: Error | null) => void,
|
|
470
|
+
): boolean;
|
|
461
471
|
/**
|
|
462
472
|
* Closes the IPC channel between parent and child, allowing the child to exit
|
|
463
473
|
* gracefully once there are no other connections keeping it alive. After calling
|
|
@@ -523,47 +533,53 @@ declare module 'child_process' {
|
|
|
523
533
|
* 6. spawn
|
|
524
534
|
*/
|
|
525
535
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
526
|
-
addListener(event:
|
|
527
|
-
addListener(event:
|
|
528
|
-
addListener(event:
|
|
529
|
-
addListener(event:
|
|
530
|
-
addListener(event:
|
|
531
|
-
addListener(event:
|
|
536
|
+
addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
537
|
+
addListener(event: "disconnect", listener: () => void): this;
|
|
538
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
539
|
+
addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
540
|
+
addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
541
|
+
addListener(event: "spawn", listener: () => void): this;
|
|
532
542
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
533
|
-
emit(event:
|
|
534
|
-
emit(event:
|
|
535
|
-
emit(event:
|
|
536
|
-
emit(event:
|
|
537
|
-
emit(event:
|
|
538
|
-
emit(event:
|
|
543
|
+
emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
|
|
544
|
+
emit(event: "disconnect"): boolean;
|
|
545
|
+
emit(event: "error", err: Error): boolean;
|
|
546
|
+
emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
|
|
547
|
+
emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
|
|
548
|
+
emit(event: "spawn", listener: () => void): boolean;
|
|
539
549
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
540
|
-
on(event:
|
|
541
|
-
on(event:
|
|
542
|
-
on(event:
|
|
543
|
-
on(event:
|
|
544
|
-
on(event:
|
|
545
|
-
on(event:
|
|
550
|
+
on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
551
|
+
on(event: "disconnect", listener: () => void): this;
|
|
552
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
553
|
+
on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
554
|
+
on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
555
|
+
on(event: "spawn", listener: () => void): this;
|
|
546
556
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
547
|
-
once(event:
|
|
548
|
-
once(event:
|
|
549
|
-
once(event:
|
|
550
|
-
once(event:
|
|
551
|
-
once(event:
|
|
552
|
-
once(event:
|
|
557
|
+
once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
558
|
+
once(event: "disconnect", listener: () => void): this;
|
|
559
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
560
|
+
once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
561
|
+
once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
562
|
+
once(event: "spawn", listener: () => void): this;
|
|
553
563
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
554
|
-
prependListener(event:
|
|
555
|
-
prependListener(event:
|
|
556
|
-
prependListener(event:
|
|
557
|
-
prependListener(event:
|
|
558
|
-
prependListener(event:
|
|
559
|
-
prependListener(event:
|
|
564
|
+
prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
565
|
+
prependListener(event: "disconnect", listener: () => void): this;
|
|
566
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
567
|
+
prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
568
|
+
prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
569
|
+
prependListener(event: "spawn", listener: () => void): this;
|
|
560
570
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
561
|
-
prependOnceListener(
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
prependOnceListener(event:
|
|
566
|
-
prependOnceListener(event:
|
|
571
|
+
prependOnceListener(
|
|
572
|
+
event: "close",
|
|
573
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
574
|
+
): this;
|
|
575
|
+
prependOnceListener(event: "disconnect", listener: () => void): this;
|
|
576
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
577
|
+
prependOnceListener(
|
|
578
|
+
event: "exit",
|
|
579
|
+
listener: (code: number | null, signal: NodeJS.Signals | null) => void,
|
|
580
|
+
): this;
|
|
581
|
+
prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
|
582
|
+
prependOnceListener(event: "spawn", listener: () => void): this;
|
|
567
583
|
}
|
|
568
584
|
// return this object when stdio option is undefined or not specified
|
|
569
585
|
interface ChildProcessWithoutNullStreams extends ChildProcess {
|
|
@@ -577,11 +593,13 @@ declare module 'child_process' {
|
|
|
577
593
|
// stderr
|
|
578
594
|
Readable | Writable | null | undefined,
|
|
579
595
|
// extra, no modification
|
|
580
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
596
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
581
597
|
];
|
|
582
598
|
}
|
|
583
599
|
// return this object when stdio option is a tuple of 3
|
|
584
|
-
interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
|
|
600
|
+
interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
|
|
601
|
+
extends ChildProcess
|
|
602
|
+
{
|
|
585
603
|
stdin: I;
|
|
586
604
|
stdout: O;
|
|
587
605
|
stderr: E;
|
|
@@ -591,15 +609,15 @@ declare module 'child_process' {
|
|
|
591
609
|
E,
|
|
592
610
|
Readable | Writable | null | undefined,
|
|
593
611
|
// extra, no modification
|
|
594
|
-
Readable | Writable | null | undefined // extra, no modification
|
|
612
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
595
613
|
];
|
|
596
614
|
}
|
|
597
615
|
interface MessageOptions {
|
|
598
616
|
keepOpen?: boolean | undefined;
|
|
599
617
|
}
|
|
600
|
-
type IOType =
|
|
601
|
-
type StdioOptions = IOType | Array<IOType |
|
|
602
|
-
type SerializationType =
|
|
618
|
+
type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
|
|
619
|
+
type StdioOptions = IOType | Array<IOType | "ipc" | Stream | number | null | undefined>;
|
|
620
|
+
type SerializationType = "json" | "advanced";
|
|
603
621
|
interface MessagingOptions extends Abortable {
|
|
604
622
|
/**
|
|
605
623
|
* Specify the kind of serialization used for sending messages between processes.
|
|
@@ -653,10 +671,14 @@ declare module 'child_process' {
|
|
|
653
671
|
interface SpawnOptionsWithoutStdio extends SpawnOptions {
|
|
654
672
|
stdio?: StdioPipeNamed | StdioPipe[] | undefined;
|
|
655
673
|
}
|
|
656
|
-
type StdioNull =
|
|
657
|
-
type StdioPipeNamed =
|
|
674
|
+
type StdioNull = "inherit" | "ignore" | Stream;
|
|
675
|
+
type StdioPipeNamed = "pipe" | "overlapped";
|
|
658
676
|
type StdioPipe = undefined | null | StdioPipeNamed;
|
|
659
|
-
interface SpawnOptionsWithStdioTuple<
|
|
677
|
+
interface SpawnOptionsWithStdioTuple<
|
|
678
|
+
Stdin extends StdioNull | StdioPipe,
|
|
679
|
+
Stdout extends StdioNull | StdioPipe,
|
|
680
|
+
Stderr extends StdioNull | StdioPipe,
|
|
681
|
+
> extends SpawnOptions {
|
|
660
682
|
stdio: [Stdin, Stdout, Stderr];
|
|
661
683
|
}
|
|
662
684
|
/**
|
|
@@ -779,25 +801,85 @@ declare module 'child_process' {
|
|
|
779
801
|
* @param args List of string arguments.
|
|
780
802
|
*/
|
|
781
803
|
function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
|
|
782
|
-
function spawn(
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
function spawn(
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
804
|
+
function spawn(
|
|
805
|
+
command: string,
|
|
806
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
|
|
807
|
+
): ChildProcessByStdio<Writable, Readable, Readable>;
|
|
808
|
+
function spawn(
|
|
809
|
+
command: string,
|
|
810
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
|
|
811
|
+
): ChildProcessByStdio<Writable, Readable, null>;
|
|
812
|
+
function spawn(
|
|
813
|
+
command: string,
|
|
814
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
|
|
815
|
+
): ChildProcessByStdio<Writable, null, Readable>;
|
|
816
|
+
function spawn(
|
|
817
|
+
command: string,
|
|
818
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
|
|
819
|
+
): ChildProcessByStdio<null, Readable, Readable>;
|
|
820
|
+
function spawn(
|
|
821
|
+
command: string,
|
|
822
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
|
|
823
|
+
): ChildProcessByStdio<Writable, null, null>;
|
|
824
|
+
function spawn(
|
|
825
|
+
command: string,
|
|
826
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
|
|
827
|
+
): ChildProcessByStdio<null, Readable, null>;
|
|
828
|
+
function spawn(
|
|
829
|
+
command: string,
|
|
830
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
|
|
831
|
+
): ChildProcessByStdio<null, null, Readable>;
|
|
832
|
+
function spawn(
|
|
833
|
+
command: string,
|
|
834
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
|
|
835
|
+
): ChildProcessByStdio<null, null, null>;
|
|
790
836
|
function spawn(command: string, options: SpawnOptions): ChildProcess;
|
|
791
837
|
// overloads of spawn with 'args'
|
|
792
|
-
function spawn(
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
function spawn(
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
838
|
+
function spawn(
|
|
839
|
+
command: string,
|
|
840
|
+
args?: ReadonlyArray<string>,
|
|
841
|
+
options?: SpawnOptionsWithoutStdio,
|
|
842
|
+
): ChildProcessWithoutNullStreams;
|
|
843
|
+
function spawn(
|
|
844
|
+
command: string,
|
|
845
|
+
args: ReadonlyArray<string>,
|
|
846
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
|
|
847
|
+
): ChildProcessByStdio<Writable, Readable, Readable>;
|
|
848
|
+
function spawn(
|
|
849
|
+
command: string,
|
|
850
|
+
args: ReadonlyArray<string>,
|
|
851
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
|
|
852
|
+
): ChildProcessByStdio<Writable, Readable, null>;
|
|
853
|
+
function spawn(
|
|
854
|
+
command: string,
|
|
855
|
+
args: ReadonlyArray<string>,
|
|
856
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
|
|
857
|
+
): ChildProcessByStdio<Writable, null, Readable>;
|
|
858
|
+
function spawn(
|
|
859
|
+
command: string,
|
|
860
|
+
args: ReadonlyArray<string>,
|
|
861
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
|
|
862
|
+
): ChildProcessByStdio<null, Readable, Readable>;
|
|
863
|
+
function spawn(
|
|
864
|
+
command: string,
|
|
865
|
+
args: ReadonlyArray<string>,
|
|
866
|
+
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
|
|
867
|
+
): ChildProcessByStdio<Writable, null, null>;
|
|
868
|
+
function spawn(
|
|
869
|
+
command: string,
|
|
870
|
+
args: ReadonlyArray<string>,
|
|
871
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
|
|
872
|
+
): ChildProcessByStdio<null, Readable, null>;
|
|
873
|
+
function spawn(
|
|
874
|
+
command: string,
|
|
875
|
+
args: ReadonlyArray<string>,
|
|
876
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
|
|
877
|
+
): ChildProcessByStdio<null, null, Readable>;
|
|
878
|
+
function spawn(
|
|
879
|
+
command: string,
|
|
880
|
+
args: ReadonlyArray<string>,
|
|
881
|
+
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
|
|
882
|
+
): ChildProcessByStdio<null, null, null>;
|
|
801
883
|
function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
|
|
802
884
|
interface ExecOptions extends CommonOptions {
|
|
803
885
|
shell?: string | undefined;
|
|
@@ -902,14 +984,17 @@ declare module 'child_process' {
|
|
|
902
984
|
* @param command The command to run, with space-separated arguments.
|
|
903
985
|
* @param callback called with the output when process terminates.
|
|
904
986
|
*/
|
|
905
|
-
function exec(
|
|
987
|
+
function exec(
|
|
988
|
+
command: string,
|
|
989
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
990
|
+
): ChildProcess;
|
|
906
991
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
907
992
|
function exec(
|
|
908
993
|
command: string,
|
|
909
994
|
options: {
|
|
910
|
-
encoding:
|
|
995
|
+
encoding: "buffer" | null;
|
|
911
996
|
} & ExecOptions,
|
|
912
|
-
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void
|
|
997
|
+
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
913
998
|
): ChildProcess;
|
|
914
999
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
915
1000
|
function exec(
|
|
@@ -917,7 +1002,7 @@ declare module 'child_process' {
|
|
|
917
1002
|
options: {
|
|
918
1003
|
encoding: BufferEncoding;
|
|
919
1004
|
} & ExecOptions,
|
|
920
|
-
callback?: (error: ExecException | null, stdout: string, stderr: string) => void
|
|
1005
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
921
1006
|
): ChildProcess;
|
|
922
1007
|
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
923
1008
|
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
@@ -926,15 +1011,19 @@ declare module 'child_process' {
|
|
|
926
1011
|
options: {
|
|
927
1012
|
encoding: BufferEncoding;
|
|
928
1013
|
} & ExecOptions,
|
|
929
|
-
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1014
|
+
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
930
1015
|
): ChildProcess;
|
|
931
1016
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
932
|
-
function exec(
|
|
1017
|
+
function exec(
|
|
1018
|
+
command: string,
|
|
1019
|
+
options: ExecOptions,
|
|
1020
|
+
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
1021
|
+
): ChildProcess;
|
|
933
1022
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
934
1023
|
function exec(
|
|
935
1024
|
command: string,
|
|
936
1025
|
options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
|
|
937
|
-
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1026
|
+
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
938
1027
|
): ChildProcess;
|
|
939
1028
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
940
1029
|
child: ChildProcess;
|
|
@@ -947,8 +1036,8 @@ declare module 'child_process' {
|
|
|
947
1036
|
function __promisify__(
|
|
948
1037
|
command: string,
|
|
949
1038
|
options: {
|
|
950
|
-
encoding:
|
|
951
|
-
} & ExecOptions
|
|
1039
|
+
encoding: "buffer" | null;
|
|
1040
|
+
} & ExecOptions,
|
|
952
1041
|
): PromiseWithChild<{
|
|
953
1042
|
stdout: Buffer;
|
|
954
1043
|
stderr: Buffer;
|
|
@@ -957,21 +1046,21 @@ declare module 'child_process' {
|
|
|
957
1046
|
command: string,
|
|
958
1047
|
options: {
|
|
959
1048
|
encoding: BufferEncoding;
|
|
960
|
-
} & ExecOptions
|
|
1049
|
+
} & ExecOptions,
|
|
961
1050
|
): PromiseWithChild<{
|
|
962
1051
|
stdout: string;
|
|
963
1052
|
stderr: string;
|
|
964
1053
|
}>;
|
|
965
1054
|
function __promisify__(
|
|
966
1055
|
command: string,
|
|
967
|
-
options: ExecOptions
|
|
1056
|
+
options: ExecOptions,
|
|
968
1057
|
): PromiseWithChild<{
|
|
969
1058
|
stdout: string;
|
|
970
1059
|
stderr: string;
|
|
971
1060
|
}>;
|
|
972
1061
|
function __promisify__(
|
|
973
1062
|
command: string,
|
|
974
|
-
options?: (ObjectEncodingOptions & ExecOptions) | null
|
|
1063
|
+
options?: (ObjectEncodingOptions & ExecOptions) | null,
|
|
975
1064
|
): PromiseWithChild<{
|
|
976
1065
|
stdout: string | Buffer;
|
|
977
1066
|
stderr: string | Buffer;
|
|
@@ -988,14 +1077,14 @@ declare module 'child_process' {
|
|
|
988
1077
|
encoding: BufferEncoding;
|
|
989
1078
|
}
|
|
990
1079
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
|
991
|
-
encoding:
|
|
1080
|
+
encoding: "buffer" | null;
|
|
992
1081
|
}
|
|
993
1082
|
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
|
994
1083
|
encoding: BufferEncoding;
|
|
995
1084
|
}
|
|
996
1085
|
type ExecFileException =
|
|
997
|
-
& Omit<ExecException,
|
|
998
|
-
& Omit<NodeJS.ErrnoException,
|
|
1086
|
+
& Omit<ExecException, "code">
|
|
1087
|
+
& Omit<NodeJS.ErrnoException, "code">
|
|
999
1088
|
& { code?: string | number | undefined | null };
|
|
1000
1089
|
/**
|
|
1001
1090
|
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
|
@@ -1061,56 +1150,92 @@ declare module 'child_process' {
|
|
|
1061
1150
|
* @param callback Called with the output when process terminates.
|
|
1062
1151
|
*/
|
|
1063
1152
|
function execFile(file: string): ChildProcess;
|
|
1064
|
-
function execFile(
|
|
1153
|
+
function execFile(
|
|
1154
|
+
file: string,
|
|
1155
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1156
|
+
): ChildProcess;
|
|
1065
1157
|
function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
|
|
1066
|
-
function execFile(
|
|
1158
|
+
function execFile(
|
|
1159
|
+
file: string,
|
|
1160
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1161
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1162
|
+
): ChildProcess;
|
|
1067
1163
|
// no `options` definitely means stdout/stderr are `string`.
|
|
1068
|
-
function execFile(
|
|
1069
|
-
|
|
1164
|
+
function execFile(
|
|
1165
|
+
file: string,
|
|
1166
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1167
|
+
): ChildProcess;
|
|
1168
|
+
function execFile(
|
|
1169
|
+
file: string,
|
|
1170
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1171
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1172
|
+
): ChildProcess;
|
|
1070
1173
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
1071
|
-
function execFile(
|
|
1174
|
+
function execFile(
|
|
1175
|
+
file: string,
|
|
1176
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1177
|
+
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1178
|
+
): ChildProcess;
|
|
1072
1179
|
function execFile(
|
|
1073
1180
|
file: string,
|
|
1074
1181
|
args: ReadonlyArray<string> | undefined | null,
|
|
1075
1182
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1076
|
-
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
|
|
1183
|
+
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1077
1184
|
): ChildProcess;
|
|
1078
1185
|
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
|
1079
|
-
function execFile(
|
|
1186
|
+
function execFile(
|
|
1187
|
+
file: string,
|
|
1188
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1189
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1190
|
+
): ChildProcess;
|
|
1080
1191
|
function execFile(
|
|
1081
1192
|
file: string,
|
|
1082
1193
|
args: ReadonlyArray<string> | undefined | null,
|
|
1083
1194
|
options: ExecFileOptionsWithStringEncoding,
|
|
1084
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
|
|
1195
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1085
1196
|
): ChildProcess;
|
|
1086
1197
|
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
1087
1198
|
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
1088
|
-
function execFile(
|
|
1199
|
+
function execFile(
|
|
1200
|
+
file: string,
|
|
1201
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1202
|
+
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1203
|
+
): ChildProcess;
|
|
1089
1204
|
function execFile(
|
|
1090
1205
|
file: string,
|
|
1091
1206
|
args: ReadonlyArray<string> | undefined | null,
|
|
1092
1207
|
options: ExecFileOptionsWithOtherEncoding,
|
|
1093
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
|
|
1208
|
+
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1094
1209
|
): ChildProcess;
|
|
1095
1210
|
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
1096
|
-
function execFile(
|
|
1211
|
+
function execFile(
|
|
1212
|
+
file: string,
|
|
1213
|
+
options: ExecFileOptions,
|
|
1214
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1215
|
+
): ChildProcess;
|
|
1097
1216
|
function execFile(
|
|
1098
1217
|
file: string,
|
|
1099
1218
|
args: ReadonlyArray<string> | undefined | null,
|
|
1100
1219
|
options: ExecFileOptions,
|
|
1101
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
|
|
1220
|
+
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1102
1221
|
): ChildProcess;
|
|
1103
1222
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1104
1223
|
function execFile(
|
|
1105
1224
|
file: string,
|
|
1106
1225
|
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1107
|
-
callback:
|
|
1226
|
+
callback:
|
|
1227
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1228
|
+
| undefined
|
|
1229
|
+
| null,
|
|
1108
1230
|
): ChildProcess;
|
|
1109
1231
|
function execFile(
|
|
1110
1232
|
file: string,
|
|
1111
1233
|
args: ReadonlyArray<string> | undefined | null,
|
|
1112
1234
|
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1113
|
-
callback:
|
|
1235
|
+
callback:
|
|
1236
|
+
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1237
|
+
| undefined
|
|
1238
|
+
| null,
|
|
1114
1239
|
): ChildProcess;
|
|
1115
1240
|
namespace execFile {
|
|
1116
1241
|
function __promisify__(file: string): PromiseWithChild<{
|
|
@@ -1119,14 +1244,14 @@ declare module 'child_process' {
|
|
|
1119
1244
|
}>;
|
|
1120
1245
|
function __promisify__(
|
|
1121
1246
|
file: string,
|
|
1122
|
-
args: ReadonlyArray<string> | undefined | null
|
|
1247
|
+
args: ReadonlyArray<string> | undefined | null,
|
|
1123
1248
|
): PromiseWithChild<{
|
|
1124
1249
|
stdout: string;
|
|
1125
1250
|
stderr: string;
|
|
1126
1251
|
}>;
|
|
1127
1252
|
function __promisify__(
|
|
1128
1253
|
file: string,
|
|
1129
|
-
options: ExecFileOptionsWithBufferEncoding
|
|
1254
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1130
1255
|
): PromiseWithChild<{
|
|
1131
1256
|
stdout: Buffer;
|
|
1132
1257
|
stderr: Buffer;
|
|
@@ -1134,14 +1259,14 @@ declare module 'child_process' {
|
|
|
1134
1259
|
function __promisify__(
|
|
1135
1260
|
file: string,
|
|
1136
1261
|
args: ReadonlyArray<string> | undefined | null,
|
|
1137
|
-
options: ExecFileOptionsWithBufferEncoding
|
|
1262
|
+
options: ExecFileOptionsWithBufferEncoding,
|
|
1138
1263
|
): PromiseWithChild<{
|
|
1139
1264
|
stdout: Buffer;
|
|
1140
1265
|
stderr: Buffer;
|
|
1141
1266
|
}>;
|
|
1142
1267
|
function __promisify__(
|
|
1143
1268
|
file: string,
|
|
1144
|
-
options: ExecFileOptionsWithStringEncoding
|
|
1269
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1145
1270
|
): PromiseWithChild<{
|
|
1146
1271
|
stdout: string;
|
|
1147
1272
|
stderr: string;
|
|
@@ -1149,14 +1274,14 @@ declare module 'child_process' {
|
|
|
1149
1274
|
function __promisify__(
|
|
1150
1275
|
file: string,
|
|
1151
1276
|
args: ReadonlyArray<string> | undefined | null,
|
|
1152
|
-
options: ExecFileOptionsWithStringEncoding
|
|
1277
|
+
options: ExecFileOptionsWithStringEncoding,
|
|
1153
1278
|
): PromiseWithChild<{
|
|
1154
1279
|
stdout: string;
|
|
1155
1280
|
stderr: string;
|
|
1156
1281
|
}>;
|
|
1157
1282
|
function __promisify__(
|
|
1158
1283
|
file: string,
|
|
1159
|
-
options: ExecFileOptionsWithOtherEncoding
|
|
1284
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1160
1285
|
): PromiseWithChild<{
|
|
1161
1286
|
stdout: string | Buffer;
|
|
1162
1287
|
stderr: string | Buffer;
|
|
@@ -1164,14 +1289,14 @@ declare module 'child_process' {
|
|
|
1164
1289
|
function __promisify__(
|
|
1165
1290
|
file: string,
|
|
1166
1291
|
args: ReadonlyArray<string> | undefined | null,
|
|
1167
|
-
options: ExecFileOptionsWithOtherEncoding
|
|
1292
|
+
options: ExecFileOptionsWithOtherEncoding,
|
|
1168
1293
|
): PromiseWithChild<{
|
|
1169
1294
|
stdout: string | Buffer;
|
|
1170
1295
|
stderr: string | Buffer;
|
|
1171
1296
|
}>;
|
|
1172
1297
|
function __promisify__(
|
|
1173
1298
|
file: string,
|
|
1174
|
-
options: ExecFileOptions
|
|
1299
|
+
options: ExecFileOptions,
|
|
1175
1300
|
): PromiseWithChild<{
|
|
1176
1301
|
stdout: string;
|
|
1177
1302
|
stderr: string;
|
|
@@ -1179,14 +1304,14 @@ declare module 'child_process' {
|
|
|
1179
1304
|
function __promisify__(
|
|
1180
1305
|
file: string,
|
|
1181
1306
|
args: ReadonlyArray<string> | undefined | null,
|
|
1182
|
-
options: ExecFileOptions
|
|
1307
|
+
options: ExecFileOptions,
|
|
1183
1308
|
): PromiseWithChild<{
|
|
1184
1309
|
stdout: string;
|
|
1185
1310
|
stderr: string;
|
|
1186
1311
|
}>;
|
|
1187
1312
|
function __promisify__(
|
|
1188
1313
|
file: string,
|
|
1189
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
|
|
1314
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1190
1315
|
): PromiseWithChild<{
|
|
1191
1316
|
stdout: string | Buffer;
|
|
1192
1317
|
stderr: string | Buffer;
|
|
@@ -1194,7 +1319,7 @@ declare module 'child_process' {
|
|
|
1194
1319
|
function __promisify__(
|
|
1195
1320
|
file: string,
|
|
1196
1321
|
args: ReadonlyArray<string> | undefined | null,
|
|
1197
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
|
|
1322
|
+
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1198
1323
|
): PromiseWithChild<{
|
|
1199
1324
|
stdout: string | Buffer;
|
|
1200
1325
|
stderr: string | Buffer;
|
|
@@ -1271,13 +1396,13 @@ declare module 'child_process' {
|
|
|
1271
1396
|
interface SpawnSyncOptions extends CommonSpawnOptions {
|
|
1272
1397
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1273
1398
|
maxBuffer?: number | undefined;
|
|
1274
|
-
encoding?: BufferEncoding |
|
|
1399
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
1275
1400
|
}
|
|
1276
1401
|
interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
|
1277
1402
|
encoding: BufferEncoding;
|
|
1278
1403
|
}
|
|
1279
1404
|
interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
|
1280
|
-
encoding?:
|
|
1405
|
+
encoding?: "buffer" | null | undefined;
|
|
1281
1406
|
}
|
|
1282
1407
|
interface SpawnSyncReturns<T> {
|
|
1283
1408
|
pid: number;
|
|
@@ -1308,9 +1433,21 @@ declare module 'child_process' {
|
|
|
1308
1433
|
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
|
1309
1434
|
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
|
|
1310
1435
|
function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
|
|
1311
|
-
function spawnSync(
|
|
1312
|
-
|
|
1313
|
-
|
|
1436
|
+
function spawnSync(
|
|
1437
|
+
command: string,
|
|
1438
|
+
args: ReadonlyArray<string>,
|
|
1439
|
+
options: SpawnSyncOptionsWithStringEncoding,
|
|
1440
|
+
): SpawnSyncReturns<string>;
|
|
1441
|
+
function spawnSync(
|
|
1442
|
+
command: string,
|
|
1443
|
+
args: ReadonlyArray<string>,
|
|
1444
|
+
options: SpawnSyncOptionsWithBufferEncoding,
|
|
1445
|
+
): SpawnSyncReturns<Buffer>;
|
|
1446
|
+
function spawnSync(
|
|
1447
|
+
command: string,
|
|
1448
|
+
args?: ReadonlyArray<string>,
|
|
1449
|
+
options?: SpawnSyncOptions,
|
|
1450
|
+
): SpawnSyncReturns<string | Buffer>;
|
|
1314
1451
|
interface CommonExecOptions extends CommonOptions {
|
|
1315
1452
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1316
1453
|
/**
|
|
@@ -1325,7 +1462,7 @@ declare module 'child_process' {
|
|
|
1325
1462
|
stdio?: StdioOptions | undefined;
|
|
1326
1463
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
1327
1464
|
maxBuffer?: number | undefined;
|
|
1328
|
-
encoding?: BufferEncoding |
|
|
1465
|
+
encoding?: BufferEncoding | "buffer" | null | undefined;
|
|
1329
1466
|
}
|
|
1330
1467
|
interface ExecSyncOptions extends CommonExecOptions {
|
|
1331
1468
|
shell?: string | undefined;
|
|
@@ -1334,7 +1471,7 @@ declare module 'child_process' {
|
|
|
1334
1471
|
encoding: BufferEncoding;
|
|
1335
1472
|
}
|
|
1336
1473
|
interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
|
1337
|
-
encoding?:
|
|
1474
|
+
encoding?: "buffer" | null | undefined;
|
|
1338
1475
|
}
|
|
1339
1476
|
/**
|
|
1340
1477
|
* The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
|
|
@@ -1363,7 +1500,7 @@ declare module 'child_process' {
|
|
|
1363
1500
|
encoding: BufferEncoding;
|
|
1364
1501
|
}
|
|
1365
1502
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1366
|
-
encoding?:
|
|
1503
|
+
encoding?: "buffer" | null; // specify `null`.
|
|
1367
1504
|
}
|
|
1368
1505
|
/**
|
|
1369
1506
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
|
@@ -1390,10 +1527,18 @@ declare module 'child_process' {
|
|
|
1390
1527
|
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
|
1391
1528
|
function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
|
|
1392
1529
|
function execFileSync(file: string, args: ReadonlyArray<string>): Buffer;
|
|
1393
|
-
function execFileSync(
|
|
1394
|
-
|
|
1530
|
+
function execFileSync(
|
|
1531
|
+
file: string,
|
|
1532
|
+
args: ReadonlyArray<string>,
|
|
1533
|
+
options: ExecFileSyncOptionsWithStringEncoding,
|
|
1534
|
+
): string;
|
|
1535
|
+
function execFileSync(
|
|
1536
|
+
file: string,
|
|
1537
|
+
args: ReadonlyArray<string>,
|
|
1538
|
+
options: ExecFileSyncOptionsWithBufferEncoding,
|
|
1539
|
+
): Buffer;
|
|
1395
1540
|
function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
|
|
1396
1541
|
}
|
|
1397
|
-
declare module
|
|
1398
|
-
export * from
|
|
1542
|
+
declare module "node:child_process" {
|
|
1543
|
+
export * from "child_process";
|
|
1399
1544
|
}
|