@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
package/globals.d.ts CHANGED
@@ -13,371 +13,154 @@
13
13
  ******************************************************************************/
14
14
 
15
15
 
16
- export {}; // Make this a module
16
+ declare var global: typeof globalThis;
17
17
 
18
- // #region Fetch and friends
19
- // Conditional type aliases, used at the end of this file.
20
- // Will either be empty if lib.dom (or lib.webworker) is included, or the undici version otherwise.
21
- type _Request = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').Request;
22
- type _Response = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').Response;
23
- type _FormData = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').FormData;
24
- type _Headers = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').Headers;
25
- type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').MessageEvent;
26
- type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
27
- : import('./undici-types').RequestInit;
28
- type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
29
- : import('./undici-types').ResponseInit;
30
- type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').WebSocket;
31
- type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').EventSource;
32
- type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : import('./undici-types').CloseEvent;
33
- // #endregion Fetch and friends
34
-
35
- // Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
36
- type _Storage = typeof globalThis extends { onabort: any } ? {} : {
37
- readonly length: number;
38
- clear(): void;
39
- getItem(key: string): string | null;
40
- key(index: number): string | null;
41
- removeItem(key: string): void;
42
- setItem(key: string, value: string): void;
43
- [key: string]: any;
44
- };
45
-
46
- // #region DOMException
47
- type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
48
- interface NodeDOMException extends Error {
49
- readonly code: number;
50
- readonly message: string;
51
- readonly name: string;
52
- readonly INDEX_SIZE_ERR: 1;
53
- readonly DOMSTRING_SIZE_ERR: 2;
54
- readonly HIERARCHY_REQUEST_ERR: 3;
55
- readonly WRONG_DOCUMENT_ERR: 4;
56
- readonly INVALID_CHARACTER_ERR: 5;
57
- readonly NO_DATA_ALLOWED_ERR: 6;
58
- readonly NO_MODIFICATION_ALLOWED_ERR: 7;
59
- readonly NOT_FOUND_ERR: 8;
60
- readonly NOT_SUPPORTED_ERR: 9;
61
- readonly INUSE_ATTRIBUTE_ERR: 10;
62
- readonly INVALID_STATE_ERR: 11;
63
- readonly SYNTAX_ERR: 12;
64
- readonly INVALID_MODIFICATION_ERR: 13;
65
- readonly NAMESPACE_ERR: 14;
66
- readonly INVALID_ACCESS_ERR: 15;
67
- readonly VALIDATION_ERR: 16;
68
- readonly TYPE_MISMATCH_ERR: 17;
69
- readonly SECURITY_ERR: 18;
70
- readonly NETWORK_ERR: 19;
71
- readonly ABORT_ERR: 20;
72
- readonly URL_MISMATCH_ERR: 21;
73
- readonly QUOTA_EXCEEDED_ERR: 22;
74
- readonly TIMEOUT_ERR: 23;
75
- readonly INVALID_NODE_TYPE_ERR: 24;
76
- readonly DATA_CLONE_ERR: 25;
77
- }
78
- interface NodeDOMExceptionConstructor {
79
- prototype: DOMException;
80
- new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException;
81
- readonly INDEX_SIZE_ERR: 1;
82
- readonly DOMSTRING_SIZE_ERR: 2;
83
- readonly HIERARCHY_REQUEST_ERR: 3;
84
- readonly WRONG_DOCUMENT_ERR: 4;
85
- readonly INVALID_CHARACTER_ERR: 5;
86
- readonly NO_DATA_ALLOWED_ERR: 6;
87
- readonly NO_MODIFICATION_ALLOWED_ERR: 7;
88
- readonly NOT_FOUND_ERR: 8;
89
- readonly NOT_SUPPORTED_ERR: 9;
90
- readonly INUSE_ATTRIBUTE_ERR: 10;
91
- readonly INVALID_STATE_ERR: 11;
92
- readonly SYNTAX_ERR: 12;
93
- readonly INVALID_MODIFICATION_ERR: 13;
94
- readonly NAMESPACE_ERR: 14;
95
- readonly INVALID_ACCESS_ERR: 15;
96
- readonly VALIDATION_ERR: 16;
97
- readonly TYPE_MISMATCH_ERR: 17;
98
- readonly SECURITY_ERR: 18;
99
- readonly NETWORK_ERR: 19;
100
- readonly ABORT_ERR: 20;
101
- readonly URL_MISMATCH_ERR: 21;
102
- readonly QUOTA_EXCEEDED_ERR: 22;
103
- readonly TIMEOUT_ERR: 23;
104
- readonly INVALID_NODE_TYPE_ERR: 24;
105
- readonly DATA_CLONE_ERR: 25;
106
- }
107
- // #endregion DOMException
108
-
109
- declare global {
110
- var global: typeof globalThis;
111
-
112
- var process: NodeJS.Process;
113
- var console: Console;
114
-
115
- interface ErrorConstructor {
116
- /**
117
- * Creates a `.stack` property on `targetObject`, which when accessed returns
118
- * a string representing the location in the code at which
119
- * `Error.captureStackTrace()` was called.
120
- *
121
- * ```js
122
- * const myObject = {};
123
- * Error.captureStackTrace(myObject);
124
- * myObject.stack; // Similar to `new Error().stack`
125
- * ```
126
- *
127
- * The first line of the trace will be prefixed with
128
- * `${myObject.name}: ${myObject.message}`.
129
- *
130
- * The optional `constructorOpt` argument accepts a function. If given, all frames
131
- * above `constructorOpt`, including `constructorOpt`, will be omitted from the
132
- * generated stack trace.
133
- *
134
- * The `constructorOpt` argument is useful for hiding implementation
135
- * details of error generation from the user. For instance:
136
- *
137
- * ```js
138
- * function a() {
139
- * b();
140
- * }
141
- *
142
- * function b() {
143
- * c();
144
- * }
145
- *
146
- * function c() {
147
- * // Create an error without stack trace to avoid calculating the stack trace twice.
148
- * const { stackTraceLimit } = Error;
149
- * Error.stackTraceLimit = 0;
150
- * const error = new Error();
151
- * Error.stackTraceLimit = stackTraceLimit;
152
- *
153
- * // Capture the stack trace above function b
154
- * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
155
- * throw error;
156
- * }
157
- *
158
- * a();
159
- * ```
160
- */
161
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
162
- /**
163
- * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
164
- */
165
- prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
166
- /**
167
- * The `Error.stackTraceLimit` property specifies the number of stack frames
168
- * collected by a stack trace (whether generated by `new Error().stack` or
169
- * `Error.captureStackTrace(obj)`).
170
- *
171
- * The default value is `10` but may be set to any valid JavaScript number. Changes
172
- * will affect any stack trace captured _after_ the value has been changed.
173
- *
174
- * If set to a non-number value, or set to a negative number, stack traces will
175
- * not capture any frames.
176
- */
177
- stackTraceLimit: number;
178
- }
18
+ declare var process: NodeJS.Process;
179
19
 
20
+ interface ErrorConstructor {
180
21
  /**
181
- * Enable this API with the `--expose-gc` CLI flag.
22
+ * Creates a `.stack` property on `targetObject`, which when accessed returns
23
+ * a string representing the location in the code at which
24
+ * `Error.captureStackTrace()` was called.
25
+ *
26
+ * ```js
27
+ * const myObject = {};
28
+ * Error.captureStackTrace(myObject);
29
+ * myObject.stack; // Similar to `new Error().stack`
30
+ * ```
31
+ *
32
+ * The first line of the trace will be prefixed with
33
+ * `${myObject.name}: ${myObject.message}`.
34
+ *
35
+ * The optional `constructorOpt` argument accepts a function. If given, all frames
36
+ * above `constructorOpt`, including `constructorOpt`, will be omitted from the
37
+ * generated stack trace.
38
+ *
39
+ * The `constructorOpt` argument is useful for hiding implementation
40
+ * details of error generation from the user. For instance:
41
+ *
42
+ * ```js
43
+ * function a() {
44
+ * b();
45
+ * }
46
+ *
47
+ * function b() {
48
+ * c();
49
+ * }
50
+ *
51
+ * function c() {
52
+ * // Create an error without stack trace to avoid calculating the stack trace twice.
53
+ * const { stackTraceLimit } = Error;
54
+ * Error.stackTraceLimit = 0;
55
+ * const error = new Error();
56
+ * Error.stackTraceLimit = stackTraceLimit;
57
+ *
58
+ * // Capture the stack trace above function b
59
+ * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
60
+ * throw error;
61
+ * }
62
+ *
63
+ * a();
64
+ * ```
182
65
  */
183
- var gc: NodeJS.GCFunction | undefined;
184
-
185
- namespace NodeJS {
186
- interface CallSite {
187
- getColumnNumber(): number | null;
188
- getEnclosingColumnNumber(): number | null;
189
- getEnclosingLineNumber(): number | null;
190
- getEvalOrigin(): string | undefined;
191
- getFileName(): string | null;
192
- getFunction(): Function | undefined;
193
- getFunctionName(): string | null;
194
- getLineNumber(): number | null;
195
- getMethodName(): string | null;
196
- getPosition(): number;
197
- getPromiseIndex(): number | null;
198
- getScriptHash(): string;
199
- getScriptNameOrSourceURL(): string | null;
200
- getThis(): unknown;
201
- getTypeName(): string | null;
202
- isAsync(): boolean;
203
- isConstructor(): boolean;
204
- isEval(): boolean;
205
- isNative(): boolean;
206
- isPromiseAll(): boolean;
207
- isToplevel(): boolean;
208
- }
209
-
210
- interface ErrnoException extends Error {
211
- errno?: number | undefined;
212
- code?: string | undefined;
213
- path?: string | undefined;
214
- syscall?: string | undefined;
215
- }
216
-
217
- interface ReadableStream extends EventEmitter {
218
- readable: boolean;
219
- read(size?: number): string | Buffer;
220
- setEncoding(encoding: BufferEncoding): this;
221
- pause(): this;
222
- resume(): this;
223
- isPaused(): boolean;
224
- pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
225
- unpipe(destination?: WritableStream): this;
226
- unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
227
- wrap(oldStream: ReadableStream): this;
228
- [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
229
- }
230
-
231
- interface WritableStream extends EventEmitter {
232
- writable: boolean;
233
- write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
234
- write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
235
- end(cb?: () => void): this;
236
- end(data: string | Uint8Array, cb?: () => void): this;
237
- end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
238
- }
239
-
240
- interface ReadWriteStream extends ReadableStream, WritableStream {}
241
-
242
- interface RefCounted {
243
- ref(): this;
244
- unref(): this;
245
- }
246
-
247
- interface Dict<T> {
248
- [key: string]: T | undefined;
249
- }
250
-
251
- interface ReadOnlyDict<T> {
252
- readonly [key: string]: T | undefined;
253
- }
254
-
255
- interface GCFunction {
256
- (minor?: boolean): void;
257
- (options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
258
- (options: NodeJS.GCOptions): void;
259
- }
260
-
261
- interface GCOptions {
262
- execution?: "sync" | "async" | undefined;
263
- flavor?: "regular" | "last-resort" | undefined;
264
- type?: "major-snapshot" | "major" | "minor" | undefined;
265
- filename?: string | undefined;
266
- }
267
-
268
- /** An iterable iterator returned by the Node.js API. */
269
- interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
270
- [Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
271
- }
66
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
67
+ /**
68
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
69
+ */
70
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
71
+ /**
72
+ * The `Error.stackTraceLimit` property specifies the number of stack frames
73
+ * collected by a stack trace (whether generated by `new Error().stack` or
74
+ * `Error.captureStackTrace(obj)`).
75
+ *
76
+ * The default value is `10` but may be set to any valid JavaScript number. Changes
77
+ * will affect any stack trace captured _after_ the value has been changed.
78
+ *
79
+ * If set to a non-number value, or set to a negative number, stack traces will
80
+ * not capture any frames.
81
+ */
82
+ stackTraceLimit: number;
83
+ }
272
84
 
273
- /** An async iterable iterator returned by the Node.js API. */
274
- interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
275
- [Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
276
- }
85
+ /**
86
+ * Enable this API with the `--expose-gc` CLI flag.
87
+ */
88
+ declare var gc: NodeJS.GCFunction | undefined;
89
+
90
+ declare namespace NodeJS {
91
+ interface CallSite {
92
+ getColumnNumber(): number | null;
93
+ getEnclosingColumnNumber(): number | null;
94
+ getEnclosingLineNumber(): number | null;
95
+ getEvalOrigin(): string | undefined;
96
+ getFileName(): string | null;
97
+ getFunction(): Function | undefined;
98
+ getFunctionName(): string | null;
99
+ getLineNumber(): number | null;
100
+ getMethodName(): string | null;
101
+ getPosition(): number;
102
+ getPromiseIndex(): number | null;
103
+ getScriptHash(): string;
104
+ getScriptNameOrSourceURL(): string | null;
105
+ getThis(): unknown;
106
+ getTypeName(): string | null;
107
+ isAsync(): boolean;
108
+ isConstructor(): boolean;
109
+ isEval(): boolean;
110
+ isNative(): boolean;
111
+ isPromiseAll(): boolean;
112
+ isToplevel(): boolean;
277
113
  }
278
114
 
279
- // Global DOM types
280
-
281
- interface DOMException extends _DOMException {}
282
- var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
283
- : NodeDOMExceptionConstructor;
284
-
285
- // #region AbortController
286
- interface AbortController {
287
- readonly signal: AbortSignal;
288
- abort(reason?: any): void;
115
+ interface ErrnoException extends Error {
116
+ errno?: number | undefined;
117
+ code?: string | undefined;
118
+ path?: string | undefined;
119
+ syscall?: string | undefined;
289
120
  }
290
- var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
291
- : {
292
- prototype: AbortController;
293
- new(): AbortController;
294
- };
295
121
 
296
- interface AbortSignal extends EventTarget {
297
- readonly aborted: boolean;
298
- onabort: ((this: AbortSignal, ev: Event) => any) | null;
299
- readonly reason: any;
300
- throwIfAborted(): void;
122
+ interface RefCounted {
123
+ ref(): this;
124
+ unref(): this;
301
125
  }
302
- var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
303
- : {
304
- prototype: AbortSignal;
305
- new(): AbortSignal;
306
- abort(reason?: any): AbortSignal;
307
- any(signals: AbortSignal[]): AbortSignal;
308
- timeout(milliseconds: number): AbortSignal;
309
- };
310
- // #endregion AbortController
311
-
312
- // #region Storage
313
- interface Storage extends _Storage {}
314
- // Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
315
- var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
316
- : {
317
- prototype: Storage;
318
- new(): Storage;
319
- };
320
126
 
321
- var localStorage: Storage;
322
- var sessionStorage: Storage;
323
- // #endregion Storage
324
-
325
- // #region fetch
326
- interface RequestInit extends _RequestInit {}
327
-
328
- function fetch(
329
- input: string | URL | globalThis.Request,
330
- init?: RequestInit,
331
- ): Promise<Response>;
332
-
333
- interface Request extends _Request {}
334
- var Request: typeof globalThis extends {
335
- onmessage: any;
336
- Request: infer T;
337
- } ? T
338
- : typeof import('./undici-types').Request;
127
+ interface Dict<T> {
128
+ [key: string]: T | undefined;
129
+ }
339
130
 
340
- interface ResponseInit extends _ResponseInit {}
131
+ interface ReadOnlyDict<T> {
132
+ readonly [key: string]: T | undefined;
133
+ }
341
134
 
342
- interface Response extends _Response {}
343
- var Response: typeof globalThis extends {
344
- onmessage: any;
345
- Response: infer T;
346
- } ? T
347
- : typeof import('./undici-types').Response;
135
+ type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
348
136
 
349
- interface FormData extends _FormData {}
350
- var FormData: typeof globalThis extends {
351
- onmessage: any;
352
- FormData: infer T;
353
- } ? T
354
- : typeof import('./undici-types').FormData;
137
+ interface GCFunction {
138
+ (minor?: boolean): void;
139
+ (options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
140
+ (options: NodeJS.GCOptions): void;
141
+ }
355
142
 
356
- interface Headers extends _Headers {}
357
- var Headers: typeof globalThis extends {
358
- onmessage: any;
359
- Headers: infer T;
360
- } ? T
361
- : typeof import('./undici-types').Headers;
143
+ interface GCOptions {
144
+ execution?: "sync" | "async" | undefined;
145
+ flavor?: "regular" | "last-resort" | undefined;
146
+ type?: "major-snapshot" | "major" | "minor" | undefined;
147
+ filename?: string | undefined;
148
+ }
362
149
 
363
- interface MessageEvent extends _MessageEvent {}
364
- var MessageEvent: typeof globalThis extends {
365
- onmessage: any;
366
- MessageEvent: infer T;
367
- } ? T
368
- : typeof import('./undici-types').MessageEvent;
150
+ /** An iterable iterator returned by the Node.js API. */
151
+ interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
152
+ [Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
153
+ }
369
154
 
370
- interface WebSocket extends _WebSocket {}
371
- var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T
372
- : typeof import('./undici-types').WebSocket;
155
+ /** An async iterable iterator returned by the Node.js API. */
156
+ interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
157
+ [Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
158
+ }
373
159
 
374
- interface EventSource extends _EventSource {}
375
- var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
376
- : typeof import('./undici-types').EventSource;
160
+ /** The [`BufferSource`](https://webidl.spec.whatwg.org/#BufferSource) type from the Web IDL specification. */
161
+ type BufferSource = NonSharedArrayBufferView | ArrayBuffer;
377
162
 
378
- interface CloseEvent extends _CloseEvent {}
379
- var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T
380
- : typeof import('./undici-types').CloseEvent;
381
- // #endregion fetch
163
+ /** The [`AllowSharedBufferSource`](https://webidl.spec.whatwg.org/#AllowSharedBufferSource) type from the Web IDL specification. */
164
+ type AllowSharedBufferSource = ArrayBufferView | ArrayBufferLike;
382
165
  }
383
166
 
@@ -33,6 +33,85 @@ declare global {
33
33
  type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
34
34
  | TypedArray<TArrayBuffer>
35
35
  | DataView<TArrayBuffer>;
36
+
37
+ // The following aliases are required to allow use of non-shared ArrayBufferViews in @types/node
38
+ // while maintaining compatibility with TS <=5.6.
39
+ // TODO: remove once @types/node no longer supports TS 5.6, and replace with native types.
40
+ /**
41
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
42
+ * TypeScript versions earlier than 5.7.
43
+ */
44
+ type NonSharedUint8Array = Uint8Array<ArrayBuffer>;
45
+ /**
46
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
47
+ * TypeScript versions earlier than 5.7.
48
+ */
49
+ type NonSharedUint8ClampedArray = Uint8ClampedArray<ArrayBuffer>;
50
+ /**
51
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
52
+ * TypeScript versions earlier than 5.7.
53
+ */
54
+ type NonSharedUint16Array = Uint16Array<ArrayBuffer>;
55
+ /**
56
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
57
+ * TypeScript versions earlier than 5.7.
58
+ */
59
+ type NonSharedUint32Array = Uint32Array<ArrayBuffer>;
60
+ /**
61
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
62
+ * TypeScript versions earlier than 5.7.
63
+ */
64
+ type NonSharedInt8Array = Int8Array<ArrayBuffer>;
65
+ /**
66
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
67
+ * TypeScript versions earlier than 5.7.
68
+ */
69
+ type NonSharedInt16Array = Int16Array<ArrayBuffer>;
70
+ /**
71
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
72
+ * TypeScript versions earlier than 5.7.
73
+ */
74
+ type NonSharedInt32Array = Int32Array<ArrayBuffer>;
75
+ /**
76
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
77
+ * TypeScript versions earlier than 5.7.
78
+ */
79
+ type NonSharedBigUint64Array = BigUint64Array<ArrayBuffer>;
80
+ /**
81
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
82
+ * TypeScript versions earlier than 5.7.
83
+ */
84
+ type NonSharedBigInt64Array = BigInt64Array<ArrayBuffer>;
85
+ /**
86
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
87
+ * TypeScript versions earlier than 5.7.
88
+ */
89
+ type NonSharedFloat16Array = Float16Array<ArrayBuffer>;
90
+ /**
91
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
92
+ * TypeScript versions earlier than 5.7.
93
+ */
94
+ type NonSharedFloat32Array = Float32Array<ArrayBuffer>;
95
+ /**
96
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
97
+ * TypeScript versions earlier than 5.7.
98
+ */
99
+ type NonSharedFloat64Array = Float64Array<ArrayBuffer>;
100
+ /**
101
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
102
+ * TypeScript versions earlier than 5.7.
103
+ */
104
+ type NonSharedDataView = DataView<ArrayBuffer>;
105
+ /**
106
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
107
+ * TypeScript versions earlier than 5.7.
108
+ */
109
+ type NonSharedTypedArray = TypedArray<ArrayBuffer>;
110
+ /**
111
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
112
+ * TypeScript versions earlier than 5.7.
113
+ */
114
+ type NonSharedArrayBufferView = ArrayBufferView<ArrayBuffer>;
36
115
  }
37
116
  }
38
117