@idlebox/stripe-node-types 24.0.14 → 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 (85) hide show
  1. package/README.md +1 -1
  2. package/assert/strict.d.ts +98 -1
  3. package/assert.d.ts +147 -248
  4. package/async_hooks.d.ts +5 -5
  5. package/buffer.buffer.d.ts +9 -6
  6. package/buffer.d.ts +49 -169
  7. package/child_process.d.ts +102 -223
  8. package/cluster.d.ts +236 -329
  9. package/console.d.ts +45 -346
  10. package/constants.d.ts +0 -1
  11. package/crypto.d.ts +698 -1149
  12. package/dgram.d.ts +15 -50
  13. package/diagnostics_channel.d.ts +1 -3
  14. package/dns.d.ts +135 -131
  15. package/domain.d.ts +10 -14
  16. package/events.d.ts +846 -722
  17. package/fs/promises.d.ts +102 -53
  18. package/fs.d.ts +714 -484
  19. package/globals.d.ts +130 -347
  20. package/globals.typedarray.d.ts +79 -0
  21. package/http.d.ts +343 -246
  22. package/http2.d.ts +563 -711
  23. package/https.d.ts +70 -216
  24. package/index.d.ts +24 -3
  25. package/inspector/promises.d.ts +54 -0
  26. package/inspector.d.ts +167 -3938
  27. package/inspector.generated.d.ts +4242 -0
  28. package/module.d.ts +45 -95
  29. package/net.d.ts +87 -186
  30. package/os.d.ts +17 -6
  31. package/package.json +3 -8
  32. package/path/posix.d.ts +20 -0
  33. package/path/win32.d.ts +20 -0
  34. package/path.d.ts +117 -122
  35. package/perf_hooks.d.ts +295 -644
  36. package/process.d.ts +177 -138
  37. package/punycode.d.ts +2 -2
  38. package/querystring.d.ts +1 -1
  39. package/quic.d.ts +926 -0
  40. package/readline/promises.d.ts +1 -1
  41. package/readline.d.ts +65 -118
  42. package/repl.d.ts +83 -96
  43. package/sea.d.ts +10 -1
  44. package/sqlite.d.ts +262 -13
  45. package/stream/consumers.d.ts +7 -7
  46. package/stream/promises.d.ts +133 -12
  47. package/stream/web.d.ts +173 -495
  48. package/stream.d.ts +593 -490
  49. package/string_decoder.d.ts +3 -3
  50. package/test/reporters.d.ts +112 -0
  51. package/test.d.ts +223 -199
  52. package/timers/promises.d.ts +1 -1
  53. package/timers.d.ts +1 -129
  54. package/tls.d.ts +148 -163
  55. package/trace_events.d.ts +6 -6
  56. package/ts5.6/buffer.buffer.d.ts +10 -8
  57. package/ts5.6/globals.typedarray.d.ts +16 -0
  58. package/ts5.6/index.d.ts +24 -3
  59. package/ts5.7/index.d.ts +24 -3
  60. package/tty.d.ts +55 -13
  61. package/url.d.ts +92 -587
  62. package/util/types.d.ts +571 -0
  63. package/util.d.ts +143 -792
  64. package/v8.d.ts +67 -7
  65. package/vm.d.ts +252 -108
  66. package/wasi.d.ts +23 -2
  67. package/web-globals/abortcontroller.d.ts +75 -0
  68. package/web-globals/blob.d.ts +39 -0
  69. package/{ts5.1/compatibility/disposable.d.ts → web-globals/console.d.ts} +6 -9
  70. package/web-globals/crypto.d.ts +55 -0
  71. package/web-globals/domexception.d.ts +84 -0
  72. package/web-globals/encoding.d.ts +27 -0
  73. package/{dom-events.d.ts → web-globals/events.d.ts} +57 -50
  74. package/web-globals/fetch.d.ts +70 -0
  75. package/web-globals/importmeta.d.ts +29 -0
  76. package/web-globals/messaging.d.ts +39 -0
  77. package/web-globals/navigator.d.ts +41 -0
  78. package/web-globals/performance.d.ts +61 -0
  79. package/web-globals/storage.d.ts +40 -0
  80. package/web-globals/streams.d.ts +131 -0
  81. package/web-globals/timers.d.ts +60 -0
  82. package/web-globals/url.d.ts +40 -0
  83. package/worker_threads.d.ts +291 -349
  84. package/zlib.d.ts +44 -94
  85. package/ts5.1/index.d.ts +0 -115
@@ -39,7 +39,7 @@
39
39
  * the parent Node.js process and the spawned subprocess. These pipes have
40
40
  * limited (and platform-specific) capacity. If the subprocess writes to
41
41
  * stdout in excess of that limit without the output being captured, the
42
- * 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
43
43
  * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
44
44
  *
45
45
  * The command lookup is performed using the `options.env.PATH` environment
@@ -78,18 +78,26 @@
78
78
  * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
79
79
  * the synchronous methods can have significant impact on performance due to
80
80
  * stalling the event loop while spawned processes complete.
81
- * @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)
82
82
  */
83
83
 
84
84
  declare module "node:child_process" {
85
- import { ObjectEncodingOptions } from '_not-use-node-type_fs';
86
- import { Abortable, EventEmitter } from 'node:events';
85
+ import { NonSharedBuffer } from 'node:buffer';
87
86
  import * as dgram from 'node:dgram';
87
+ import { Abortable, EventEmitter, InternalEventEmitter } from 'node:events';
88
88
  import * as net from 'node:net';
89
- import { Pipe, Readable, Stream, Writable } from 'node:stream';
89
+ import { Readable, Stream, Writable } from 'node:stream';
90
90
  import { URL } from 'node:url';
91
91
  type Serializable = string | object | number | boolean | bigint;
92
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
+ }
93
101
  /**
94
102
  * Instances of the `ChildProcess` represent spawned child processes.
95
103
  *
@@ -98,7 +106,7 @@ declare module "node:child_process" {
98
106
  * instances of `ChildProcess`.
99
107
  * @since v2.2.0
100
108
  */
101
- class ChildProcess extends EventEmitter {
109
+ class ChildProcess implements EventEmitter {
102
110
  /**
103
111
  * A `Writable Stream` that represents the child process's `stdin`.
104
112
  *
@@ -156,7 +164,7 @@ declare module "node:child_process" {
156
164
  * no IPC channel exists, this property is `undefined`.
157
165
  * @since v7.1.0
158
166
  */
159
- readonly channel?: Pipe | null | undefined;
167
+ readonly channel?: Control | null;
160
168
  /**
161
169
  * A sparse array of pipes to the child process, corresponding with positions in
162
170
  * the `stdio` option passed to {@link spawn} that have been set
@@ -474,7 +482,7 @@ declare module "node:child_process" {
474
482
  * as the connection may have been closed during the time it takes to send the
475
483
  * connection to the child.
476
484
  * @since v0.5.9
477
- * @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.
478
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:
479
487
  */
480
488
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
@@ -540,64 +548,8 @@ declare module "node:child_process" {
540
548
  * @since v0.7.10
541
549
  */
542
550
  ref(): void;
543
- /**
544
- * events.EventEmitter
545
- * 1. close
546
- * 2. disconnect
547
- * 3. error
548
- * 4. exit
549
- * 5. message
550
- * 6. spawn
551
- */
552
- addListener(event: string, listener: (...args: any[]) => void): this;
553
- addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
554
- addListener(event: "disconnect", listener: () => void): this;
555
- addListener(event: "error", listener: (err: Error) => void): this;
556
- addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
557
- addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
558
- addListener(event: "spawn", listener: () => void): this;
559
- emit(event: string | symbol, ...args: any[]): boolean;
560
- emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
561
- emit(event: "disconnect"): boolean;
562
- emit(event: "error", err: Error): boolean;
563
- emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
564
- emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
565
- emit(event: "spawn", listener: () => void): boolean;
566
- on(event: string, listener: (...args: any[]) => void): this;
567
- on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
568
- on(event: "disconnect", listener: () => void): this;
569
- on(event: "error", listener: (err: Error) => void): this;
570
- on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
571
- on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
572
- on(event: "spawn", listener: () => void): this;
573
- once(event: string, listener: (...args: any[]) => void): this;
574
- once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
575
- once(event: "disconnect", listener: () => void): this;
576
- once(event: "error", listener: (err: Error) => void): this;
577
- once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
578
- once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
579
- once(event: "spawn", listener: () => void): this;
580
- prependListener(event: string, listener: (...args: any[]) => void): this;
581
- prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
582
- prependListener(event: "disconnect", listener: () => void): this;
583
- prependListener(event: "error", listener: (err: Error) => void): this;
584
- prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
585
- prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
586
- prependListener(event: "spawn", listener: () => void): this;
587
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
588
- prependOnceListener(
589
- event: "close",
590
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
591
- ): this;
592
- prependOnceListener(event: "disconnect", listener: () => void): this;
593
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
594
- prependOnceListener(
595
- event: "exit",
596
- listener: (code: number | null, signal: NodeJS.Signals | null) => void,
597
- ): this;
598
- prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
599
- prependOnceListener(event: "spawn", listener: () => void): this;
600
551
  }
552
+ interface ChildProcess extends InternalEventEmitter<ChildProcessEventMap> {}
601
553
  // return this object when stdio option is undefined or not specified
602
554
  interface ChildProcessWithoutNullStreams extends ChildProcess {
603
555
  stdin: Writable;
@@ -629,6 +581,10 @@ declare module "node:child_process" {
629
581
  Readable | Writable | null | undefined, // extra, no modification
630
582
  ];
631
583
  }
584
+ interface Control extends EventEmitter {
585
+ ref(): void;
586
+ unref(): void;
587
+ }
632
588
  interface MessageOptions {
633
589
  keepOpen?: boolean | undefined;
634
590
  }
@@ -903,18 +859,20 @@ declare module "node:child_process" {
903
859
  signal?: AbortSignal | undefined;
904
860
  maxBuffer?: number | undefined;
905
861
  killSignal?: NodeJS.Signals | number | undefined;
862
+ encoding?: string | null | undefined;
906
863
  }
907
864
  interface ExecOptionsWithStringEncoding extends ExecOptions {
908
- encoding: BufferEncoding;
865
+ encoding?: BufferEncoding | undefined;
909
866
  }
910
867
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
911
- encoding: BufferEncoding | null; // specify `null`.
868
+ encoding: "buffer" | null; // specify `null`.
912
869
  }
870
+ // TODO: Just Plain Wrong™ (see also nodejs/node#57392)
913
871
  interface ExecException extends Error {
914
- cmd?: string | undefined;
915
- killed?: boolean | undefined;
916
- code?: number | undefined;
917
- signal?: NodeJS.Signals | undefined;
872
+ cmd?: string;
873
+ killed?: boolean;
874
+ code?: number;
875
+ signal?: NodeJS.Signals;
918
876
  stdout?: string;
919
877
  stderr?: string;
920
878
  }
@@ -1011,39 +969,24 @@ declare module "node:child_process" {
1011
969
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1012
970
  function exec(
1013
971
  command: string,
1014
- options: {
1015
- encoding: "buffer" | null;
1016
- } & ExecOptions,
1017
- callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
1018
- ): ChildProcess;
1019
- // `options` with well known `encoding` means stdout/stderr are definitely `string`.
1020
- function exec(
1021
- command: string,
1022
- options: {
1023
- encoding: BufferEncoding;
1024
- } & ExecOptions,
1025
- callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1026
- ): ChildProcess;
1027
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1028
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1029
- function exec(
1030
- command: string,
1031
- options: {
1032
- encoding: BufferEncoding;
1033
- } & ExecOptions,
1034
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
972
+ options: ExecOptionsWithBufferEncoding,
973
+ callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1035
974
  ): ChildProcess;
1036
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
975
+ // `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
1037
976
  function exec(
1038
977
  command: string,
1039
- options: ExecOptions,
978
+ options: ExecOptionsWithStringEncoding,
1040
979
  callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
1041
980
  ): ChildProcess;
1042
981
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1043
982
  function exec(
1044
983
  command: string,
1045
- options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
1046
- 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,
1047
990
  ): ChildProcess;
1048
991
  interface PromiseWithChild<T> extends Promise<T> {
1049
992
  child: ChildProcess;
@@ -1055,35 +998,24 @@ declare module "node:child_process" {
1055
998
  }>;
1056
999
  function __promisify__(
1057
1000
  command: string,
1058
- options: {
1059
- encoding: "buffer" | null;
1060
- } & ExecOptions,
1001
+ options: ExecOptionsWithBufferEncoding,
1061
1002
  ): PromiseWithChild<{
1062
- stdout: Buffer;
1063
- stderr: Buffer;
1003
+ stdout: NonSharedBuffer;
1004
+ stderr: NonSharedBuffer;
1064
1005
  }>;
1065
1006
  function __promisify__(
1066
1007
  command: string,
1067
- options: {
1068
- encoding: BufferEncoding;
1069
- } & ExecOptions,
1008
+ options: ExecOptionsWithStringEncoding,
1070
1009
  ): PromiseWithChild<{
1071
1010
  stdout: string;
1072
1011
  stderr: string;
1073
1012
  }>;
1074
1013
  function __promisify__(
1075
1014
  command: string,
1076
- options: ExecOptions,
1015
+ options: ExecOptions | undefined | null,
1077
1016
  ): PromiseWithChild<{
1078
- stdout: string;
1079
- stderr: string;
1080
- }>;
1081
- function __promisify__(
1082
- command: string,
1083
- options?: (ObjectEncodingOptions & ExecOptions) | null,
1084
- ): PromiseWithChild<{
1085
- stdout: string | Buffer;
1086
- stderr: string | Buffer;
1017
+ stdout: string | NonSharedBuffer;
1018
+ stderr: string | NonSharedBuffer;
1087
1019
  }>;
1088
1020
  }
1089
1021
  interface ExecFileOptions extends CommonOptions, Abortable {
@@ -1092,20 +1024,21 @@ declare module "node:child_process" {
1092
1024
  windowsVerbatimArguments?: boolean | undefined;
1093
1025
  shell?: boolean | string | undefined;
1094
1026
  signal?: AbortSignal | undefined;
1027
+ encoding?: string | null | undefined;
1095
1028
  }
1096
1029
  interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
1097
- encoding: BufferEncoding;
1030
+ encoding?: BufferEncoding | undefined;
1098
1031
  }
1099
1032
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
1100
1033
  encoding: "buffer" | null;
1101
1034
  }
1102
- interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
1103
- encoding: BufferEncoding;
1104
- }
1035
+ /** @deprecated Use `ExecFileOptions` instead. */
1036
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
1037
+ // TODO: execFile exceptions can take many forms... this accurately describes none of them
1105
1038
  type ExecFileException =
1106
1039
  & Omit<ExecException, "code">
1107
1040
  & Omit<NodeJS.ErrnoException, "code">
1108
- & { code?: string | number | undefined | null };
1041
+ & { code?: string | number | null };
1109
1042
  /**
1110
1043
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
1111
1044
  * executable `file` is spawned directly as a new process making it slightly more
@@ -1170,91 +1103,63 @@ declare module "node:child_process" {
1170
1103
  * @param args List of string arguments.
1171
1104
  * @param callback Called with the output when process terminates.
1172
1105
  */
1173
- function execFile(file: string): ChildProcess;
1174
- function execFile(
1175
- file: string,
1176
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1177
- ): ChildProcess;
1178
- function execFile(file: string, args?: readonly string[] | null): ChildProcess;
1179
- function execFile(
1180
- file: string,
1181
- args: readonly string[] | undefined | null,
1182
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1183
- ): ChildProcess;
1184
1106
  // no `options` definitely means stdout/stderr are `string`.
1185
1107
  function execFile(
1186
1108
  file: string,
1187
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1109
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1188
1110
  ): ChildProcess;
1189
1111
  function execFile(
1190
1112
  file: string,
1191
1113
  args: readonly string[] | undefined | null,
1192
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1114
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1193
1115
  ): ChildProcess;
1194
1116
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
1195
1117
  function execFile(
1196
1118
  file: string,
1197
1119
  options: ExecFileOptionsWithBufferEncoding,
1198
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1120
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1199
1121
  ): ChildProcess;
1200
1122
  function execFile(
1201
1123
  file: string,
1202
1124
  args: readonly string[] | undefined | null,
1203
1125
  options: ExecFileOptionsWithBufferEncoding,
1204
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1126
+ callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
1205
1127
  ): ChildProcess;
1206
- // `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`.
1207
1129
  function execFile(
1208
1130
  file: string,
1209
1131
  options: ExecFileOptionsWithStringEncoding,
1210
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1132
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1211
1133
  ): ChildProcess;
1212
1134
  function execFile(
1213
1135
  file: string,
1214
1136
  args: readonly string[] | undefined | null,
1215
1137
  options: ExecFileOptionsWithStringEncoding,
1216
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1217
- ): ChildProcess;
1218
- // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
1219
- // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
1220
- function execFile(
1221
- file: string,
1222
- options: ExecFileOptionsWithOtherEncoding,
1223
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1224
- ): ChildProcess;
1225
- function execFile(
1226
- file: string,
1227
- args: readonly string[] | undefined | null,
1228
- options: ExecFileOptionsWithOtherEncoding,
1229
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1230
- ): ChildProcess;
1231
- // `options` without an `encoding` means stdout/stderr are definitely `string`.
1232
- function execFile(
1233
- file: string,
1234
- options: ExecFileOptions,
1235
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1236
- ): ChildProcess;
1237
- function execFile(
1238
- file: string,
1239
- args: readonly string[] | undefined | null,
1240
- options: ExecFileOptions,
1241
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1138
+ callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1242
1139
  ): ChildProcess;
1243
1140
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
1244
1141
  function execFile(
1245
1142
  file: string,
1246
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1143
+ options: ExecFileOptions | undefined | null,
1247
1144
  callback:
1248
- | ((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)
1249
1150
  | undefined
1250
1151
  | null,
1251
1152
  ): ChildProcess;
1252
1153
  function execFile(
1253
1154
  file: string,
1254
1155
  args: readonly string[] | undefined | null,
1255
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1156
+ options: ExecFileOptions | undefined | null,
1256
1157
  callback:
1257
- | ((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)
1258
1163
  | undefined
1259
1164
  | null,
1260
1165
  ): ChildProcess;
@@ -1274,16 +1179,16 @@ declare module "node:child_process" {
1274
1179
  file: string,
1275
1180
  options: ExecFileOptionsWithBufferEncoding,
1276
1181
  ): PromiseWithChild<{
1277
- stdout: Buffer;
1278
- stderr: Buffer;
1182
+ stdout: NonSharedBuffer;
1183
+ stderr: NonSharedBuffer;
1279
1184
  }>;
1280
1185
  function __promisify__(
1281
1186
  file: string,
1282
1187
  args: readonly string[] | undefined | null,
1283
1188
  options: ExecFileOptionsWithBufferEncoding,
1284
1189
  ): PromiseWithChild<{
1285
- stdout: Buffer;
1286
- stderr: Buffer;
1190
+ stdout: NonSharedBuffer;
1191
+ stderr: NonSharedBuffer;
1287
1192
  }>;
1288
1193
  function __promisify__(
1289
1194
  file: string,
@@ -1302,48 +1207,18 @@ declare module "node:child_process" {
1302
1207
  }>;
1303
1208
  function __promisify__(
1304
1209
  file: string,
1305
- options: ExecFileOptionsWithOtherEncoding,
1306
- ): PromiseWithChild<{
1307
- stdout: string | Buffer;
1308
- stderr: string | Buffer;
1309
- }>;
1310
- function __promisify__(
1311
- file: string,
1312
- args: readonly string[] | undefined | null,
1313
- options: ExecFileOptionsWithOtherEncoding,
1314
- ): PromiseWithChild<{
1315
- stdout: string | Buffer;
1316
- stderr: string | Buffer;
1317
- }>;
1318
- function __promisify__(
1319
- file: string,
1320
- options: ExecFileOptions,
1321
- ): PromiseWithChild<{
1322
- stdout: string;
1323
- stderr: string;
1324
- }>;
1325
- function __promisify__(
1326
- file: string,
1327
- args: readonly string[] | undefined | null,
1328
- options: ExecFileOptions,
1210
+ options: ExecFileOptions | undefined | null,
1329
1211
  ): PromiseWithChild<{
1330
- stdout: string;
1331
- stderr: string;
1332
- }>;
1333
- function __promisify__(
1334
- file: string,
1335
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1336
- ): PromiseWithChild<{
1337
- stdout: string | Buffer;
1338
- stderr: string | Buffer;
1212
+ stdout: string | NonSharedBuffer;
1213
+ stderr: string | NonSharedBuffer;
1339
1214
  }>;
1340
1215
  function __promisify__(
1341
1216
  file: string,
1342
1217
  args: readonly string[] | undefined | null,
1343
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
1218
+ options: ExecFileOptions | undefined | null,
1344
1219
  ): PromiseWithChild<{
1345
- stdout: string | Buffer;
1346
- stderr: string | Buffer;
1220
+ stdout: string | NonSharedBuffer;
1221
+ stderr: string | NonSharedBuffer;
1347
1222
  }>;
1348
1223
  }
1349
1224
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
@@ -1432,7 +1307,7 @@ declare module "node:child_process" {
1432
1307
  stderr: T;
1433
1308
  status: number | null;
1434
1309
  signal: NodeJS.Signals | null;
1435
- error?: Error | undefined;
1310
+ error?: Error;
1436
1311
  }
1437
1312
  /**
1438
1313
  * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
@@ -1449,11 +1324,11 @@ declare module "node:child_process" {
1449
1324
  * @param command The command to run.
1450
1325
  * @param args List of string arguments.
1451
1326
  */
1452
- function spawnSync(command: string): SpawnSyncReturns<Buffer>;
1327
+ function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
1453
1328
  function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
1454
- function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
1455
- function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
1456
- 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>;
1457
1332
  function spawnSync(
1458
1333
  command: string,
1459
1334
  args: readonly string[],
@@ -1463,12 +1338,12 @@ declare module "node:child_process" {
1463
1338
  command: string,
1464
1339
  args: readonly string[],
1465
1340
  options: SpawnSyncOptionsWithBufferEncoding,
1466
- ): SpawnSyncReturns<Buffer>;
1341
+ ): SpawnSyncReturns<NonSharedBuffer>;
1467
1342
  function spawnSync(
1468
1343
  command: string,
1469
1344
  args?: readonly string[],
1470
1345
  options?: SpawnSyncOptions,
1471
- ): SpawnSyncReturns<string | Buffer>;
1346
+ ): SpawnSyncReturns<string | NonSharedBuffer>;
1472
1347
  interface CommonExecOptions extends CommonOptions {
1473
1348
  input?: string | NodeJS.ArrayBufferView | undefined;
1474
1349
  /**
@@ -1510,10 +1385,10 @@ declare module "node:child_process" {
1510
1385
  * @param command The command to run.
1511
1386
  * @return The stdout from the command.
1512
1387
  */
1513
- function execSync(command: string): Buffer;
1388
+ function execSync(command: string): NonSharedBuffer;
1514
1389
  function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
1515
- function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
1516
- 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;
1517
1392
  interface ExecFileSyncOptions extends CommonExecOptions {
1518
1393
  shell?: boolean | string | undefined;
1519
1394
  }
@@ -1521,7 +1396,7 @@ declare module "node:child_process" {
1521
1396
  encoding: BufferEncoding;
1522
1397
  }
1523
1398
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1524
- encoding?: "buffer" | null; // specify `null`.
1399
+ encoding?: "buffer" | null | undefined; // specify `null`.
1525
1400
  }
1526
1401
  /**
1527
1402
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
@@ -1543,11 +1418,11 @@ declare module "node:child_process" {
1543
1418
  * @param args List of string arguments.
1544
1419
  * @return The stdout from the command.
1545
1420
  */
1546
- function execFileSync(file: string): Buffer;
1421
+ function execFileSync(file: string): NonSharedBuffer;
1547
1422
  function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
1548
- function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1549
- function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
1550
- 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;
1551
1426
  function execFileSync(
1552
1427
  file: string,
1553
1428
  args: readonly string[],
@@ -1557,6 +1432,10 @@ declare module "node:child_process" {
1557
1432
  file: string,
1558
1433
  args: readonly string[],
1559
1434
  options: ExecFileSyncOptionsWithBufferEncoding,
1560
- ): Buffer;
1561
- 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;
1562
1441
  }