@idlebox/stripe-node-types 24.0.14-patch.0 → 24.0.15

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 (134) hide show
  1. package/README.md +1 -1
  2. package/assert/strict.d.ts +113 -1
  3. package/assert.d.ts +162 -248
  4. package/async_hooks.d.ts +20 -5
  5. package/buffer.buffer.d.ts +24 -6
  6. package/buffer.d.ts +63 -168
  7. package/child_process.d.ts +117 -223
  8. package/cluster.d.ts +251 -329
  9. package/compatibility/iterators.d.ts +15 -0
  10. package/console.d.ts +60 -346
  11. package/constants.d.ts +15 -1
  12. package/crypto.d.ts +713 -1149
  13. package/dgram.d.ts +30 -50
  14. package/diagnostics_channel.d.ts +16 -3
  15. package/dns/promises.d.ts +15 -0
  16. package/dns.d.ts +150 -131
  17. package/domain.d.ts +25 -14
  18. package/events.d.ts +858 -719
  19. package/fs/promises.d.ts +117 -53
  20. package/fs.d.ts +729 -484
  21. package/globals.d.ts +142 -344
  22. package/globals.typedarray.d.ts +94 -0
  23. package/http.d.ts +358 -246
  24. package/http2.d.ts +578 -711
  25. package/https.d.ts +85 -216
  26. package/index.d.ts +39 -3
  27. package/inspector/promises.d.ts +54 -0
  28. package/inspector.d.ts +180 -3936
  29. package/inspector.generated.d.ts +4242 -0
  30. package/module.d.ts +60 -95
  31. package/my-shim.d.ts +15 -0
  32. package/net.d.ts +102 -186
  33. package/os.d.ts +32 -6
  34. package/package.json +3 -8
  35. package/path/posix.d.ts +20 -0
  36. package/path/win32.d.ts +20 -0
  37. package/path.d.ts +132 -122
  38. package/perf_hooks.d.ts +310 -644
  39. package/process.d.ts +192 -138
  40. package/punycode.d.ts +17 -2
  41. package/querystring.d.ts +16 -1
  42. package/quic.d.ts +926 -0
  43. package/readline/promises.d.ts +16 -1
  44. package/readline.d.ts +80 -118
  45. package/repl.d.ts +98 -96
  46. package/sea.d.ts +25 -1
  47. package/sqlite.d.ts +277 -13
  48. package/stream/consumers.d.ts +22 -7
  49. package/stream/promises.d.ts +148 -12
  50. package/stream/web.d.ts +187 -494
  51. package/stream.d.ts +608 -490
  52. package/string_decoder.d.ts +18 -3
  53. package/test/reporters.d.ts +112 -0
  54. package/test.d.ts +238 -199
  55. package/timers/promises.d.ts +16 -1
  56. package/timers.d.ts +16 -129
  57. package/tls.d.ts +163 -163
  58. package/trace_events.d.ts +21 -6
  59. package/ts5.6/buffer.buffer.d.ts +25 -8
  60. package/ts5.6/compatibility/float16array.d.ts +15 -0
  61. package/ts5.6/globals.typedarray.d.ts +31 -0
  62. package/ts5.6/index.d.ts +39 -3
  63. package/ts5.7/compatibility/float16array.d.ts +15 -0
  64. package/ts5.7/index.d.ts +39 -3
  65. package/tty.d.ts +70 -13
  66. package/undici-types/agent.d.ts +20 -4
  67. package/undici-types/api.d.ts +15 -0
  68. package/undici-types/balanced-pool.d.ts +15 -0
  69. package/undici-types/cache-interceptor.d.ts +15 -0
  70. package/undici-types/cache.d.ts +15 -0
  71. package/undici-types/client-stats.d.ts +31 -0
  72. package/undici-types/client.d.ts +21 -5
  73. package/undici-types/connector.d.ts +15 -0
  74. package/undici-types/content-type.d.ts +15 -0
  75. package/undici-types/cookies.d.ts +15 -0
  76. package/undici-types/diagnostics-channel.d.ts +24 -1
  77. package/undici-types/dispatcher.d.ts +18 -8
  78. package/undici-types/env-http-proxy-agent.d.ts +17 -1
  79. package/undici-types/errors.d.ts +20 -15
  80. package/undici-types/eventsource.d.ts +24 -4
  81. package/undici-types/fetch.d.ts +16 -0
  82. package/undici-types/formdata.d.ts +15 -0
  83. package/undici-types/global-dispatcher.d.ts +15 -0
  84. package/undici-types/global-origin.d.ts +15 -0
  85. package/undici-types/h2c-client.d.ts +15 -2
  86. package/undici-types/handlers.d.ts +16 -1
  87. package/undici-types/header.d.ts +15 -0
  88. package/undici-types/index.d.ts +21 -1
  89. package/undici-types/interceptors.d.ts +20 -0
  90. package/undici-types/mock-agent.d.ts +18 -0
  91. package/undici-types/mock-call-history.d.ts +15 -0
  92. package/undici-types/mock-client.d.ts +17 -0
  93. package/undici-types/mock-errors.d.ts +15 -0
  94. package/undici-types/mock-interceptor.d.ts +17 -1
  95. package/undici-types/mock-pool.d.ts +17 -0
  96. package/undici-types/package.json +1 -1
  97. package/undici-types/patch.d.ts +15 -0
  98. package/undici-types/pool-stats.d.ts +15 -0
  99. package/undici-types/pool.d.ts +17 -0
  100. package/undici-types/proxy-agent.d.ts +16 -0
  101. package/undici-types/readable.d.ts +15 -0
  102. package/undici-types/retry-agent.d.ts +15 -0
  103. package/undici-types/retry-handler.d.ts +24 -0
  104. package/undici-types/snapshot-agent.d.ts +125 -0
  105. package/undici-types/util.d.ts +15 -0
  106. package/undici-types/utility.d.ts +15 -0
  107. package/undici-types/webidl.d.ts +126 -36
  108. package/undici-types/websocket.d.ts +18 -1
  109. package/url.d.ts +107 -587
  110. package/util/types.d.ts +571 -0
  111. package/util.d.ts +158 -792
  112. package/v8.d.ts +82 -7
  113. package/vm.d.ts +267 -108
  114. package/wasi.d.ts +38 -2
  115. package/web-globals/abortcontroller.d.ts +75 -0
  116. package/web-globals/blob.d.ts +39 -0
  117. package/web-globals/console.d.ts +25 -0
  118. package/web-globals/crypto.d.ts +55 -0
  119. package/web-globals/domexception.d.ts +84 -0
  120. package/web-globals/encoding.d.ts +27 -0
  121. package/{dom-events.d.ts → web-globals/events.d.ts} +72 -50
  122. package/web-globals/fetch.d.ts +70 -0
  123. package/web-globals/importmeta.d.ts +29 -0
  124. package/web-globals/messaging.d.ts +39 -0
  125. package/web-globals/navigator.d.ts +41 -0
  126. package/web-globals/performance.d.ts +61 -0
  127. package/web-globals/storage.d.ts +40 -0
  128. package/web-globals/streams.d.ts +131 -0
  129. package/web-globals/timers.d.ts +60 -0
  130. package/web-globals/url.d.ts +40 -0
  131. package/worker_threads.d.ts +306 -349
  132. package/zlib.d.ts +59 -94
  133. package/ts5.1/compatibility/disposable.d.ts +0 -13
  134. package/ts5.1/index.d.ts +0 -100
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  /**
2
17
  * The `node:child_process` module provides the ability to spawn subprocesses in
3
18
  * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
@@ -24,7 +39,7 @@
24
39
  * the parent Node.js process and the spawned subprocess. These pipes have
25
40
  * limited (and platform-specific) capacity. If the subprocess writes to
26
41
  * stdout in excess of that limit without the output being captured, the
27
- * subprocess blocks waiting for the pipe buffer to accept more data. This is
42
+ * subprocess blocks, waiting for the pipe buffer to accept more data. This is
28
43
  * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
29
44
  *
30
45
  * The command lookup is performed using the `options.env.PATH` environment
@@ -63,18 +78,26 @@
63
78
  * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
64
79
  * the synchronous methods can have significant impact on performance due to
65
80
  * stalling the event loop while spawned processes complete.
66
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js)
81
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/child_process.js)
67
82
  */
68
83
 
69
84
  declare module "node:child_process" {
70
- import { ObjectEncodingOptions } from '_not-use-node-type_fs';
71
- import { Abortable, EventEmitter } from 'node:events';
85
+ import { NonSharedBuffer } from 'node:buffer';
72
86
  import * as dgram from 'node:dgram';
87
+ import { Abortable, EventEmitter, InternalEventEmitter } from 'node:events';
73
88
  import * as net from 'node:net';
74
- import { Pipe, Readable, Stream, Writable } from 'node:stream';
89
+ import { Readable, Stream, Writable } from 'node:stream';
75
90
  import { URL } from 'node:url';
76
91
  type Serializable = string | object | number | boolean | bigint;
77
92
  type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
93
+ interface ChildProcessEventMap {
94
+ "close": [code: number | null, signal: NodeJS.Signals | null];
95
+ "disconnect": [];
96
+ "error": [err: Error];
97
+ "exit": [code: number | null, signal: NodeJS.Signals | null];
98
+ "message": [message: Serializable, sendHandle: SendHandle];
99
+ "spawn": [];
100
+ }
78
101
  /**
79
102
  * Instances of the `ChildProcess` represent spawned child processes.
80
103
  *
@@ -83,7 +106,7 @@ declare module "node:child_process" {
83
106
  * instances of `ChildProcess`.
84
107
  * @since v2.2.0
85
108
  */
86
- class ChildProcess extends EventEmitter {
109
+ class ChildProcess implements EventEmitter {
87
110
  /**
88
111
  * A `Writable Stream` that represents the child process's `stdin`.
89
112
  *
@@ -141,7 +164,7 @@ declare module "node:child_process" {
141
164
  * no IPC channel exists, this property is `undefined`.
142
165
  * @since v7.1.0
143
166
  */
144
- readonly channel?: Pipe | null | undefined;
167
+ readonly channel?: Control | null;
145
168
  /**
146
169
  * A sparse array of pipes to the child process, corresponding with positions in
147
170
  * the `stdio` option passed to {@link spawn} that have been set
@@ -459,7 +482,7 @@ declare module "node:child_process" {
459
482
  * as the connection may have been closed during the time it takes to send the
460
483
  * connection to the child.
461
484
  * @since v0.5.9
462
- * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v24.x/api/dgram.html#class-dgramsocket) object.
485
+ * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v25.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v25.x/api/dgram.html#class-dgramsocket) object.
463
486
  * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
464
487
  */
465
488
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
@@ -525,64 +548,8 @@ declare module "node:child_process" {
525
548
  * @since v0.7.10
526
549
  */
527
550
  ref(): void;
528
- /**
529
- * events.EventEmitter
530
- * 1. close
531
- * 2. disconnect
532
- * 3. error
533
- * 4. exit
534
- * 5. message
535
- * 6. spawn
536
- */
537
- addListener(event: string, listener: (...args: any[]) => void): this;
538
- addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
539
- addListener(event: "disconnect", listener: () => void): this;
540
- addListener(event: "error", listener: (err: Error) => void): this;
541
- addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
542
- addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
543
- addListener(event: "spawn", listener: () => void): this;
544
- emit(event: string | symbol, ...args: any[]): boolean;
545
- emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
546
- emit(event: "disconnect"): boolean;
547
- emit(event: "error", err: Error): boolean;
548
- emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
549
- emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
550
- emit(event: "spawn", listener: () => void): boolean;
551
- on(event: string, listener: (...args: any[]) => void): this;
552
- on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
553
- on(event: "disconnect", listener: () => void): this;
554
- on(event: "error", listener: (err: Error) => void): this;
555
- on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
556
- on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
557
- on(event: "spawn", listener: () => void): this;
558
- once(event: string, listener: (...args: any[]) => void): this;
559
- once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
560
- once(event: "disconnect", listener: () => void): this;
561
- once(event: "error", listener: (err: Error) => void): this;
562
- once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
563
- once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
564
- once(event: "spawn", listener: () => void): this;
565
- prependListener(event: string, listener: (...args: any[]) => void): this;
566
- prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
567
- prependListener(event: "disconnect", listener: () => void): this;
568
- prependListener(event: "error", listener: (err: Error) => void): this;
569
- prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
570
- prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
571
- prependListener(event: "spawn", listener: () => void): this;
572
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
573
- prependOnceListener(
574
- event: "close",
575
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
576
- ): this;
577
- prependOnceListener(event: "disconnect", listener: () => void): this;
578
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
579
- prependOnceListener(
580
- event: "exit",
581
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
582
- ): this;
583
- prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
584
- prependOnceListener(event: "spawn", listener: () => void): this;
585
551
  }
552
+ interface ChildProcess extends InternalEventEmitter<ChildProcessEventMap> {}
586
553
  // return this object when stdio option is undefined or not specified
587
554
  interface ChildProcessWithoutNullStreams extends ChildProcess {
588
555
  stdin: Writable;
@@ -614,6 +581,10 @@ declare module "node:child_process" {
614
581
  Readable | Writable | null | undefined, // extra, no modification
615
582
  ];
616
583
  }
584
+ interface Control extends EventEmitter {
585
+ ref(): void;
586
+ unref(): void;
587
+ }
617
588
  interface MessageOptions {
618
589
  keepOpen?: boolean | undefined;
619
590
  }
@@ -888,18 +859,20 @@ declare module "node:child_process" {
888
859
  signal?: AbortSignal | undefined;
889
860
  maxBuffer?: number | undefined;
890
861
  killSignal?: NodeJS.Signals | number | undefined;
862
+ encoding?: string | null | undefined;
891
863
  }
892
864
  interface ExecOptionsWithStringEncoding extends ExecOptions {
893
- encoding: BufferEncoding;
865
+ encoding?: BufferEncoding | undefined;
894
866
  }
895
867
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
896
- encoding: BufferEncoding | null; // specify `null`.
868
+ encoding: "buffer" | null; // specify `null`.
897
869
  }
870
+ // TODO: Just Plain Wrong™ (see also nodejs/node#57392)
898
871
  interface ExecException extends Error {
899
- cmd?: string | undefined;
900
- killed?: boolean | undefined;
901
- code?: number | undefined;
902
- signal?: NodeJS.Signals | undefined;
872
+ cmd?: string;
873
+ killed?: boolean;
874
+ code?: number;
875
+ signal?: NodeJS.Signals;
903
876
  stdout?: string;
904
877
  stderr?: string;
905
878
  }
@@ -996,39 +969,24 @@ declare module "node:child_process" {
996
969
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
997
970
  function exec(
998
971
  command: string,
999
- options: {
1000
- encoding: "buffer" | null;
1001
- } & ExecOptions,
1002
- callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
972
+ options: ExecOptionsWithBufferEncoding,
973
+ callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1003
974
  ): ChildProcess;
1004
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
975
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1005
976
  function exec(
1006
977
  command: string,
1007
- options: {
1008
- encoding: BufferEncoding;
1009
- } & ExecOptions,
1010
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1011
- ): ChildProcess;
1012
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1013
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1014
- function exec(
1015
- command: string,
1016
- options: {
1017
- encoding: BufferEncoding;
1018
- } & ExecOptions,
1019
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1020
- ): ChildProcess;
1021
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1022
- function exec(
1023
- command: string,
1024
- options: ExecOptions,
978
+ options: ExecOptionsWithStringEncoding,
1025
979
  callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1026
980
  ): ChildProcess;
1027
981
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1028
982
  function exec(
1029
983
  command: string,
1030
- options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
1031
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
984
+ options: ExecOptions | undefined | null,
985
+ callback?: (
986
+ error: ExecException | null,
987
+ stdout: string | NonSharedBuffer,
988
+ stderr: string | NonSharedBuffer,
989
+ ) => void,
1032
990
  ): ChildProcess;
1033
991
  interface PromiseWithChild<T> extends Promise<T> {
1034
992
  child: ChildProcess;
@@ -1040,35 +998,24 @@ declare module "node:child_process" {
1040
998
  }>;
1041
999
  function __promisify__(
1042
1000
  command: string,
1043
- options: {
1044
- encoding: "buffer" | null;
1045
- } & ExecOptions,
1046
- ): PromiseWithChild<{
1047
- stdout: Buffer;
1048
- stderr: Buffer;
1049
- }>;
1050
- function __promisify__(
1051
- command: string,
1052
- options: {
1053
- encoding: BufferEncoding;
1054
- } & ExecOptions,
1001
+ options: ExecOptionsWithBufferEncoding,
1055
1002
  ): PromiseWithChild<{
1056
- stdout: string;
1057
- stderr: string;
1003
+ stdout: NonSharedBuffer;
1004
+ stderr: NonSharedBuffer;
1058
1005
  }>;
1059
1006
  function __promisify__(
1060
1007
  command: string,
1061
- options: ExecOptions,
1008
+ options: ExecOptionsWithStringEncoding,
1062
1009
  ): PromiseWithChild<{
1063
1010
  stdout: string;
1064
1011
  stderr: string;
1065
1012
  }>;
1066
1013
  function __promisify__(
1067
1014
  command: string,
1068
- options?: (ObjectEncodingOptions & ExecOptions) | null,
1015
+ options: ExecOptions | undefined | null,
1069
1016
  ): PromiseWithChild<{
1070
- stdout: string | Buffer;
1071
- stderr: string | Buffer;
1017
+ stdout: string | NonSharedBuffer;
1018
+ stderr: string | NonSharedBuffer;
1072
1019
  }>;
1073
1020
  }
1074
1021
  interface ExecFileOptions extends CommonOptions, Abortable {
@@ -1077,20 +1024,21 @@ declare module "node:child_process" {
1077
1024
  windowsVerbatimArguments?: boolean | undefined;
1078
1025
  shell?: boolean | string | undefined;
1079
1026
  signal?: AbortSignal | undefined;
1027
+ encoding?: string | null | undefined;
1080
1028
  }
1081
1029
  interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
1082
- encoding: BufferEncoding;
1030
+ encoding?: BufferEncoding | undefined;
1083
1031
  }
1084
1032
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
1085
1033
  encoding: "buffer" | null;
1086
1034
  }
1087
- interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
1088
- encoding: BufferEncoding;
1089
- }
1035
+ /** @deprecated Use `ExecFileOptions` instead. */
1036
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
1037
+ // TODO: execFile exceptions can take many forms... this accurately describes none of them
1090
1038
  type ExecFileException =
1091
1039
  & Omit<ExecException, "code">
1092
1040
  & Omit<NodeJS.ErrnoException, "code">
1093
- & { code?: string | number | undefined | null };
1041
+ & { code?: string | number | null };
1094
1042
  /**
1095
1043
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
1096
1044
  * executable `file` is spawned directly as a new process making it slightly more
@@ -1155,91 +1103,63 @@ declare module "node:child_process" {
1155
1103
  * @param args List of string arguments.
1156
1104
  * @param callback Called with the output when process terminates.
1157
1105
  */
1158
- function execFile(file: string): ChildProcess;
1159
- function execFile(
1160
- file: string,
1161
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1162
- ): ChildProcess;
1163
- function execFile(file: string, args?: readonly string[] | null): ChildProcess;
1164
- function execFile(
1165
- file: string,
1166
- args: readonly string[] | undefined | null,
1167
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1168
- ): ChildProcess;
1169
1106
  // no `options` definitely means stdout/stderr are `string`.
1170
1107
  function execFile(
1171
1108
  file: string,
1172
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1109
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1173
1110
  ): ChildProcess;
1174
1111
  function execFile(
1175
1112
  file: string,
1176
1113
  args: readonly string[] | undefined | null,
1177
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1114
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1178
1115
  ): ChildProcess;
1179
1116
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1180
1117
  function execFile(
1181
1118
  file: string,
1182
1119
  options: ExecFileOptionsWithBufferEncoding,
1183
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1120
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1184
1121
  ): ChildProcess;
1185
1122
  function execFile(
1186
1123
  file: string,
1187
1124
  args: readonly string[] | undefined | null,
1188
1125
  options: ExecFileOptionsWithBufferEncoding,
1189
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1126
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1190
1127
  ): ChildProcess;
1191
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1128
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1192
1129
  function execFile(
1193
1130
  file: string,
1194
1131
  options: ExecFileOptionsWithStringEncoding,
1195
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1132
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1196
1133
  ): ChildProcess;
1197
1134
  function execFile(
1198
1135
  file: string,
1199
1136
  args: readonly string[] | undefined | null,
1200
1137
  options: ExecFileOptionsWithStringEncoding,
1201
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1202
- ): ChildProcess;
1203
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1204
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1205
- function execFile(
1206
- file: string,
1207
- options: ExecFileOptionsWithOtherEncoding,
1208
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1209
- ): ChildProcess;
1210
- function execFile(
1211
- file: string,
1212
- args: readonly string[] | undefined | null,
1213
- options: ExecFileOptionsWithOtherEncoding,
1214
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1215
- ): ChildProcess;
1216
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1217
- function execFile(
1218
- file: string,
1219
- options: ExecFileOptions,
1220
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1221
- ): ChildProcess;
1222
- function execFile(
1223
- file: string,
1224
- args: readonly string[] | undefined | null,
1225
- options: ExecFileOptions,
1226
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1138
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1227
1139
  ): ChildProcess;
1228
1140
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1229
1141
  function execFile(
1230
1142
  file: string,
1231
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1143
+ options: ExecFileOptions | undefined | null,
1232
1144
  callback:
1233
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1145
+ | ((
1146
+ error: ExecFileException | null,
1147
+ stdout: string | NonSharedBuffer,
1148
+ stderr: string | NonSharedBuffer,
1149
+ ) => void)
1234
1150
  | undefined
1235
1151
  | null,
1236
1152
  ): ChildProcess;
1237
1153
  function execFile(
1238
1154
  file: string,
1239
1155
  args: readonly string[] | undefined | null,
1240
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1156
+ options: ExecFileOptions | undefined | null,
1241
1157
  callback:
1242
- | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
1158
+ | ((
1159
+ error: ExecFileException | null,
1160
+ stdout: string | NonSharedBuffer,
1161
+ stderr: string | NonSharedBuffer,
1162
+ ) => void)
1243
1163
  | undefined
1244
1164
  | null,
1245
1165
  ): ChildProcess;
@@ -1259,16 +1179,16 @@ declare module "node:child_process" {
1259
1179
  file: string,
1260
1180
  options: ExecFileOptionsWithBufferEncoding,
1261
1181
  ): PromiseWithChild<{
1262
- stdout: Buffer;
1263
- stderr: Buffer;
1182
+ stdout: NonSharedBuffer;
1183
+ stderr: NonSharedBuffer;
1264
1184
  }>;
1265
1185
  function __promisify__(
1266
1186
  file: string,
1267
1187
  args: readonly string[] | undefined | null,
1268
1188
  options: ExecFileOptionsWithBufferEncoding,
1269
1189
  ): PromiseWithChild<{
1270
- stdout: Buffer;
1271
- stderr: Buffer;
1190
+ stdout: NonSharedBuffer;
1191
+ stderr: NonSharedBuffer;
1272
1192
  }>;
1273
1193
  function __promisify__(
1274
1194
  file: string,
@@ -1287,48 +1207,18 @@ declare module "node:child_process" {
1287
1207
  }>;
1288
1208
  function __promisify__(
1289
1209
  file: string,
1290
- options: ExecFileOptionsWithOtherEncoding,
1291
- ): PromiseWithChild<{
1292
- stdout: string | Buffer;
1293
- stderr: string | Buffer;
1294
- }>;
1295
- function __promisify__(
1296
- file: string,
1297
- args: readonly string[] | undefined | null,
1298
- options: ExecFileOptionsWithOtherEncoding,
1299
- ): PromiseWithChild<{
1300
- stdout: string | Buffer;
1301
- stderr: string | Buffer;
1302
- }>;
1303
- function __promisify__(
1304
- file: string,
1305
- options: ExecFileOptions,
1306
- ): PromiseWithChild<{
1307
- stdout: string;
1308
- stderr: string;
1309
- }>;
1310
- function __promisify__(
1311
- file: string,
1312
- args: readonly string[] | undefined | null,
1313
- options: ExecFileOptions,
1314
- ): PromiseWithChild<{
1315
- stdout: string;
1316
- stderr: string;
1317
- }>;
1318
- function __promisify__(
1319
- file: string,
1320
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1210
+ options: ExecFileOptions | undefined | null,
1321
1211
  ): PromiseWithChild<{
1322
- stdout: string | Buffer;
1323
- stderr: string | Buffer;
1212
+ stdout: string | NonSharedBuffer;
1213
+ stderr: string | NonSharedBuffer;
1324
1214
  }>;
1325
1215
  function __promisify__(
1326
1216
  file: string,
1327
1217
  args: readonly string[] | undefined | null,
1328
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1218
+ options: ExecFileOptions | undefined | null,
1329
1219
  ): PromiseWithChild<{
1330
- stdout: string | Buffer;
1331
- stderr: string | Buffer;
1220
+ stdout: string | NonSharedBuffer;
1221
+ stderr: string | NonSharedBuffer;
1332
1222
  }>;
1333
1223
  }
1334
1224
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
@@ -1417,7 +1307,7 @@ declare module "node:child_process" {
1417
1307
  stderr: T;
1418
1308
  status: number | null;
1419
1309
  signal: NodeJS.Signals | null;
1420
- error?: Error | undefined;
1310
+ error?: Error;
1421
1311
  }
1422
1312
  /**
1423
1313
  * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
@@ -1434,11 +1324,11 @@ declare module "node:child_process" {
1434
1324
  * @param command The command to run.
1435
1325
  * @param args List of string arguments.
1436
1326
  */
1437
- function spawnSync(command: string): SpawnSyncReturns<Buffer>;
1327
+ function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
1438
1328
  function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1439
- function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1440
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1441
- function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
1329
+ function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
1330
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
1331
+ function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
1442
1332
  function spawnSync(
1443
1333
  command: string,
1444
1334
  args: readonly string[],
@@ -1448,12 +1338,12 @@ declare module "node:child_process" {
1448
1338
  command: string,
1449
1339
  args: readonly string[],
1450
1340
  options: SpawnSyncOptionsWithBufferEncoding,
1451
- ): SpawnSyncReturns<Buffer>;
1341
+ ): SpawnSyncReturns<NonSharedBuffer>;
1452
1342
  function spawnSync(
1453
1343
  command: string,
1454
1344
  args?: readonly string[],
1455
1345
  options?: SpawnSyncOptions,
1456
- ): SpawnSyncReturns<string | Buffer>;
1346
+ ): SpawnSyncReturns<string | NonSharedBuffer>;
1457
1347
  interface CommonExecOptions extends CommonOptions {
1458
1348
  input?: string | NodeJS.ArrayBufferView | undefined;
1459
1349
  /**
@@ -1495,10 +1385,10 @@ declare module "node:child_process" {
1495
1385
  * @param command The command to run.
1496
1386
  * @return The stdout from the command.
1497
1387
  */
1498
- function execSync(command: string): Buffer;
1388
+ function execSync(command: string): NonSharedBuffer;
1499
1389
  function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
1500
- function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
1501
- function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
1390
+ function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
1391
+ function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
1502
1392
  interface ExecFileSyncOptions extends CommonExecOptions {
1503
1393
  shell?: boolean | string | undefined;
1504
1394
  }
@@ -1506,7 +1396,7 @@ declare module "node:child_process" {
1506
1396
  encoding: BufferEncoding;
1507
1397
  }
1508
1398
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1509
- encoding?: "buffer" | null; // specify `null`.
1399
+ encoding?: "buffer" | null | undefined; // specify `null`.
1510
1400
  }
1511
1401
  /**
1512
1402
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
@@ -1528,11 +1418,11 @@ declare module "node:child_process" {
1528
1418
  * @param args List of string arguments.
1529
1419
  * @return The stdout from the command.
1530
1420
  */
1531
- function execFileSync(file: string): Buffer;
1421
+ function execFileSync(file: string): NonSharedBuffer;
1532
1422
  function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
1533
- function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1534
- function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1535
- function execFileSync(file: string, args: readonly string[]): Buffer;
1423
+ function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
1424
+ function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
1425
+ function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
1536
1426
  function execFileSync(
1537
1427
  file: string,
1538
1428
  args: readonly string[],
@@ -1542,6 +1432,10 @@ declare module "node:child_process" {
1542
1432
  file: string,
1543
1433
  args: readonly string[],
1544
1434
  options: ExecFileSyncOptionsWithBufferEncoding,
1545
- ): Buffer;
1546
- function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
1435
+ ): NonSharedBuffer;
1436
+ function execFileSync(
1437
+ file: string,
1438
+ args?: readonly string[],
1439
+ options?: ExecFileSyncOptions,
1440
+ ): string | NonSharedBuffer;
1547
1441
  }