@types/node 20.6.2 → 20.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. node/README.md +1 -1
  2. node/assert/strict.d.ts +4 -4
  3. node/assert.d.ts +48 -24
  4. node/async_hooks.d.ts +13 -6
  5. node/buffer.d.ts +32 -34
  6. node/child_process.d.ts +262 -122
  7. node/cluster.d.ts +107 -89
  8. node/console.d.ts +7 -7
  9. node/constants.d.ts +12 -11
  10. node/crypto.d.ts +746 -268
  11. node/dgram.d.ts +81 -45
  12. node/diagnostics_channel.d.ts +3 -3
  13. node/dns/promises.d.ts +28 -25
  14. node/dns.d.ts +203 -62
  15. node/dom-events.d.ts +67 -71
  16. node/domain.d.ts +4 -4
  17. node/events.d.ts +15 -7
  18. node/fs/promises.d.ts +102 -73
  19. node/fs.d.ts +513 -311
  20. node/globals.d.ts +18 -20
  21. node/http.d.ts +238 -186
  22. node/http2.d.ts +628 -376
  23. node/https.d.ts +221 -112
  24. node/inspector.d.ts +3 -3
  25. node/module.d.ts +16 -9
  26. node/net.d.ts +112 -93
  27. node/os.d.ts +7 -7
  28. node/package.json +2 -2
  29. node/path.d.ts +13 -13
  30. node/perf_hooks.d.ts +19 -18
  31. node/process.d.ts +155 -125
  32. node/punycode.d.ts +3 -3
  33. node/querystring.d.ts +14 -4
  34. node/readline/promises.d.ts +12 -7
  35. node/readline.d.ts +69 -56
  36. node/repl.d.ts +67 -61
  37. node/stream/consumers.d.ts +5 -5
  38. node/stream/promises.d.ts +56 -15
  39. node/stream/web.d.ts +26 -20
  40. node/stream.d.ts +361 -228
  41. node/string_decoder.d.ts +3 -3
  42. node/test.d.ts +78 -93
  43. node/timers/promises.d.ts +4 -4
  44. node/timers.d.ts +23 -8
  45. node/tls.d.ts +151 -71
  46. node/trace_events.d.ts +3 -3
  47. node/ts4.8/assert/strict.d.ts +4 -4
  48. node/ts4.8/assert.d.ts +48 -24
  49. node/ts4.8/async_hooks.d.ts +13 -6
  50. node/ts4.8/buffer.d.ts +32 -34
  51. node/ts4.8/child_process.d.ts +262 -122
  52. node/ts4.8/cluster.d.ts +107 -89
  53. node/ts4.8/console.d.ts +7 -7
  54. node/ts4.8/constants.d.ts +12 -11
  55. node/ts4.8/crypto.d.ts +746 -268
  56. node/ts4.8/dgram.d.ts +81 -45
  57. node/ts4.8/diagnostics_channel.d.ts +3 -3
  58. node/ts4.8/dns/promises.d.ts +28 -25
  59. node/ts4.8/dns.d.ts +203 -62
  60. node/ts4.8/dom-events.d.ts +67 -71
  61. node/ts4.8/domain.d.ts +4 -4
  62. node/ts4.8/events.d.ts +15 -7
  63. node/ts4.8/fs/promises.d.ts +102 -73
  64. node/ts4.8/fs.d.ts +513 -311
  65. node/ts4.8/globals.d.ts +18 -20
  66. node/ts4.8/http.d.ts +238 -186
  67. node/ts4.8/http2.d.ts +628 -376
  68. node/ts4.8/https.d.ts +221 -112
  69. node/ts4.8/inspector.d.ts +3 -3
  70. node/ts4.8/module.d.ts +16 -9
  71. node/ts4.8/net.d.ts +112 -93
  72. node/ts4.8/os.d.ts +7 -7
  73. node/ts4.8/path.d.ts +13 -13
  74. node/ts4.8/perf_hooks.d.ts +19 -18
  75. node/ts4.8/process.d.ts +155 -125
  76. node/ts4.8/punycode.d.ts +3 -3
  77. node/ts4.8/querystring.d.ts +14 -4
  78. node/ts4.8/readline/promises.d.ts +12 -7
  79. node/ts4.8/readline.d.ts +69 -56
  80. node/ts4.8/repl.d.ts +67 -61
  81. node/ts4.8/stream/consumers.d.ts +5 -5
  82. node/ts4.8/stream/promises.d.ts +56 -15
  83. node/ts4.8/stream/web.d.ts +26 -20
  84. node/ts4.8/stream.d.ts +326 -219
  85. node/ts4.8/string_decoder.d.ts +3 -3
  86. node/ts4.8/test.d.ts +78 -93
  87. node/ts4.8/timers/promises.d.ts +4 -4
  88. node/ts4.8/timers.d.ts +23 -8
  89. node/ts4.8/tls.d.ts +151 -71
  90. node/ts4.8/trace_events.d.ts +3 -3
  91. node/ts4.8/tty.d.ts +10 -10
  92. node/ts4.8/url.d.ts +26 -14
  93. node/ts4.8/util.d.ts +178 -116
  94. node/ts4.8/v8.d.ts +4 -4
  95. node/ts4.8/vm.d.ts +52 -46
  96. node/ts4.8/wasi.d.ts +3 -3
  97. node/ts4.8/worker_threads.d.ts +81 -84
  98. node/ts4.8/zlib.d.ts +9 -9
  99. node/tty.d.ts +10 -10
  100. node/url.d.ts +26 -14
  101. node/util.d.ts +178 -116
  102. node/v8.d.ts +4 -4
  103. node/vm.d.ts +52 -46
  104. node/wasi.d.ts +3 -3
  105. node/worker_threads.d.ts +81 -84
  106. node/zlib.d.ts +9 -9
node/child_process.d.ts CHANGED
@@ -65,12 +65,12 @@
65
65
  * stalling the event loop while spawned processes complete.
66
66
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js)
67
67
  */
68
- declare module 'node:child_process' {
69
- import { ObjectEncodingOptions } from 'node:fs';
70
- import { EventEmitter, Abortable } from 'node:events';
71
- import * as net from 'node:net';
72
- import { Writable, Readable, Stream, Pipe } from 'node:stream';
73
- import { URL } from 'node:url';
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
  /**
@@ -186,7 +186,7 @@ declare module 'node: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
@@ -458,7 +458,12 @@ declare module 'node:child_process' {
458
458
  */
459
459
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
460
460
  send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
461
- send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
461
+ send(
462
+ message: Serializable,
463
+ sendHandle?: SendHandle,
464
+ options?: MessageOptions,
465
+ callback?: (error: Error | null) => void,
466
+ ): boolean;
462
467
  /**
463
468
  * Closes the IPC channel between parent and child, allowing the child to exit
464
469
  * gracefully once there are no other connections keeping it alive. After calling
@@ -524,47 +529,53 @@ declare module 'node:child_process' {
524
529
  * 6. spawn
525
530
  */
526
531
  addListener(event: string, listener: (...args: any[]) => void): this;
527
- addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
528
- addListener(event: 'disconnect', listener: () => void): this;
529
- addListener(event: 'error', listener: (err: Error) => void): this;
530
- addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
531
- addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
532
- addListener(event: 'spawn', listener: () => void): this;
532
+ addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
533
+ addListener(event: "disconnect", listener: () => void): this;
534
+ addListener(event: "error", listener: (err: Error) => void): this;
535
+ addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
536
+ addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
537
+ addListener(event: "spawn", listener: () => void): this;
533
538
  emit(event: string | symbol, ...args: any[]): boolean;
534
- emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean;
535
- emit(event: 'disconnect'): boolean;
536
- emit(event: 'error', err: Error): boolean;
537
- emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean;
538
- emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean;
539
- emit(event: 'spawn', listener: () => void): boolean;
539
+ emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
540
+ emit(event: "disconnect"): boolean;
541
+ emit(event: "error", err: Error): boolean;
542
+ emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
543
+ emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
544
+ emit(event: "spawn", listener: () => void): boolean;
540
545
  on(event: string, listener: (...args: any[]) => void): this;
541
- on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
542
- on(event: 'disconnect', listener: () => void): this;
543
- on(event: 'error', listener: (err: Error) => void): this;
544
- on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
545
- on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
546
- on(event: 'spawn', listener: () => void): this;
546
+ on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
547
+ on(event: "disconnect", listener: () => void): this;
548
+ on(event: "error", listener: (err: Error) => void): this;
549
+ on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
550
+ on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
551
+ on(event: "spawn", listener: () => void): this;
547
552
  once(event: string, listener: (...args: any[]) => void): this;
548
- once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
549
- once(event: 'disconnect', listener: () => void): this;
550
- once(event: 'error', listener: (err: Error) => void): this;
551
- once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
552
- once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
553
- once(event: 'spawn', listener: () => void): this;
553
+ once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
554
+ once(event: "disconnect", listener: () => void): this;
555
+ once(event: "error", listener: (err: Error) => void): this;
556
+ once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
557
+ once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
558
+ once(event: "spawn", listener: () => void): this;
554
559
  prependListener(event: string, listener: (...args: any[]) => void): this;
555
- prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
556
- prependListener(event: 'disconnect', listener: () => void): this;
557
- prependListener(event: 'error', listener: (err: Error) => void): this;
558
- prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
559
- prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
560
- prependListener(event: 'spawn', listener: () => void): this;
560
+ prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
561
+ prependListener(event: "disconnect", listener: () => void): this;
562
+ prependListener(event: "error", listener: (err: Error) => void): this;
563
+ prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
564
+ prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
565
+ prependListener(event: "spawn", listener: () => void): this;
561
566
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
562
- prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
563
- prependOnceListener(event: 'disconnect', listener: () => void): this;
564
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
565
- prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
566
- prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
567
- prependOnceListener(event: 'spawn', listener: () => void): this;
567
+ prependOnceListener(
568
+ event: "close",
569
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
570
+ ): this;
571
+ prependOnceListener(event: "disconnect", listener: () => void): this;
572
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
573
+ prependOnceListener(
574
+ event: "exit",
575
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
576
+ ): this;
577
+ prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
578
+ prependOnceListener(event: "spawn", listener: () => void): this;
568
579
  }
569
580
  // return this object when stdio option is undefined or not specified
570
581
  interface ChildProcessWithoutNullStreams extends ChildProcess {
@@ -578,11 +589,13 @@ declare module 'node:child_process' {
578
589
  // stderr
579
590
  Readable | Writable | null | undefined,
580
591
  // extra, no modification
581
- Readable | Writable | null | undefined // extra, no modification
592
+ Readable | Writable | null | undefined, // extra, no modification
582
593
  ];
583
594
  }
584
595
  // return this object when stdio option is a tuple of 3
585
- interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable> extends ChildProcess {
596
+ interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable>
597
+ extends ChildProcess
598
+ {
586
599
  stdin: I;
587
600
  stdout: O;
588
601
  stderr: E;
@@ -592,15 +605,15 @@ declare module 'node:child_process' {
592
605
  E,
593
606
  Readable | Writable | null | undefined,
594
607
  // extra, no modification
595
- Readable | Writable | null | undefined // extra, no modification
608
+ Readable | Writable | null | undefined, // extra, no modification
596
609
  ];
597
610
  }
598
611
  interface MessageOptions {
599
612
  keepOpen?: boolean | undefined;
600
613
  }
601
- type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit';
602
- type StdioOptions = IOType | Array<IOType | 'ipc' | Stream | number | null | undefined>;
603
- type SerializationType = 'json' | 'advanced';
614
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
615
+ type StdioOptions = IOType | Array<IOType | "ipc" | Stream | number | null | undefined>;
616
+ type SerializationType = "json" | "advanced";
604
617
  interface MessagingOptions extends Abortable {
605
618
  /**
606
619
  * Specify the kind of serialization used for sending messages between processes.
@@ -654,10 +667,14 @@ declare module 'node:child_process' {
654
667
  interface SpawnOptionsWithoutStdio extends SpawnOptions {
655
668
  stdio?: StdioPipeNamed | StdioPipe[] | undefined;
656
669
  }
657
- type StdioNull = 'inherit' | 'ignore' | Stream;
658
- type StdioPipeNamed = 'pipe' | 'overlapped';
670
+ type StdioNull = "inherit" | "ignore" | Stream;
671
+ type StdioPipeNamed = "pipe" | "overlapped";
659
672
  type StdioPipe = undefined | null | StdioPipeNamed;
660
- interface SpawnOptionsWithStdioTuple<Stdin extends StdioNull | StdioPipe, Stdout extends StdioNull | StdioPipe, Stderr extends StdioNull | StdioPipe> extends SpawnOptions {
673
+ interface SpawnOptionsWithStdioTuple<
674
+ Stdin extends StdioNull | StdioPipe,
675
+ Stdout extends StdioNull | StdioPipe,
676
+ Stderr extends StdioNull | StdioPipe,
677
+ > extends SpawnOptions {
661
678
  stdio: [Stdin, Stdout, Stderr];
662
679
  }
663
680
  /**
@@ -780,25 +797,85 @@ declare module 'node:child_process' {
780
797
  * @param args List of string arguments.
781
798
  */
782
799
  function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
783
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>): ChildProcessByStdio<Writable, Readable, Readable>;
784
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>): ChildProcessByStdio<Writable, Readable, null>;
785
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>): ChildProcessByStdio<Writable, null, Readable>;
786
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>): ChildProcessByStdio<null, Readable, Readable>;
787
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>): ChildProcessByStdio<Writable, null, null>;
788
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>): ChildProcessByStdio<null, Readable, null>;
789
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>): ChildProcessByStdio<null, null, Readable>;
790
- function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<null, null, null>;
800
+ function spawn(
801
+ command: string,
802
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
803
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
804
+ function spawn(
805
+ command: string,
806
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
807
+ ): ChildProcessByStdio<Writable, Readable, null>;
808
+ function spawn(
809
+ command: string,
810
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
811
+ ): ChildProcessByStdio<Writable, null, Readable>;
812
+ function spawn(
813
+ command: string,
814
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
815
+ ): ChildProcessByStdio<null, Readable, Readable>;
816
+ function spawn(
817
+ command: string,
818
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
819
+ ): ChildProcessByStdio<Writable, null, null>;
820
+ function spawn(
821
+ command: string,
822
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
823
+ ): ChildProcessByStdio<null, Readable, null>;
824
+ function spawn(
825
+ command: string,
826
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
827
+ ): ChildProcessByStdio<null, null, Readable>;
828
+ function spawn(
829
+ command: string,
830
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
831
+ ): ChildProcessByStdio<null, null, null>;
791
832
  function spawn(command: string, options: SpawnOptions): ChildProcess;
792
833
  // overloads of spawn with 'args'
793
- function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
794
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>): ChildProcessByStdio<Writable, Readable, Readable>;
795
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>): ChildProcessByStdio<Writable, Readable, null>;
796
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>): ChildProcessByStdio<Writable, null, Readable>;
797
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>): ChildProcessByStdio<null, Readable, Readable>;
798
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>): ChildProcessByStdio<Writable, null, null>;
799
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>): ChildProcessByStdio<null, Readable, null>;
800
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>): ChildProcessByStdio<null, null, Readable>;
801
- function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<null, null, null>;
834
+ function spawn(
835
+ command: string,
836
+ args?: ReadonlyArray<string>,
837
+ options?: SpawnOptionsWithoutStdio,
838
+ ): ChildProcessWithoutNullStreams;
839
+ function spawn(
840
+ command: string,
841
+ args: ReadonlyArray<string>,
842
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
843
+ ): ChildProcessByStdio<Writable, Readable, Readable>;
844
+ function spawn(
845
+ command: string,
846
+ args: ReadonlyArray<string>,
847
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
848
+ ): ChildProcessByStdio<Writable, Readable, null>;
849
+ function spawn(
850
+ command: string,
851
+ args: ReadonlyArray<string>,
852
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
853
+ ): ChildProcessByStdio<Writable, null, Readable>;
854
+ function spawn(
855
+ command: string,
856
+ args: ReadonlyArray<string>,
857
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
858
+ ): ChildProcessByStdio<null, Readable, Readable>;
859
+ function spawn(
860
+ command: string,
861
+ args: ReadonlyArray<string>,
862
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
863
+ ): ChildProcessByStdio<Writable, null, null>;
864
+ function spawn(
865
+ command: string,
866
+ args: ReadonlyArray<string>,
867
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
868
+ ): ChildProcessByStdio<null, Readable, null>;
869
+ function spawn(
870
+ command: string,
871
+ args: ReadonlyArray<string>,
872
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
873
+ ): ChildProcessByStdio<null, null, Readable>;
874
+ function spawn(
875
+ command: string,
876
+ args: ReadonlyArray<string>,
877
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
878
+ ): ChildProcessByStdio<null, null, null>;
802
879
  function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
803
880
  interface ExecOptions extends CommonOptions {
804
881
  shell?: string | undefined;
@@ -903,14 +980,17 @@ declare module 'node:child_process' {
903
980
  * @param command The command to run, with space-separated arguments.
904
981
  * @param callback called with the output when process terminates.
905
982
  */
906
- function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
983
+ function exec(
984
+ command: string,
985
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
986
+ ): ChildProcess;
907
987
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
908
988
  function exec(
909
989
  command: string,
910
990
  options: {
911
- encoding: 'buffer' | null;
991
+ encoding: "buffer" | null;
912
992
  } & ExecOptions,
913
- callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void
993
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
914
994
  ): ChildProcess;
915
995
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
916
996
  function exec(
@@ -918,7 +998,7 @@ declare module 'node:child_process' {
918
998
  options: {
919
999
  encoding: BufferEncoding;
920
1000
  } & ExecOptions,
921
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void
1001
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
922
1002
  ): ChildProcess;
923
1003
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
924
1004
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
@@ -927,15 +1007,19 @@ declare module 'node:child_process' {
927
1007
  options: {
928
1008
  encoding: BufferEncoding;
929
1009
  } & ExecOptions,
930
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
1010
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
931
1011
  ): ChildProcess;
932
1012
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
933
- function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
1013
+ function exec(
1014
+ command: string,
1015
+ options: ExecOptions,
1016
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1017
+ ): ChildProcess;
934
1018
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
935
1019
  function exec(
936
1020
  command: string,
937
1021
  options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
938
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
1022
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
939
1023
  ): ChildProcess;
940
1024
  interface PromiseWithChild<T> extends Promise<T> {
941
1025
  child: ChildProcess;
@@ -948,8 +1032,8 @@ declare module 'node:child_process' {
948
1032
  function __promisify__(
949
1033
  command: string,
950
1034
  options: {
951
- encoding: 'buffer' | null;
952
- } & ExecOptions
1035
+ encoding: "buffer" | null;
1036
+ } & ExecOptions,
953
1037
  ): PromiseWithChild<{
954
1038
  stdout: Buffer;
955
1039
  stderr: Buffer;
@@ -958,21 +1042,21 @@ declare module 'node:child_process' {
958
1042
  command: string,
959
1043
  options: {
960
1044
  encoding: BufferEncoding;
961
- } & ExecOptions
1045
+ } & ExecOptions,
962
1046
  ): PromiseWithChild<{
963
1047
  stdout: string;
964
1048
  stderr: string;
965
1049
  }>;
966
1050
  function __promisify__(
967
1051
  command: string,
968
- options: ExecOptions
1052
+ options: ExecOptions,
969
1053
  ): PromiseWithChild<{
970
1054
  stdout: string;
971
1055
  stderr: string;
972
1056
  }>;
973
1057
  function __promisify__(
974
1058
  command: string,
975
- options?: (ObjectEncodingOptions & ExecOptions) | null
1059
+ options?: (ObjectEncodingOptions & ExecOptions) | null,
976
1060
  ): PromiseWithChild<{
977
1061
  stdout: string | Buffer;
978
1062
  stderr: string | Buffer;
@@ -989,14 +1073,14 @@ declare module 'node:child_process' {
989
1073
  encoding: BufferEncoding;
990
1074
  }
991
1075
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
992
- encoding: 'buffer' | null;
1076
+ encoding: "buffer" | null;
993
1077
  }
994
1078
  interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
995
1079
  encoding: BufferEncoding;
996
1080
  }
997
1081
  type ExecFileException =
998
- & Omit<ExecException, 'code'>
999
- & Omit<NodeJS.ErrnoException, 'code'>
1082
+ & Omit<ExecException, "code">
1083
+ & Omit<NodeJS.ErrnoException, "code">
1000
1084
  & { code?: string | number | undefined | null };
1001
1085
  /**
1002
1086
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
@@ -1062,56 +1146,92 @@ declare module 'node:child_process' {
1062
1146
  * @param callback Called with the output when process terminates.
1063
1147
  */
1064
1148
  function execFile(file: string): ChildProcess;
1065
- function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
1149
+ function execFile(
1150
+ file: string,
1151
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1152
+ ): ChildProcess;
1066
1153
  function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
1067
- function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
1154
+ function execFile(
1155
+ file: string,
1156
+ args: ReadonlyArray<string> | undefined | null,
1157
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1158
+ ): ChildProcess;
1068
1159
  // no `options` definitely means stdout/stderr are `string`.
1069
- function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
1070
- function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
1160
+ function execFile(
1161
+ file: string,
1162
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1163
+ ): ChildProcess;
1164
+ function execFile(
1165
+ file: string,
1166
+ args: ReadonlyArray<string> | undefined | null,
1167
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1168
+ ): ChildProcess;
1071
1169
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1072
- function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
1170
+ function execFile(
1171
+ file: string,
1172
+ options: ExecFileOptionsWithBufferEncoding,
1173
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1174
+ ): ChildProcess;
1073
1175
  function execFile(
1074
1176
  file: string,
1075
1177
  args: ReadonlyArray<string> | undefined | null,
1076
1178
  options: ExecFileOptionsWithBufferEncoding,
1077
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
1179
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1078
1180
  ): ChildProcess;
1079
1181
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1080
- function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
1182
+ function execFile(
1183
+ file: string,
1184
+ options: ExecFileOptionsWithStringEncoding,
1185
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1186
+ ): ChildProcess;
1081
1187
  function execFile(
1082
1188
  file: string,
1083
1189
  args: ReadonlyArray<string> | undefined | null,
1084
1190
  options: ExecFileOptionsWithStringEncoding,
1085
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
1191
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1086
1192
  ): ChildProcess;
1087
1193
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1088
1194
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1089
- function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
1195
+ function execFile(
1196
+ file: string,
1197
+ options: ExecFileOptionsWithOtherEncoding,
1198
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1199
+ ): ChildProcess;
1090
1200
  function execFile(
1091
1201
  file: string,
1092
1202
  args: ReadonlyArray<string> | undefined | null,
1093
1203
  options: ExecFileOptionsWithOtherEncoding,
1094
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
1204
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1095
1205
  ): ChildProcess;
1096
1206
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
1097
- function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
1207
+ function execFile(
1208
+ file: string,
1209
+ options: ExecFileOptions,
1210
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1211
+ ): ChildProcess;
1098
1212
  function execFile(
1099
1213
  file: string,
1100
1214
  args: ReadonlyArray<string> | undefined | null,
1101
1215
  options: ExecFileOptions,
1102
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
1216
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1103
1217
  ): ChildProcess;
1104
1218
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1105
1219
  function execFile(
1106
1220
  file: string,
1107
1221
  options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1108
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
1222
+ callback:
1223
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1224
+ | undefined
1225
+ | null,
1109
1226
  ): ChildProcess;
1110
1227
  function execFile(
1111
1228
  file: string,
1112
1229
  args: ReadonlyArray<string> | undefined | null,
1113
1230
  options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1114
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
1231
+ callback:
1232
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1233
+ | undefined
1234
+ | null,
1115
1235
  ): ChildProcess;
1116
1236
  namespace execFile {
1117
1237
  function __promisify__(file: string): PromiseWithChild<{
@@ -1120,14 +1240,14 @@ declare module 'node:child_process' {
1120
1240
  }>;
1121
1241
  function __promisify__(
1122
1242
  file: string,
1123
- args: ReadonlyArray<string> | undefined | null
1243
+ args: ReadonlyArray<string> | undefined | null,
1124
1244
  ): PromiseWithChild<{
1125
1245
  stdout: string;
1126
1246
  stderr: string;
1127
1247
  }>;
1128
1248
  function __promisify__(
1129
1249
  file: string,
1130
- options: ExecFileOptionsWithBufferEncoding
1250
+ options: ExecFileOptionsWithBufferEncoding,
1131
1251
  ): PromiseWithChild<{
1132
1252
  stdout: Buffer;
1133
1253
  stderr: Buffer;
@@ -1135,14 +1255,14 @@ declare module 'node:child_process' {
1135
1255
  function __promisify__(
1136
1256
  file: string,
1137
1257
  args: ReadonlyArray<string> | undefined | null,
1138
- options: ExecFileOptionsWithBufferEncoding
1258
+ options: ExecFileOptionsWithBufferEncoding,
1139
1259
  ): PromiseWithChild<{
1140
1260
  stdout: Buffer;
1141
1261
  stderr: Buffer;
1142
1262
  }>;
1143
1263
  function __promisify__(
1144
1264
  file: string,
1145
- options: ExecFileOptionsWithStringEncoding
1265
+ options: ExecFileOptionsWithStringEncoding,
1146
1266
  ): PromiseWithChild<{
1147
1267
  stdout: string;
1148
1268
  stderr: string;
@@ -1150,14 +1270,14 @@ declare module 'node:child_process' {
1150
1270
  function __promisify__(
1151
1271
  file: string,
1152
1272
  args: ReadonlyArray<string> | undefined | null,
1153
- options: ExecFileOptionsWithStringEncoding
1273
+ options: ExecFileOptionsWithStringEncoding,
1154
1274
  ): PromiseWithChild<{
1155
1275
  stdout: string;
1156
1276
  stderr: string;
1157
1277
  }>;
1158
1278
  function __promisify__(
1159
1279
  file: string,
1160
- options: ExecFileOptionsWithOtherEncoding
1280
+ options: ExecFileOptionsWithOtherEncoding,
1161
1281
  ): PromiseWithChild<{
1162
1282
  stdout: string | Buffer;
1163
1283
  stderr: string | Buffer;
@@ -1165,14 +1285,14 @@ declare module 'node:child_process' {
1165
1285
  function __promisify__(
1166
1286
  file: string,
1167
1287
  args: ReadonlyArray<string> | undefined | null,
1168
- options: ExecFileOptionsWithOtherEncoding
1288
+ options: ExecFileOptionsWithOtherEncoding,
1169
1289
  ): PromiseWithChild<{
1170
1290
  stdout: string | Buffer;
1171
1291
  stderr: string | Buffer;
1172
1292
  }>;
1173
1293
  function __promisify__(
1174
1294
  file: string,
1175
- options: ExecFileOptions
1295
+ options: ExecFileOptions,
1176
1296
  ): PromiseWithChild<{
1177
1297
  stdout: string;
1178
1298
  stderr: string;
@@ -1180,14 +1300,14 @@ declare module 'node:child_process' {
1180
1300
  function __promisify__(
1181
1301
  file: string,
1182
1302
  args: ReadonlyArray<string> | undefined | null,
1183
- options: ExecFileOptions
1303
+ options: ExecFileOptions,
1184
1304
  ): PromiseWithChild<{
1185
1305
  stdout: string;
1186
1306
  stderr: string;
1187
1307
  }>;
1188
1308
  function __promisify__(
1189
1309
  file: string,
1190
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
1310
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1191
1311
  ): PromiseWithChild<{
1192
1312
  stdout: string | Buffer;
1193
1313
  stderr: string | Buffer;
@@ -1195,7 +1315,7 @@ declare module 'node:child_process' {
1195
1315
  function __promisify__(
1196
1316
  file: string,
1197
1317
  args: ReadonlyArray<string> | undefined | null,
1198
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
1318
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1199
1319
  ): PromiseWithChild<{
1200
1320
  stdout: string | Buffer;
1201
1321
  stderr: string | Buffer;
@@ -1272,13 +1392,13 @@ declare module 'node:child_process' {
1272
1392
  interface SpawnSyncOptions extends CommonSpawnOptions {
1273
1393
  input?: string | NodeJS.ArrayBufferView | undefined;
1274
1394
  maxBuffer?: number | undefined;
1275
- encoding?: BufferEncoding | 'buffer' | null | undefined;
1395
+ encoding?: BufferEncoding | "buffer" | null | undefined;
1276
1396
  }
1277
1397
  interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
1278
1398
  encoding: BufferEncoding;
1279
1399
  }
1280
1400
  interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
1281
- encoding?: 'buffer' | null | undefined;
1401
+ encoding?: "buffer" | null | undefined;
1282
1402
  }
1283
1403
  interface SpawnSyncReturns<T> {
1284
1404
  pid: number;
@@ -1309,9 +1429,21 @@ declare module 'node:child_process' {
1309
1429
  function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1310
1430
  function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1311
1431
  function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
1312
- function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1313
- function spawnSync(command: string, args: ReadonlyArray<string>, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1314
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1432
+ function spawnSync(
1433
+ command: string,
1434
+ args: ReadonlyArray<string>,
1435
+ options: SpawnSyncOptionsWithStringEncoding,
1436
+ ): SpawnSyncReturns<string>;
1437
+ function spawnSync(
1438
+ command: string,
1439
+ args: ReadonlyArray<string>,
1440
+ options: SpawnSyncOptionsWithBufferEncoding,
1441
+ ): SpawnSyncReturns<Buffer>;
1442
+ function spawnSync(
1443
+ command: string,
1444
+ args?: ReadonlyArray<string>,
1445
+ options?: SpawnSyncOptions,
1446
+ ): SpawnSyncReturns<string | Buffer>;
1315
1447
  interface CommonExecOptions extends CommonOptions {
1316
1448
  input?: string | NodeJS.ArrayBufferView | undefined;
1317
1449
  /**
@@ -1326,7 +1458,7 @@ declare module 'node:child_process' {
1326
1458
  stdio?: StdioOptions | undefined;
1327
1459
  killSignal?: NodeJS.Signals | number | undefined;
1328
1460
  maxBuffer?: number | undefined;
1329
- encoding?: BufferEncoding | 'buffer' | null | undefined;
1461
+ encoding?: BufferEncoding | "buffer" | null | undefined;
1330
1462
  }
1331
1463
  interface ExecSyncOptions extends CommonExecOptions {
1332
1464
  shell?: string | undefined;
@@ -1335,7 +1467,7 @@ declare module 'node:child_process' {
1335
1467
  encoding: BufferEncoding;
1336
1468
  }
1337
1469
  interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
1338
- encoding?: 'buffer' | null | undefined;
1470
+ encoding?: "buffer" | null | undefined;
1339
1471
  }
1340
1472
  /**
1341
1473
  * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
@@ -1364,7 +1496,7 @@ declare module 'node:child_process' {
1364
1496
  encoding: BufferEncoding;
1365
1497
  }
1366
1498
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1367
- encoding?: 'buffer' | null; // specify `null`.
1499
+ encoding?: "buffer" | null; // specify `null`.
1368
1500
  }
1369
1501
  /**
1370
1502
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
@@ -1391,10 +1523,18 @@ declare module 'node:child_process' {
1391
1523
  function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1392
1524
  function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1393
1525
  function execFileSync(file: string, args: ReadonlyArray<string>): Buffer;
1394
- function execFileSync(file: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithStringEncoding): string;
1395
- function execFileSync(file: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1526
+ function execFileSync(
1527
+ file: string,
1528
+ args: ReadonlyArray<string>,
1529
+ options: ExecFileSyncOptionsWithStringEncoding,
1530
+ ): string;
1531
+ function execFileSync(
1532
+ file: string,
1533
+ args: ReadonlyArray<string>,
1534
+ options: ExecFileSyncOptionsWithBufferEncoding,
1535
+ ): Buffer;
1396
1536
  function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
1397
1537
  }
1398
- declare module 'child_process' {
1399
- export * from 'node:child_process';
1538
+ declare module "node:child_process" {
1539
+ export * from "child_process";
1400
1540
  }