@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/stream/web.d.ts CHANGED
@@ -13,121 +13,95 @@
13
13
  ******************************************************************************/
14
14
 
15
15
 
16
- type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
17
- : import('node:stream/web').ByteLengthQueuingStrategy;
18
- type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
19
- : import('node:stream/web').CompressionStream;
20
- type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
21
- : import('node:stream/web').CountQueuingStrategy;
22
- type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
23
- : import('node:stream/web').DecompressionStream;
24
- type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
25
- : import('node:stream/web').ReadableByteStreamController;
26
- type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
27
- : import('node:stream/web').ReadableStream<R>;
28
- type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
29
- : import('node:stream/web').ReadableStreamBYOBReader;
30
- type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
31
- : import('node:stream/web').ReadableStreamBYOBRequest;
32
- type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
33
- : import('node:stream/web').ReadableStreamDefaultController<R>;
34
- type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
35
- : import('node:stream/web').ReadableStreamDefaultReader<R>;
36
- type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
37
- : import('node:stream/web').TextDecoderStream;
38
- type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
39
- : import('node:stream/web').TextEncoderStream;
40
- type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
41
- : import('node:stream/web').TransformStream<I, O>;
42
- type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
43
- : import('node:stream/web').TransformStreamDefaultController<O>;
44
- type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
45
- : import('node:stream/web').WritableStream<W>;
46
- type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
47
- : import('node:stream/web').WritableStreamDefaultController;
48
- type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
49
- : import('node:stream/web').WritableStreamDefaultWriter<W>;
50
-
51
16
 
52
17
  declare module "node:stream/web" {
53
- // stub module, pending copy&paste from .d.ts or manual impl
54
- // copy from lib.dom.d.ts
18
+ import { TextDecoderCommon, TextDecoderOptions, TextEncoderCommon } from 'node:util';
19
+ type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip";
20
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
21
+ type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
22
+ type ReadableStreamReaderMode = "byob";
23
+ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
24
+ type ReadableStreamType = "bytes";
25
+ interface GenericTransformStream {
26
+ readonly readable: ReadableStream;
27
+ readonly writable: WritableStream;
28
+ }
29
+ interface QueuingStrategy<T = any> {
30
+ highWaterMark?: number;
31
+ size?: QueuingStrategySize<T>;
32
+ }
33
+ interface QueuingStrategyInit {
34
+ highWaterMark: number;
35
+ }
36
+ interface QueuingStrategySize<T = any> {
37
+ (chunk: T): number;
38
+ }
39
+ interface ReadableStreamBYOBReaderReadOptions {
40
+ min?: number;
41
+ }
42
+ interface ReadableStreamGenericReader {
43
+ readonly closed: Promise<void>;
44
+ cancel(reason?: any): Promise<void>;
45
+ }
46
+ interface ReadableStreamGetReaderOptions {
47
+ mode?: ReadableStreamReaderMode;
48
+ }
49
+ interface ReadableStreamIteratorOptions {
50
+ preventCancel?: boolean;
51
+ }
52
+ interface ReadableStreamReadDoneResult<T> {
53
+ done: true;
54
+ value: T | undefined;
55
+ }
56
+ interface ReadableStreamReadValueResult<T> {
57
+ done: false;
58
+ value: T;
59
+ }
55
60
  interface ReadableWritablePair<R = any, W = any> {
56
61
  readable: ReadableStream<R>;
57
- /**
58
- * Provides a convenient, chainable way of piping this readable stream
59
- * through a transform stream (or any other { writable, readable }
60
- * pair). It simply pipes the stream into the writable side of the
61
- * supplied pair, and returns the readable side for further use.
62
- *
63
- * Piping a stream will lock it for the duration of the pipe, preventing
64
- * any other consumer from acquiring a reader.
65
- */
66
62
  writable: WritableStream<W>;
67
63
  }
68
64
  interface StreamPipeOptions {
69
65
  preventAbort?: boolean;
70
66
  preventCancel?: boolean;
71
- /**
72
- * Pipes this readable stream to a given writable stream destination.
73
- * The way in which the piping process behaves under various error
74
- * conditions can be customized with a number of passed options. It
75
- * returns a promise that fulfills when the piping process completes
76
- * successfully, or rejects if any errors were encountered.
77
- *
78
- * Piping a stream will lock it for the duration of the pipe, preventing
79
- * any other consumer from acquiring a reader.
80
- *
81
- * Errors and closures of the source and destination streams propagate
82
- * as follows:
83
- *
84
- * An error in this source readable stream will abort destination,
85
- * unless preventAbort is truthy. The returned promise will be rejected
86
- * with the source's error, or with any error that occurs during
87
- * aborting the destination.
88
- *
89
- * An error in destination will cancel this source readable stream,
90
- * unless preventCancel is truthy. The returned promise will be rejected
91
- * with the destination's error, or with any error that occurs during
92
- * canceling the source.
93
- *
94
- * When this source readable stream closes, destination will be closed,
95
- * unless preventClose is truthy. The returned promise will be fulfilled
96
- * once this process completes, unless an error is encountered while
97
- * closing the destination, in which case it will be rejected with that
98
- * error.
99
- *
100
- * If destination starts out closed or closing, this source readable
101
- * stream will be canceled, unless preventCancel is true. The returned
102
- * promise will be rejected with an error indicating piping to a closed
103
- * stream failed, or with any error that occurs during canceling the
104
- * source.
105
- *
106
- * The signal option can be set to an AbortSignal to allow aborting an
107
- * ongoing pipe operation via the corresponding AbortController. In this
108
- * case, this source readable stream will be canceled, and destination
109
- * aborted, unless the respective options preventCancel or preventAbort
110
- * are set.
111
- */
112
67
  preventClose?: boolean;
113
68
  signal?: AbortSignal;
114
69
  }
115
- interface ReadableStreamGenericReader {
116
- readonly closed: Promise<void>;
117
- cancel(reason?: any): Promise<void>;
70
+ interface Transformer<I = any, O = any> {
71
+ flush?: TransformerFlushCallback<O>;
72
+ readableType?: undefined;
73
+ start?: TransformerStartCallback<O>;
74
+ transform?: TransformerTransformCallback<I, O>;
75
+ writableType?: undefined;
118
76
  }
119
- type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
120
- interface ReadableStreamReadValueResult<T> {
121
- done: false;
122
- value: T;
77
+ interface TransformerFlushCallback<O> {
78
+ (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
123
79
  }
124
- interface ReadableStreamReadDoneResult<T> {
125
- done: true;
126
- value?: T;
80
+ interface TransformerStartCallback<O> {
81
+ (controller: TransformStreamDefaultController<O>): any;
127
82
  }
128
- type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
129
- interface ReadableByteStreamControllerCallback {
130
- (controller: ReadableByteStreamController): void | PromiseLike<void>;
83
+ interface TransformerTransformCallback<I, O> {
84
+ (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
85
+ }
86
+ interface UnderlyingByteSource {
87
+ autoAllocateChunkSize?: number;
88
+ cancel?: UnderlyingSourceCancelCallback;
89
+ pull?: (controller: ReadableByteStreamController) => void | PromiseLike<void>;
90
+ start?: (controller: ReadableByteStreamController) => any;
91
+ type: "bytes";
92
+ }
93
+ interface UnderlyingDefaultSource<R = any> {
94
+ cancel?: UnderlyingSourceCancelCallback;
95
+ pull?: (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>;
96
+ start?: (controller: ReadableStreamDefaultController<R>) => any;
97
+ type?: undefined;
98
+ }
99
+ interface UnderlyingSink<W = any> {
100
+ abort?: UnderlyingSinkAbortCallback;
101
+ close?: UnderlyingSinkCloseCallback;
102
+ start?: UnderlyingSinkStartCallback;
103
+ type?: undefined;
104
+ write?: UnderlyingSinkWriteCallback<W>;
131
105
  }
132
106
  interface UnderlyingSinkAbortCallback {
133
107
  (reason?: any): void | PromiseLike<void>;
@@ -141,6 +115,13 @@ declare module "node:stream/web" {
141
115
  interface UnderlyingSinkWriteCallback<W> {
142
116
  (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
143
117
  }
118
+ interface UnderlyingSource<R = any> {
119
+ autoAllocateChunkSize?: number;
120
+ cancel?: UnderlyingSourceCancelCallback;
121
+ pull?: UnderlyingSourcePullCallback<R>;
122
+ start?: UnderlyingSourceStartCallback<R>;
123
+ type?: ReadableStreamType;
124
+ }
144
125
  interface UnderlyingSourceCancelCallback {
145
126
  (reason?: any): void | PromiseLike<void>;
146
127
  }
@@ -150,45 +131,49 @@ declare module "node:stream/web" {
150
131
  interface UnderlyingSourceStartCallback<R> {
151
132
  (controller: ReadableStreamController<R>): any;
152
133
  }
153
- interface TransformerFlushCallback<O> {
154
- (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
155
- }
156
- interface TransformerStartCallback<O> {
157
- (controller: TransformStreamDefaultController<O>): any;
158
- }
159
- interface TransformerTransformCallback<I, O> {
160
- (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
161
- }
162
- interface TransformerCancelCallback {
163
- (reason: any): void | PromiseLike<void>;
164
- }
165
- interface UnderlyingByteSource {
166
- autoAllocateChunkSize?: number;
167
- cancel?: ReadableStreamErrorCallback;
168
- pull?: ReadableByteStreamControllerCallback;
169
- start?: ReadableByteStreamControllerCallback;
170
- type: "bytes";
134
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<NodeJS.ArrayBufferView> {
135
+ readonly highWaterMark: number;
136
+ readonly size: QueuingStrategySize<NodeJS.ArrayBufferView>;
171
137
  }
172
- interface UnderlyingSource<R = any> {
173
- cancel?: UnderlyingSourceCancelCallback;
174
- pull?: UnderlyingSourcePullCallback<R>;
175
- start?: UnderlyingSourceStartCallback<R>;
176
- type?: undefined;
138
+ var ByteLengthQueuingStrategy: {
139
+ prototype: ByteLengthQueuingStrategy;
140
+ new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
141
+ };
142
+ interface CompressionStream extends GenericTransformStream {
143
+ readonly readable: ReadableStream<NodeJS.NonSharedUint8Array>;
144
+ readonly writable: WritableStream<NodeJS.BufferSource>;
177
145
  }
178
- interface UnderlyingSink<W = any> {
179
- abort?: UnderlyingSinkAbortCallback;
180
- close?: UnderlyingSinkCloseCallback;
181
- start?: UnderlyingSinkStartCallback;
182
- type?: undefined;
183
- write?: UnderlyingSinkWriteCallback<W>;
146
+ var CompressionStream: {
147
+ prototype: CompressionStream;
148
+ new(format: CompressionFormat): CompressionStream;
149
+ };
150
+ interface CountQueuingStrategy extends QueuingStrategy {
151
+ readonly highWaterMark: number;
152
+ readonly size: QueuingStrategySize;
184
153
  }
185
- interface ReadableStreamErrorCallback {
186
- (reason: any): void | PromiseLike<void>;
154
+ var CountQueuingStrategy: {
155
+ prototype: CountQueuingStrategy;
156
+ new(init: QueuingStrategyInit): CountQueuingStrategy;
157
+ };
158
+ interface DecompressionStream extends GenericTransformStream {
159
+ readonly readable: ReadableStream<NodeJS.NonSharedUint8Array>;
160
+ readonly writable: WritableStream<NodeJS.BufferSource>;
187
161
  }
188
- interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
189
- [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
162
+ var DecompressionStream: {
163
+ prototype: DecompressionStream;
164
+ new(format: CompressionFormat): DecompressionStream;
165
+ };
166
+ interface ReadableByteStreamController {
167
+ readonly byobRequest: ReadableStreamBYOBRequest | null;
168
+ readonly desiredSize: number | null;
169
+ close(): void;
170
+ enqueue(chunk: NodeJS.NonSharedArrayBufferView): void;
171
+ error(e?: any): void;
190
172
  }
191
- /** This Streams API interface represents a readable stream of byte data. */
173
+ var ReadableByteStreamController: {
174
+ prototype: ReadableByteStreamController;
175
+ new(): ReadableByteStreamController;
176
+ };
192
177
  interface ReadableStream<R = any> {
193
178
  readonly locked: boolean;
194
179
  cancel(reason?: any): Promise<void>;
@@ -198,96 +183,81 @@ declare module "node:stream/web" {
198
183
  pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
199
184
  pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
200
185
  tee(): [ReadableStream<R>, ReadableStream<R>];
201
- values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
202
- [Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
186
+ [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
187
+ values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
203
188
  }
204
- const ReadableStream: {
189
+ var ReadableStream: {
205
190
  prototype: ReadableStream;
206
- from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
207
- new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
191
+ new(
192
+ underlyingSource: UnderlyingByteSource,
193
+ strategy?: { highWaterMark?: number },
194
+ ): ReadableStream<NodeJS.NonSharedUint8Array>;
195
+ new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
208
196
  new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
197
+ from<R = any>(iterable: Iterable<R> | AsyncIterable<R>): ReadableStream<R>;
209
198
  };
210
- type ReadableStreamReaderMode = "byob";
211
- interface ReadableStreamGetReaderOptions {
212
- /**
213
- * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
214
- *
215
- * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
216
- */
217
- mode?: ReadableStreamReaderMode;
218
- }
219
- type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
220
- interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
221
- read(): Promise<ReadableStreamReadResult<R>>;
222
- releaseLock(): void;
199
+ interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
200
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
223
201
  }
224
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
225
202
  interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
226
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
227
- read<T extends ArrayBufferView>(
203
+ read<T extends NodeJS.NonSharedArrayBufferView>(
228
204
  view: T,
229
- options?: {
230
- min?: number;
231
- },
205
+ options?: ReadableStreamBYOBReaderReadOptions,
232
206
  ): Promise<ReadableStreamReadResult<T>>;
233
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
234
207
  releaseLock(): void;
235
208
  }
236
- const ReadableStreamDefaultReader: {
237
- prototype: ReadableStreamDefaultReader;
238
- new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
239
- };
240
- const ReadableStreamBYOBReader: {
209
+ var ReadableStreamBYOBReader: {
241
210
  prototype: ReadableStreamBYOBReader;
242
- new(stream: ReadableStream): ReadableStreamBYOBReader;
211
+ new(stream: ReadableStream<NodeJS.NonSharedUint8Array>): ReadableStreamBYOBReader;
243
212
  };
244
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
245
213
  interface ReadableStreamBYOBRequest {
246
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
247
- readonly view: ArrayBufferView | null;
248
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
214
+ readonly view: NodeJS.NonSharedArrayBufferView | null;
249
215
  respond(bytesWritten: number): void;
250
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
251
- respondWithNewView(view: ArrayBufferView): void;
216
+ respondWithNewView(view: NodeJS.NonSharedArrayBufferView): void;
252
217
  }
253
- const ReadableStreamBYOBRequest: {
218
+ var ReadableStreamBYOBRequest: {
254
219
  prototype: ReadableStreamBYOBRequest;
255
220
  new(): ReadableStreamBYOBRequest;
256
221
  };
257
- interface ReadableByteStreamController {
258
- readonly byobRequest: undefined;
259
- readonly desiredSize: number | null;
260
- close(): void;
261
- enqueue(chunk: ArrayBufferView): void;
262
- error(error?: any): void;
263
- }
264
- const ReadableByteStreamController: {
265
- prototype: ReadableByteStreamController;
266
- new(): ReadableByteStreamController;
267
- };
268
222
  interface ReadableStreamDefaultController<R = any> {
269
223
  readonly desiredSize: number | null;
270
224
  close(): void;
271
225
  enqueue(chunk?: R): void;
272
226
  error(e?: any): void;
273
227
  }
274
- const ReadableStreamDefaultController: {
228
+ var ReadableStreamDefaultController: {
275
229
  prototype: ReadableStreamDefaultController;
276
230
  new(): ReadableStreamDefaultController;
277
231
  };
278
- interface Transformer<I = any, O = any> {
279
- flush?: TransformerFlushCallback<O>;
280
- readableType?: undefined;
281
- start?: TransformerStartCallback<O>;
282
- transform?: TransformerTransformCallback<I, O>;
283
- cancel?: TransformerCancelCallback;
284
- writableType?: undefined;
232
+ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
233
+ read(): Promise<ReadableStreamReadResult<R>>;
234
+ releaseLock(): void;
285
235
  }
236
+ var ReadableStreamDefaultReader: {
237
+ prototype: ReadableStreamDefaultReader;
238
+ new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
239
+ };
240
+ interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {
241
+ readonly readable: ReadableStream<string>;
242
+ readonly writable: WritableStream<NodeJS.BufferSource>;
243
+ }
244
+ var TextDecoderStream: {
245
+ prototype: TextDecoderStream;
246
+ new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
247
+ };
248
+ interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
249
+ readonly readable: ReadableStream<NodeJS.NonSharedUint8Array>;
250
+ readonly writable: WritableStream<string>;
251
+ }
252
+ var TextEncoderStream: {
253
+ prototype: TextEncoderStream;
254
+ new(): TextEncoderStream;
255
+ };
286
256
  interface TransformStream<I = any, O = any> {
287
257
  readonly readable: ReadableStream<O>;
288
258
  readonly writable: WritableStream<I>;
289
259
  }
290
- const TransformStream: {
260
+ var TransformStream: {
291
261
  prototype: TransformStream;
292
262
  new<I = any, O = any>(
293
263
  transformer?: Transformer<I, O>,
@@ -301,31 +271,28 @@ declare module "node:stream/web" {
301
271
  error(reason?: any): void;
302
272
  terminate(): void;
303
273
  }
304
- const TransformStreamDefaultController: {
274
+ var TransformStreamDefaultController: {
305
275
  prototype: TransformStreamDefaultController;
306
276
  new(): TransformStreamDefaultController;
307
277
  };
308
- /**
309
- * This Streams API interface provides a standard abstraction for writing
310
- * streaming data to a destination, known as a sink. This object comes with
311
- * built-in back pressure and queuing.
312
- */
313
278
  interface WritableStream<W = any> {
314
279
  readonly locked: boolean;
315
280
  abort(reason?: any): Promise<void>;
316
281
  close(): Promise<void>;
317
282
  getWriter(): WritableStreamDefaultWriter<W>;
318
283
  }
319
- const WritableStream: {
284
+ var WritableStream: {
320
285
  prototype: WritableStream;
321
286
  new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
322
287
  };
323
- /**
324
- * This Streams API interface is the object returned by
325
- * WritableStream.getWriter() and once created locks the < writer to the
326
- * WritableStream ensuring that no other streams can write to the underlying
327
- * sink.
328
- */
288
+ interface WritableStreamDefaultController {
289
+ readonly signal: AbortSignal;
290
+ error(e?: any): void;
291
+ }
292
+ var WritableStreamDefaultController: {
293
+ prototype: WritableStreamDefaultController;
294
+ new(): WritableStreamDefaultController;
295
+ };
329
296
  interface WritableStreamDefaultWriter<W = any> {
330
297
  readonly closed: Promise<void>;
331
298
  readonly desiredSize: number | null;
@@ -335,297 +302,8 @@ declare module "node:stream/web" {
335
302
  releaseLock(): void;
336
303
  write(chunk?: W): Promise<void>;
337
304
  }
338
- const WritableStreamDefaultWriter: {
305
+ var WritableStreamDefaultWriter: {
339
306
  prototype: WritableStreamDefaultWriter;
340
307
  new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
341
308
  };
342
- /**
343
- * This Streams API interface represents a controller allowing control of a
344
- * WritableStream's state. When constructing a WritableStream, the
345
- * underlying sink is given a corresponding WritableStreamDefaultController
346
- * instance to manipulate.
347
- */
348
- interface WritableStreamDefaultController {
349
- error(e?: any): void;
350
- }
351
- const WritableStreamDefaultController: {
352
- prototype: WritableStreamDefaultController;
353
- new(): WritableStreamDefaultController;
354
- };
355
- interface QueuingStrategy<T = any> {
356
- highWaterMark?: number;
357
- size?: QueuingStrategySize<T>;
358
- }
359
- interface QueuingStrategySize<T = any> {
360
- (chunk?: T): number;
361
- }
362
- interface QueuingStrategyInit {
363
- /**
364
- * Creates a new ByteLengthQueuingStrategy with the provided high water
365
- * mark.
366
- *
367
- * Note that the provided high water mark will not be validated ahead of
368
- * time. Instead, if it is negative, NaN, or not a number, the resulting
369
- * ByteLengthQueuingStrategy will cause the corresponding stream
370
- * constructor to throw.
371
- */
372
- highWaterMark: number;
373
- }
374
- /**
375
- * This Streams API interface provides a built-in byte length queuing
376
- * strategy that can be used when constructing streams.
377
- */
378
- interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
379
- readonly highWaterMark: number;
380
- readonly size: QueuingStrategySize<ArrayBufferView>;
381
- }
382
- const ByteLengthQueuingStrategy: {
383
- prototype: ByteLengthQueuingStrategy;
384
- new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
385
- };
386
- /**
387
- * This Streams API interface provides a built-in byte length queuing
388
- * strategy that can be used when constructing streams.
389
- */
390
- interface CountQueuingStrategy extends QueuingStrategy {
391
- readonly highWaterMark: number;
392
- readonly size: QueuingStrategySize;
393
- }
394
- const CountQueuingStrategy: {
395
- prototype: CountQueuingStrategy;
396
- new(init: QueuingStrategyInit): CountQueuingStrategy;
397
- };
398
- interface TextEncoderStream {
399
- /** Returns "utf-8". */
400
- readonly encoding: "utf-8";
401
- readonly readable: ReadableStream<Uint8Array>;
402
- readonly writable: WritableStream<string>;
403
- readonly [Symbol.toStringTag]: string;
404
- }
405
- const TextEncoderStream: {
406
- prototype: TextEncoderStream;
407
- new(): TextEncoderStream;
408
- };
409
- interface TextDecoderOptions {
410
- fatal?: boolean;
411
- ignoreBOM?: boolean;
412
- }
413
- type BufferSource = ArrayBufferView | ArrayBuffer;
414
- interface TextDecoderStream {
415
- /** Returns encoding's name, lower cased. */
416
- readonly encoding: string;
417
- /** Returns `true` if error mode is "fatal", and `false` otherwise. */
418
- readonly fatal: boolean;
419
- /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
420
- readonly ignoreBOM: boolean;
421
- readonly readable: ReadableStream<string>;
422
- readonly writable: WritableStream<BufferSource>;
423
- readonly [Symbol.toStringTag]: string;
424
- }
425
- const TextDecoderStream: {
426
- prototype: TextDecoderStream;
427
- new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
428
- };
429
- interface CompressionStream {
430
- readonly readable: ReadableStream;
431
- readonly writable: WritableStream;
432
- }
433
- const CompressionStream: {
434
- prototype: CompressionStream;
435
- new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
436
- };
437
- interface DecompressionStream {
438
- readonly writable: WritableStream;
439
- readonly readable: ReadableStream;
440
- }
441
- const DecompressionStream: {
442
- prototype: DecompressionStream;
443
- new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
444
- };
445
-
446
- global {
447
- interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
448
- /**
449
- * `ByteLengthQueuingStrategy` class is a global reference for `import { ByteLengthQueuingStrategy } from 'node:stream/web'`.
450
- * https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy
451
- * @since v18.0.0
452
- */
453
- var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
454
- ? T
455
- : typeof import('node:stream/web').ByteLengthQueuingStrategy;
456
-
457
- interface CompressionStream extends _CompressionStream {}
458
- /**
459
- * `CompressionStream` class is a global reference for `import { CompressionStream } from 'node:stream/web'`.
460
- * https://nodejs.org/api/globals.html#class-compressionstream
461
- * @since v18.0.0
462
- */
463
- var CompressionStream: typeof globalThis extends {
464
- onmessage: any;
465
- // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
466
- // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
467
- ReportingObserver: any;
468
- CompressionStream: infer T;
469
- } ? T
470
- // TS 4.8, 4.9, 5.0
471
- : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
472
- prototype: T;
473
- new(format: "deflate" | "deflate-raw" | "gzip"): T;
474
- }
475
- : typeof import('node:stream/web').CompressionStream;
476
-
477
- interface CountQueuingStrategy extends _CountQueuingStrategy {}
478
- /**
479
- * `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`.
480
- * https://nodejs.org/api/globals.html#class-countqueuingstrategy
481
- * @since v18.0.0
482
- */
483
- var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
484
- : typeof import('node:stream/web').CountQueuingStrategy;
485
-
486
- interface DecompressionStream extends _DecompressionStream {}
487
- /**
488
- * `DecompressionStream` class is a global reference for `import { DecompressionStream } from 'node:stream/web'`.
489
- * https://nodejs.org/api/globals.html#class-decompressionstream
490
- * @since v18.0.0
491
- */
492
- var DecompressionStream: typeof globalThis extends {
493
- onmessage: any;
494
- // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
495
- // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
496
- ReportingObserver: any;
497
- DecompressionStream: infer T extends object;
498
- } ? T
499
- // TS 4.8, 4.9, 5.0
500
- : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
501
- prototype: T;
502
- new(format: "deflate" | "deflate-raw" | "gzip"): T;
503
- }
504
- : typeof import('node:stream/web').DecompressionStream;
505
-
506
- interface ReadableByteStreamController extends _ReadableByteStreamController {}
507
- /**
508
- * `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`.
509
- * https://nodejs.org/api/globals.html#class-readablebytestreamcontroller
510
- * @since v18.0.0
511
- */
512
- var ReadableByteStreamController: typeof globalThis extends
513
- { onmessage: any; ReadableByteStreamController: infer T } ? T
514
- : typeof import('node:stream/web').ReadableByteStreamController;
515
-
516
- interface ReadableStream<R = any> extends _ReadableStream<R> {}
517
- /**
518
- * `ReadableStream` class is a global reference for `import { ReadableStream } from 'node:stream/web'`.
519
- * https://nodejs.org/api/globals.html#class-readablestream
520
- * @since v18.0.0
521
- */
522
- var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
523
- : typeof import('node:stream/web').ReadableStream;
524
-
525
- interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
526
- /**
527
- * `ReadableStreamBYOBReader` class is a global reference for `import { ReadableStreamBYOBReader } from 'node:stream/web'`.
528
- * https://nodejs.org/api/globals.html#class-readablestreambyobreader
529
- * @since v18.0.0
530
- */
531
- var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
532
- ? T
533
- : typeof import('node:stream/web').ReadableStreamBYOBReader;
534
-
535
- interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
536
- /**
537
- * `ReadableStreamBYOBRequest` class is a global reference for `import { ReadableStreamBYOBRequest } from 'node:stream/web'`.
538
- * https://nodejs.org/api/globals.html#class-readablestreambyobrequest
539
- * @since v18.0.0
540
- */
541
- var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
542
- ? T
543
- : typeof import('node:stream/web').ReadableStreamBYOBRequest;
544
-
545
- interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
546
- /**
547
- * `ReadableStreamDefaultController` class is a global reference for `import { ReadableStreamDefaultController } from 'node:stream/web'`.
548
- * https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller
549
- * @since v18.0.0
550
- */
551
- var ReadableStreamDefaultController: typeof globalThis extends
552
- { onmessage: any; ReadableStreamDefaultController: infer T } ? T
553
- : typeof import('node:stream/web').ReadableStreamDefaultController;
554
-
555
- interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
556
- /**
557
- * `ReadableStreamDefaultReader` class is a global reference for `import { ReadableStreamDefaultReader } from 'node:stream/web'`.
558
- * https://nodejs.org/api/globals.html#class-readablestreamdefaultreader
559
- * @since v18.0.0
560
- */
561
- var ReadableStreamDefaultReader: typeof globalThis extends
562
- { onmessage: any; ReadableStreamDefaultReader: infer T } ? T
563
- : typeof import('node:stream/web').ReadableStreamDefaultReader;
564
-
565
- interface TextDecoderStream extends _TextDecoderStream {}
566
- /**
567
- * `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`.
568
- * https://nodejs.org/api/globals.html#class-textdecoderstream
569
- * @since v18.0.0
570
- */
571
- var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
572
- : typeof import('node:stream/web').TextDecoderStream;
573
-
574
- interface TextEncoderStream extends _TextEncoderStream {}
575
- /**
576
- * `TextEncoderStream` class is a global reference for `import { TextEncoderStream } from 'node:stream/web'`.
577
- * https://nodejs.org/api/globals.html#class-textencoderstream
578
- * @since v18.0.0
579
- */
580
- var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
581
- : typeof import('node:stream/web').TextEncoderStream;
582
-
583
- interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
584
- /**
585
- * `TransformStream` class is a global reference for `import { TransformStream } from 'node:stream/web'`.
586
- * https://nodejs.org/api/globals.html#class-transformstream
587
- * @since v18.0.0
588
- */
589
- var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
590
- : typeof import('node:stream/web').TransformStream;
591
-
592
- interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
593
- /**
594
- * `TransformStreamDefaultController` class is a global reference for `import { TransformStreamDefaultController } from 'node:stream/web'`.
595
- * https://nodejs.org/api/globals.html#class-transformstreamdefaultcontroller
596
- * @since v18.0.0
597
- */
598
- var TransformStreamDefaultController: typeof globalThis extends
599
- { onmessage: any; TransformStreamDefaultController: infer T } ? T
600
- : typeof import('node:stream/web').TransformStreamDefaultController;
601
-
602
- interface WritableStream<W = any> extends _WritableStream<W> {}
603
- /**
604
- * `WritableStream` class is a global reference for `import { WritableStream } from 'node:stream/web'`.
605
- * https://nodejs.org/api/globals.html#class-writablestream
606
- * @since v18.0.0
607
- */
608
- var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
609
- : typeof import('node:stream/web').WritableStream;
610
-
611
- interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
612
- /**
613
- * `WritableStreamDefaultController` class is a global reference for `import { WritableStreamDefaultController } from 'node:stream/web'`.
614
- * https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller
615
- * @since v18.0.0
616
- */
617
- var WritableStreamDefaultController: typeof globalThis extends
618
- { onmessage: any; WritableStreamDefaultController: infer T } ? T
619
- : typeof import('node:stream/web').WritableStreamDefaultController;
620
-
621
- interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
622
- /**
623
- * `WritableStreamDefaultWriter` class is a global reference for `import { WritableStreamDefaultWriter } from 'node:stream/web'`.
624
- * https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter
625
- * @since v18.0.0
626
- */
627
- var WritableStreamDefaultWriter: typeof globalThis extends
628
- { onmessage: any; WritableStreamDefaultWriter: infer T } ? T
629
- : typeof import('node:stream/web').WritableStreamDefaultWriter;
630
- }
631
309
  }