49be8929eeed05814cb74492060b9bd2c92dd89fc716a53090e8aed0283c1ff228a65cc3972c4ec532b99ff1501b6bfd9e4c0a0de6c921aaee762d6d969cc1 29 KB

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