@types/node 18.17.18 → 18.18.0

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 (119) hide show
  1. {node v18.17 → node v18.18}/README.md +1 -1
  2. node v18.18/assert/strict.d.ts +8 -0
  3. {node v18.17/ts4.8 → node v18.18}/assert.d.ts +48 -24
  4. {node v18.17 → node v18.18}/async_hooks.d.ts +10 -7
  5. {node v18.17 → node v18.18}/buffer.d.ts +32 -34
  6. {node v18.17 → node v18.18}/child_process.d.ts +267 -122
  7. {node v18.17/ts4.8 → node v18.18}/cluster.d.ts +107 -89
  8. {node v18.17/ts4.8 → node v18.18}/console.d.ts +7 -7
  9. node v18.18/constants.d.ts +19 -0
  10. {node v18.17 → node v18.18}/crypto.d.ts +746 -268
  11. {node v18.17/ts4.8 → node v18.18}/dgram.d.ts +86 -45
  12. {node v18.17 → node v18.18}/diagnostics_channel.d.ts +3 -3
  13. {node v18.17 → node v18.18}/dns/promises.d.ts +28 -25
  14. {node v18.17/ts4.8 → node v18.18}/dns.d.ts +203 -62
  15. node v18.18/dom-events.d.ts +122 -0
  16. {node v18.17/ts4.8 → node v18.18}/domain.d.ts +4 -4
  17. {node v18.17 → node v18.18}/events.d.ts +50 -7
  18. {node v18.17 → node v18.18}/fs/promises.d.ts +107 -73
  19. {node v18.17 → node v18.18}/fs.d.ts +513 -311
  20. {node v18.17 → node v18.18}/globals.d.ts +38 -18
  21. {node v18.17 → node v18.18}/http.d.ts +185 -185
  22. {node v18.17 → node v18.18}/http2.d.ts +628 -376
  23. {node v18.17/ts4.8 → node v18.18}/https.d.ts +107 -105
  24. {node v18.17 → node v18.18}/index.d.ts +1 -1
  25. {node v18.17/ts4.8 → node v18.18}/module.d.ts +56 -12
  26. {node v18.17/ts4.8 → node v18.18}/net.d.ts +123 -99
  27. {node v18.17/ts4.8 → node v18.18}/os.d.ts +7 -7
  28. {node v18.17 → node v18.18}/package.json +2 -2
  29. {node v18.17/ts4.8 → node v18.18}/path.d.ts +13 -13
  30. {node v18.17/ts4.8 → node v18.18}/perf_hooks.d.ts +20 -19
  31. {node v18.17/ts4.8 → node v18.18}/process.d.ts +155 -125
  32. {node v18.17 → node v18.18}/punycode.d.ts +3 -3
  33. {node v18.17/ts4.8 → node v18.18}/querystring.d.ts +14 -4
  34. {node v18.17 → node v18.18}/readline/promises.d.ts +5 -5
  35. {node v18.17/ts4.8 → node v18.18}/readline.d.ts +69 -56
  36. {node v18.17/ts4.8 → node v18.18}/repl.d.ts +67 -61
  37. {node v18.17 → node v18.18}/stream/consumers.d.ts +4 -4
  38. node v18.18/stream/promises.d.ts +83 -0
  39. {node v18.17 → node v18.18}/stream/web.d.ts +26 -20
  40. {node v18.17 → node v18.18}/stream.d.ts +361 -226
  41. {node v18.17/ts4.8 → node v18.18}/string_decoder.d.ts +3 -3
  42. {node v18.17 → node v18.18}/test.d.ts +131 -131
  43. {node v18.17 → node v18.18}/timers/promises.d.ts +4 -4
  44. {node v18.17 → node v18.18}/timers.d.ts +34 -9
  45. {node v18.17 → node v18.18}/tls.d.ts +151 -71
  46. {node v18.17/ts4.8 → node v18.18}/trace_events.d.ts +3 -3
  47. node v18.18/ts4.8/assert/strict.d.ts +8 -0
  48. {node v18.17 → node v18.18/ts4.8}/assert.d.ts +48 -24
  49. {node v18.17 → node v18.18}/ts4.8/async_hooks.d.ts +10 -7
  50. {node v18.17 → node v18.18}/ts4.8/buffer.d.ts +32 -34
  51. {node v18.17 → node v18.18}/ts4.8/child_process.d.ts +267 -122
  52. {node v18.17 → node v18.18/ts4.8}/cluster.d.ts +107 -89
  53. {node v18.17 → node v18.18/ts4.8}/console.d.ts +7 -7
  54. node v18.18/ts4.8/constants.d.ts +19 -0
  55. {node v18.17 → node v18.18}/ts4.8/crypto.d.ts +746 -268
  56. {node v18.17 → node v18.18/ts4.8}/dgram.d.ts +86 -45
  57. {node v18.17 → node v18.18}/ts4.8/diagnostics_channel.d.ts +3 -3
  58. {node v18.17 → node v18.18}/ts4.8/dns/promises.d.ts +28 -25
  59. {node v18.17 → node v18.18/ts4.8}/dns.d.ts +203 -62
  60. node v18.18/ts4.8/dom-events.d.ts +122 -0
  61. {node v18.17 → node v18.18/ts4.8}/domain.d.ts +4 -4
  62. {node v18.17 → node v18.18}/ts4.8/events.d.ts +50 -7
  63. {node v18.17 → node v18.18}/ts4.8/fs/promises.d.ts +107 -73
  64. {node v18.17 → node v18.18}/ts4.8/fs.d.ts +514 -312
  65. {node v18.17 → node v18.18}/ts4.8/globals.d.ts +68 -47
  66. {node v18.17 → node v18.18}/ts4.8/http.d.ts +185 -185
  67. {node v18.17 → node v18.18}/ts4.8/http2.d.ts +628 -376
  68. {node v18.17 → node v18.18/ts4.8}/https.d.ts +107 -105
  69. {node v18.17 → node v18.18/ts4.8}/module.d.ts +56 -12
  70. {node v18.17 → node v18.18/ts4.8}/net.d.ts +117 -93
  71. {node v18.17 → node v18.18/ts4.8}/os.d.ts +7 -7
  72. {node v18.17 → node v18.18/ts4.8}/path.d.ts +13 -13
  73. {node v18.17 → node v18.18/ts4.8}/perf_hooks.d.ts +20 -19
  74. {node v18.17 → node v18.18/ts4.8}/process.d.ts +155 -125
  75. {node v18.17 → node v18.18}/ts4.8/punycode.d.ts +3 -3
  76. {node v18.17 → node v18.18/ts4.8}/querystring.d.ts +14 -4
  77. {node v18.17 → node v18.18}/ts4.8/readline/promises.d.ts +5 -5
  78. {node v18.17 → node v18.18/ts4.8}/readline.d.ts +69 -56
  79. {node v18.17 → node v18.18/ts4.8}/repl.d.ts +67 -61
  80. {node v18.17 → node v18.18}/ts4.8/stream/consumers.d.ts +4 -4
  81. node v18.18/ts4.8/stream/promises.d.ts +83 -0
  82. {node v18.17 → node v18.18}/ts4.8/stream/web.d.ts +26 -20
  83. {node v18.17 → node v18.18}/ts4.8/stream.d.ts +490 -217
  84. {node v18.17 → node v18.18/ts4.8}/string_decoder.d.ts +3 -3
  85. {node v18.17 → node v18.18}/ts4.8/test.d.ts +144 -130
  86. {node v18.17 → node v18.18}/ts4.8/timers/promises.d.ts +4 -4
  87. {node v18.17 → node v18.18}/ts4.8/timers.d.ts +41 -9
  88. {node v18.17 → node v18.18}/ts4.8/tls.d.ts +151 -71
  89. {node v18.17 → node v18.18/ts4.8}/trace_events.d.ts +3 -3
  90. {node v18.17 → node v18.18}/ts4.8/tty.d.ts +10 -10
  91. {node v18.17 → node v18.18}/ts4.8/url.d.ts +39 -18
  92. {node v18.17 → node v18.18}/ts4.8/util.d.ts +178 -117
  93. {node v18.17 → node v18.18}/ts4.8/v8.d.ts +4 -4
  94. {node v18.17 → node v18.18}/ts4.8/vm.d.ts +60 -42
  95. {node v18.17 → node v18.18}/ts4.8/wasi.d.ts +3 -3
  96. {node v18.17 → node v18.18/ts4.8}/worker_threads.d.ts +82 -85
  97. {node v18.17 → node v18.18/ts4.8}/zlib.d.ts +9 -9
  98. {node v18.17 → node v18.18}/tty.d.ts +10 -10
  99. {node v18.17 → node v18.18}/url.d.ts +39 -18
  100. {node v18.17 → node v18.18}/util.d.ts +178 -117
  101. {node v18.17 → node v18.18}/v8.d.ts +4 -4
  102. {node v18.17 → node v18.18}/vm.d.ts +60 -42
  103. {node v18.17 → node v18.18}/wasi.d.ts +3 -3
  104. {node v18.17/ts4.8 → node v18.18}/worker_threads.d.ts +82 -85
  105. {node v18.17/ts4.8 → node v18.18}/zlib.d.ts +9 -9
  106. node v18.17/assert/strict.d.ts +0 -8
  107. node v18.17/constants.d.ts +0 -18
  108. node v18.17/dom-events.d.ts +0 -126
  109. node v18.17/stream/promises.d.ts +0 -42
  110. node v18.17/ts4.8/assert/strict.d.ts +0 -8
  111. node v18.17/ts4.8/constants.d.ts +0 -18
  112. node v18.17/ts4.8/dom-events.d.ts +0 -126
  113. node v18.17/ts4.8/stream/promises.d.ts +0 -42
  114. {node v18.17 → node v18.18}/LICENSE +0 -0
  115. {node v18.17 → node v18.18}/globals.global.d.ts +0 -0
  116. {node v18.17 → node v18.18}/inspector.d.ts +0 -0
  117. {node v18.17 → node v18.18}/ts4.8/globals.global.d.ts +0 -0
  118. {node v18.17 → node v18.18}/ts4.8/index.d.ts +0 -0
  119. {node v18.17 → node v18.18}/ts4.8/inspector.d.ts +0 -0
@@ -16,12 +16,12 @@
16
16
  * usually not necessary to use the `stream` module to consume streams.
17
17
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js)
18
18
  */
19
- declare module 'stream' {
20
- import { EventEmitter, Abortable } from 'node:events';
19
+ declare module "stream" {
20
+ import { Abortable, EventEmitter } from "node:events";
21
21
  import { Blob as NodeBlob } from "node:buffer";
22
- import * as streamPromises from 'node:stream/promises';
23
- import * as streamConsumers from 'node:stream/consumers';
24
- import * as streamWeb from 'node:stream/web';
22
+ import * as streamPromises from "node:stream/promises";
23
+ import * as streamConsumers from "node:stream/consumers";
24
+ import * as streamWeb from "node:stream/web";
25
25
 
26
26
  type ComposeFnParam = (source: any) => void;
27
27
 
@@ -30,9 +30,12 @@ declare module 'stream' {
30
30
  destination: T,
31
31
  options?: {
32
32
  end?: boolean | undefined;
33
- }
33
+ },
34
+ ): T;
35
+ compose<T extends NodeJS.ReadableStream>(
36
+ stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>,
37
+ options?: { signal: AbortSignal },
34
38
  ): T;
35
- compose<T extends NodeJS.ReadableStream>(stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>, options?: { signal: AbortSignal }): T;
36
39
  }
37
40
  namespace internal {
38
41
  class Stream extends internal {
@@ -50,6 +53,12 @@ declare module 'stream' {
50
53
  encoding?: BufferEncoding | undefined;
51
54
  read?(this: Readable, size: number): void;
52
55
  }
56
+ interface ArrayOptions {
57
+ /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */
58
+ concurrency?: number;
59
+ /** allows destroying the stream if the signal is aborted. */
60
+ signal?: AbortSignal;
61
+ }
53
62
  /**
54
63
  * @since v0.9.4
55
64
  */
@@ -63,7 +72,10 @@ declare module 'stream' {
63
72
  * @since v17.0.0
64
73
  * @experimental
65
74
  */
66
- static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick<ReadableOptions, 'encoding' | 'highWaterMark' | 'objectMode' | 'signal'>): Readable;
75
+ static fromWeb(
76
+ readableStream: streamWeb.ReadableStream,
77
+ options?: Pick<ReadableOptions, "encoding" | "highWaterMark" | "objectMode" | "signal">,
78
+ ): Readable;
67
79
  /**
68
80
  * Returns whether the stream has been read from or cancelled.
69
81
  * @since v16.8.0
@@ -424,6 +436,164 @@ declare module 'stream' {
424
436
  */
425
437
  wrap(stream: NodeJS.ReadableStream): this;
426
438
  push(chunk: any, encoding?: BufferEncoding): boolean;
439
+ /**
440
+ * The iterator created by this method gives users the option to cancel the destruction
441
+ * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
442
+ * or if the iterator should destroy the stream if the stream emitted an error during iteration.
443
+ * @since v16.3.0
444
+ * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
445
+ * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
446
+ * **Default: `true`**.
447
+ */
448
+ iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
449
+ /**
450
+ * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
451
+ * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
452
+ * @since v17.4.0, v16.14.0
453
+ * @param fn a function to map over every chunk in the stream. Async or not.
454
+ * @returns a stream mapped with the function *fn*.
455
+ */
456
+ map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
457
+ /**
458
+ * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
459
+ * and if it returns a truthy value, the chunk will be passed to the result stream.
460
+ * If the *fn* function returns a promise - that promise will be `await`ed.
461
+ * @since v17.4.0, v16.14.0
462
+ * @param fn a function to filter chunks from the stream. Async or not.
463
+ * @returns a stream filtered with the predicate *fn*.
464
+ */
465
+ filter(
466
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
467
+ options?: ArrayOptions,
468
+ ): Readable;
469
+ /**
470
+ * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called.
471
+ * If the *fn* function returns a promise - that promise will be `await`ed.
472
+ *
473
+ * This method is different from `for await...of` loops in that it can optionally process chunks concurrently.
474
+ * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option
475
+ * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`.
476
+ * In either case the stream will be destroyed.
477
+ *
478
+ * This method is different from listening to the `'data'` event in that it uses the `readable` event
479
+ * in the underlying machinary and can limit the number of concurrent *fn* calls.
480
+ * @since v17.5.0
481
+ * @param fn a function to call on each chunk of the stream. Async or not.
482
+ * @returns a promise for when the stream has finished.
483
+ */
484
+ forEach(
485
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
486
+ options?: ArrayOptions,
487
+ ): Promise<void>;
488
+ /**
489
+ * This method allows easily obtaining the contents of a stream.
490
+ *
491
+ * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended
492
+ * for interoperability and convenience, not as the primary way to consume streams.
493
+ * @since v17.5.0
494
+ * @returns a promise containing an array with the contents of the stream.
495
+ */
496
+ toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
497
+ /**
498
+ * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream
499
+ * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk
500
+ * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`.
501
+ * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`.
502
+ * @since v17.5.0
503
+ * @param fn a function to call on each chunk of the stream. Async or not.
504
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks.
505
+ */
506
+ some(
507
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
508
+ options?: ArrayOptions,
509
+ ): Promise<boolean>;
510
+ /**
511
+ * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream
512
+ * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy,
513
+ * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value.
514
+ * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`.
515
+ * @since v17.5.0
516
+ * @param fn a function to call on each chunk of the stream. Async or not.
517
+ * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value,
518
+ * or `undefined` if no element was found.
519
+ */
520
+ find<T>(
521
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => data is T,
522
+ options?: ArrayOptions,
523
+ ): Promise<T | undefined>;
524
+ find(
525
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
526
+ options?: ArrayOptions,
527
+ ): Promise<any>;
528
+ /**
529
+ * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream
530
+ * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk
531
+ * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`.
532
+ * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`.
533
+ * @since v17.5.0
534
+ * @param fn a function to call on each chunk of the stream. Async or not.
535
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks.
536
+ */
537
+ every(
538
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
539
+ options?: ArrayOptions,
540
+ ): Promise<boolean>;
541
+ /**
542
+ * This method returns a new stream by applying the given callback to each chunk of the stream
543
+ * and then flattening the result.
544
+ *
545
+ * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams
546
+ * will be merged (flattened) into the returned stream.
547
+ * @since v17.5.0
548
+ * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator.
549
+ * @returns a stream flat-mapped with the function *fn*.
550
+ */
551
+ flatMap(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
552
+ /**
553
+ * This method returns a new stream with the first *limit* chunks dropped from the start.
554
+ * @since v17.5.0
555
+ * @param limit the number of chunks to drop from the readable.
556
+ * @returns a stream with *limit* chunks dropped from the start.
557
+ */
558
+ drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
559
+ /**
560
+ * This method returns a new stream with the first *limit* chunks.
561
+ * @since v17.5.0
562
+ * @param limit the number of chunks to take from the readable.
563
+ * @returns a stream with *limit* chunks taken.
564
+ */
565
+ take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
566
+ /**
567
+ * This method returns a new stream with chunks of the underlying stream paired with a counter
568
+ * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced.
569
+ * @since v17.5.0
570
+ * @returns a stream of indexed pairs.
571
+ */
572
+ asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
573
+ /**
574
+ * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation
575
+ * on the previous element. It returns a promise for the final value of the reduction.
576
+ *
577
+ * If no *initial* value is supplied the first chunk of the stream is used as the initial value.
578
+ * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property.
579
+ *
580
+ * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter
581
+ * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method.
582
+ * @since v17.5.0
583
+ * @param fn a reducer function to call over every chunk in the stream. Async or not.
584
+ * @param initial the initial value to use in the reduction.
585
+ * @returns a promise for the final value of the reduction.
586
+ */
587
+ reduce<T = any>(
588
+ fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
589
+ initial?: undefined,
590
+ options?: Pick<ArrayOptions, "signal">,
591
+ ): Promise<T>;
592
+ reduce<T = any>(
593
+ fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
594
+ initial: T,
595
+ options?: Pick<ArrayOptions, "signal">,
596
+ ): Promise<T>;
427
597
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
428
598
  /**
429
599
  * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable
@@ -448,75 +618,85 @@ declare module 'stream' {
448
618
  * 6. readable
449
619
  * 7. resume
450
620
  */
451
- addListener(event: 'close', listener: () => void): this;
452
- addListener(event: 'data', listener: (chunk: any) => void): this;
453
- addListener(event: 'end', listener: () => void): this;
454
- addListener(event: 'error', listener: (err: Error) => void): this;
455
- addListener(event: 'pause', listener: () => void): this;
456
- addListener(event: 'readable', listener: () => void): this;
457
- addListener(event: 'resume', listener: () => void): this;
621
+ addListener(event: "close", listener: () => void): this;
622
+ addListener(event: "data", listener: (chunk: any) => void): this;
623
+ addListener(event: "end", listener: () => void): this;
624
+ addListener(event: "error", listener: (err: Error) => void): this;
625
+ addListener(event: "pause", listener: () => void): this;
626
+ addListener(event: "readable", listener: () => void): this;
627
+ addListener(event: "resume", listener: () => void): this;
458
628
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
459
- emit(event: 'close'): boolean;
460
- emit(event: 'data', chunk: any): boolean;
461
- emit(event: 'end'): boolean;
462
- emit(event: 'error', err: Error): boolean;
463
- emit(event: 'pause'): boolean;
464
- emit(event: 'readable'): boolean;
465
- emit(event: 'resume'): boolean;
629
+ emit(event: "close"): boolean;
630
+ emit(event: "data", chunk: any): boolean;
631
+ emit(event: "end"): boolean;
632
+ emit(event: "error", err: Error): boolean;
633
+ emit(event: "pause"): boolean;
634
+ emit(event: "readable"): boolean;
635
+ emit(event: "resume"): boolean;
466
636
  emit(event: string | symbol, ...args: any[]): boolean;
467
- on(event: 'close', listener: () => void): this;
468
- on(event: 'data', listener: (chunk: any) => void): this;
469
- on(event: 'end', listener: () => void): this;
470
- on(event: 'error', listener: (err: Error) => void): this;
471
- on(event: 'pause', listener: () => void): this;
472
- on(event: 'readable', listener: () => void): this;
473
- on(event: 'resume', listener: () => void): this;
637
+ on(event: "close", listener: () => void): this;
638
+ on(event: "data", listener: (chunk: any) => void): this;
639
+ on(event: "end", listener: () => void): this;
640
+ on(event: "error", listener: (err: Error) => void): this;
641
+ on(event: "pause", listener: () => void): this;
642
+ on(event: "readable", listener: () => void): this;
643
+ on(event: "resume", listener: () => void): this;
474
644
  on(event: string | symbol, listener: (...args: any[]) => void): this;
475
- once(event: 'close', listener: () => void): this;
476
- once(event: 'data', listener: (chunk: any) => void): this;
477
- once(event: 'end', listener: () => void): this;
478
- once(event: 'error', listener: (err: Error) => void): this;
479
- once(event: 'pause', listener: () => void): this;
480
- once(event: 'readable', listener: () => void): this;
481
- once(event: 'resume', listener: () => void): this;
645
+ once(event: "close", listener: () => void): this;
646
+ once(event: "data", listener: (chunk: any) => void): this;
647
+ once(event: "end", listener: () => void): this;
648
+ once(event: "error", listener: (err: Error) => void): this;
649
+ once(event: "pause", listener: () => void): this;
650
+ once(event: "readable", listener: () => void): this;
651
+ once(event: "resume", listener: () => void): this;
482
652
  once(event: string | symbol, listener: (...args: any[]) => void): this;
483
- prependListener(event: 'close', listener: () => void): this;
484
- prependListener(event: 'data', listener: (chunk: any) => void): this;
485
- prependListener(event: 'end', listener: () => void): this;
486
- prependListener(event: 'error', listener: (err: Error) => void): this;
487
- prependListener(event: 'pause', listener: () => void): this;
488
- prependListener(event: 'readable', listener: () => void): this;
489
- prependListener(event: 'resume', listener: () => void): this;
653
+ prependListener(event: "close", listener: () => void): this;
654
+ prependListener(event: "data", listener: (chunk: any) => void): this;
655
+ prependListener(event: "end", listener: () => void): this;
656
+ prependListener(event: "error", listener: (err: Error) => void): this;
657
+ prependListener(event: "pause", listener: () => void): this;
658
+ prependListener(event: "readable", listener: () => void): this;
659
+ prependListener(event: "resume", listener: () => void): this;
490
660
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
491
- prependOnceListener(event: 'close', listener: () => void): this;
492
- prependOnceListener(event: 'data', listener: (chunk: any) => void): this;
493
- prependOnceListener(event: 'end', listener: () => void): this;
494
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
495
- prependOnceListener(event: 'pause', listener: () => void): this;
496
- prependOnceListener(event: 'readable', listener: () => void): this;
497
- prependOnceListener(event: 'resume', listener: () => void): this;
661
+ prependOnceListener(event: "close", listener: () => void): this;
662
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
663
+ prependOnceListener(event: "end", listener: () => void): this;
664
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
665
+ prependOnceListener(event: "pause", listener: () => void): this;
666
+ prependOnceListener(event: "readable", listener: () => void): this;
667
+ prependOnceListener(event: "resume", listener: () => void): this;
498
668
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
499
- removeListener(event: 'close', listener: () => void): this;
500
- removeListener(event: 'data', listener: (chunk: any) => void): this;
501
- removeListener(event: 'end', listener: () => void): this;
502
- removeListener(event: 'error', listener: (err: Error) => void): this;
503
- removeListener(event: 'pause', listener: () => void): this;
504
- removeListener(event: 'readable', listener: () => void): this;
505
- removeListener(event: 'resume', listener: () => void): this;
669
+ removeListener(event: "close", listener: () => void): this;
670
+ removeListener(event: "data", listener: (chunk: any) => void): this;
671
+ removeListener(event: "end", listener: () => void): this;
672
+ removeListener(event: "error", listener: (err: Error) => void): this;
673
+ removeListener(event: "pause", listener: () => void): this;
674
+ removeListener(event: "readable", listener: () => void): this;
675
+ removeListener(event: "resume", listener: () => void): this;
506
676
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
507
677
  [Symbol.asyncIterator](): AsyncIterableIterator<any>;
678
+ /**
679
+ * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
680
+ * @since v18.18.0
681
+ */
682
+ [Symbol.asyncDispose](): Promise<void>;
508
683
  }
509
684
  interface WritableOptions extends StreamOptions<Writable> {
510
685
  decodeStrings?: boolean | undefined;
511
686
  defaultEncoding?: BufferEncoding | undefined;
512
- write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
687
+ write?(
688
+ this: Writable,
689
+ chunk: any,
690
+ encoding: BufferEncoding,
691
+ callback: (error?: Error | null) => void,
692
+ ): void;
513
693
  writev?(
514
694
  this: Writable,
515
695
  chunks: Array<{
516
696
  chunk: any;
517
697
  encoding: BufferEncoding;
518
698
  }>,
519
- callback: (error?: Error | null) => void
699
+ callback: (error?: Error | null) => void,
520
700
  ): void;
521
701
  final?(this: Writable, callback: (error?: Error | null) => void): void;
522
702
  }
@@ -529,7 +709,10 @@ declare module 'stream' {
529
709
  * @since v17.0.0
530
710
  * @experimental
531
711
  */
532
- static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick<WritableOptions, 'decodeStrings' | 'highWaterMark' | 'objectMode' | 'signal'>): Writable;
712
+ static fromWeb(
713
+ writableStream: streamWeb.WritableStream,
714
+ options?: Pick<WritableOptions, "decodeStrings" | "highWaterMark" | "objectMode" | "signal">,
715
+ ): Writable;
533
716
  /**
534
717
  * A utility method for creating a web `WritableStream` from a `Writable`.
535
718
  * @since v17.0.0
@@ -603,7 +786,7 @@ declare module 'stream' {
603
786
  chunk: any;
604
787
  encoding: BufferEncoding;
605
788
  }>,
606
- callback: (error?: Error | null) => void
789
+ callback: (error?: Error | null) => void,
607
790
  ): void;
608
791
  _construct?(callback: (error?: Error | null) => void): void;
609
792
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
@@ -773,54 +956,54 @@ declare module 'stream' {
773
956
  * 5. pipe
774
957
  * 6. unpipe
775
958
  */
776
- addListener(event: 'close', listener: () => void): this;
777
- addListener(event: 'drain', listener: () => void): this;
778
- addListener(event: 'error', listener: (err: Error) => void): this;
779
- addListener(event: 'finish', listener: () => void): this;
780
- addListener(event: 'pipe', listener: (src: Readable) => void): this;
781
- addListener(event: 'unpipe', listener: (src: Readable) => void): this;
959
+ addListener(event: "close", listener: () => void): this;
960
+ addListener(event: "drain", listener: () => void): this;
961
+ addListener(event: "error", listener: (err: Error) => void): this;
962
+ addListener(event: "finish", listener: () => void): this;
963
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
964
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
782
965
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
783
- emit(event: 'close'): boolean;
784
- emit(event: 'drain'): boolean;
785
- emit(event: 'error', err: Error): boolean;
786
- emit(event: 'finish'): boolean;
787
- emit(event: 'pipe', src: Readable): boolean;
788
- emit(event: 'unpipe', src: Readable): boolean;
966
+ emit(event: "close"): boolean;
967
+ emit(event: "drain"): boolean;
968
+ emit(event: "error", err: Error): boolean;
969
+ emit(event: "finish"): boolean;
970
+ emit(event: "pipe", src: Readable): boolean;
971
+ emit(event: "unpipe", src: Readable): boolean;
789
972
  emit(event: string | symbol, ...args: any[]): boolean;
790
- on(event: 'close', listener: () => void): this;
791
- on(event: 'drain', listener: () => void): this;
792
- on(event: 'error', listener: (err: Error) => void): this;
793
- on(event: 'finish', listener: () => void): this;
794
- on(event: 'pipe', listener: (src: Readable) => void): this;
795
- on(event: 'unpipe', listener: (src: Readable) => void): this;
973
+ on(event: "close", listener: () => void): this;
974
+ on(event: "drain", listener: () => void): this;
975
+ on(event: "error", listener: (err: Error) => void): this;
976
+ on(event: "finish", listener: () => void): this;
977
+ on(event: "pipe", listener: (src: Readable) => void): this;
978
+ on(event: "unpipe", listener: (src: Readable) => void): this;
796
979
  on(event: string | symbol, listener: (...args: any[]) => void): this;
797
- once(event: 'close', listener: () => void): this;
798
- once(event: 'drain', listener: () => void): this;
799
- once(event: 'error', listener: (err: Error) => void): this;
800
- once(event: 'finish', listener: () => void): this;
801
- once(event: 'pipe', listener: (src: Readable) => void): this;
802
- once(event: 'unpipe', listener: (src: Readable) => void): this;
980
+ once(event: "close", listener: () => void): this;
981
+ once(event: "drain", listener: () => void): this;
982
+ once(event: "error", listener: (err: Error) => void): this;
983
+ once(event: "finish", listener: () => void): this;
984
+ once(event: "pipe", listener: (src: Readable) => void): this;
985
+ once(event: "unpipe", listener: (src: Readable) => void): this;
803
986
  once(event: string | symbol, listener: (...args: any[]) => void): this;
804
- prependListener(event: 'close', listener: () => void): this;
805
- prependListener(event: 'drain', listener: () => void): this;
806
- prependListener(event: 'error', listener: (err: Error) => void): this;
807
- prependListener(event: 'finish', listener: () => void): this;
808
- prependListener(event: 'pipe', listener: (src: Readable) => void): this;
809
- prependListener(event: 'unpipe', listener: (src: Readable) => void): this;
987
+ prependListener(event: "close", listener: () => void): this;
988
+ prependListener(event: "drain", listener: () => void): this;
989
+ prependListener(event: "error", listener: (err: Error) => void): this;
990
+ prependListener(event: "finish", listener: () => void): this;
991
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
992
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
810
993
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
811
- prependOnceListener(event: 'close', listener: () => void): this;
812
- prependOnceListener(event: 'drain', listener: () => void): this;
813
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
814
- prependOnceListener(event: 'finish', listener: () => void): this;
815
- prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this;
816
- prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this;
994
+ prependOnceListener(event: "close", listener: () => void): this;
995
+ prependOnceListener(event: "drain", listener: () => void): this;
996
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
997
+ prependOnceListener(event: "finish", listener: () => void): this;
998
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
999
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
817
1000
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
818
- removeListener(event: 'close', listener: () => void): this;
819
- removeListener(event: 'drain', listener: () => void): this;
820
- removeListener(event: 'error', listener: (err: Error) => void): this;
821
- removeListener(event: 'finish', listener: () => void): this;
822
- removeListener(event: 'pipe', listener: (src: Readable) => void): this;
823
- removeListener(event: 'unpipe', listener: (src: Readable) => void): this;
1001
+ removeListener(event: "close", listener: () => void): this;
1002
+ removeListener(event: "drain", listener: () => void): this;
1003
+ removeListener(event: "error", listener: (err: Error) => void): this;
1004
+ removeListener(event: "finish", listener: () => void): this;
1005
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
1006
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
824
1007
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
825
1008
  }
826
1009
  interface DuplexOptions extends ReadableOptions, WritableOptions {
@@ -839,7 +1022,7 @@ declare module 'stream' {
839
1022
  chunk: any;
840
1023
  encoding: BufferEncoding;
841
1024
  }>,
842
- callback: (error?: Error | null) => void
1025
+ callback: (error?: Error | null) => void,
843
1026
  ): void;
844
1027
  final?(this: Duplex, callback: (error?: Error | null) => void): void;
845
1028
  destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
@@ -897,14 +1080,25 @@ declare module 'stream' {
897
1080
  *
898
1081
  * @since v16.8.0
899
1082
  */
900
- static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable<any> | AsyncIterable<any> | AsyncGeneratorFunction | Promise<any> | Object): Duplex;
1083
+ static from(
1084
+ src:
1085
+ | Stream
1086
+ | NodeBlob
1087
+ | ArrayBuffer
1088
+ | string
1089
+ | Iterable<any>
1090
+ | AsyncIterable<any>
1091
+ | AsyncGeneratorFunction
1092
+ | Promise<any>
1093
+ | Object,
1094
+ ): Duplex;
901
1095
  _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
902
1096
  _writev?(
903
1097
  chunks: Array<{
904
1098
  chunk: any;
905
1099
  encoding: BufferEncoding;
906
1100
  }>,
907
- callback: (error?: Error | null) => void
1101
+ callback: (error?: Error | null) => void,
908
1102
  ): void;
909
1103
  _destroy(error: Error | null, callback: (error: Error | null) => void): void;
910
1104
  _final(callback: (error?: Error | null) => void): void;
@@ -931,103 +1125,108 @@ declare module 'stream' {
931
1125
  * 10. resume
932
1126
  * 11. unpipe
933
1127
  */
934
- addListener(event: 'close', listener: () => void): this;
935
- addListener(event: 'data', listener: (chunk: any) => void): this;
936
- addListener(event: 'drain', listener: () => void): this;
937
- addListener(event: 'end', listener: () => void): this;
938
- addListener(event: 'error', listener: (err: Error) => void): this;
939
- addListener(event: 'finish', listener: () => void): this;
940
- addListener(event: 'pause', listener: () => void): this;
941
- addListener(event: 'pipe', listener: (src: Readable) => void): this;
942
- addListener(event: 'readable', listener: () => void): this;
943
- addListener(event: 'resume', listener: () => void): this;
944
- addListener(event: 'unpipe', listener: (src: Readable) => void): this;
1128
+ addListener(event: "close", listener: () => void): this;
1129
+ addListener(event: "data", listener: (chunk: any) => void): this;
1130
+ addListener(event: "drain", listener: () => void): this;
1131
+ addListener(event: "end", listener: () => void): this;
1132
+ addListener(event: "error", listener: (err: Error) => void): this;
1133
+ addListener(event: "finish", listener: () => void): this;
1134
+ addListener(event: "pause", listener: () => void): this;
1135
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
1136
+ addListener(event: "readable", listener: () => void): this;
1137
+ addListener(event: "resume", listener: () => void): this;
1138
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
945
1139
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
946
- emit(event: 'close'): boolean;
947
- emit(event: 'data', chunk: any): boolean;
948
- emit(event: 'drain'): boolean;
949
- emit(event: 'end'): boolean;
950
- emit(event: 'error', err: Error): boolean;
951
- emit(event: 'finish'): boolean;
952
- emit(event: 'pause'): boolean;
953
- emit(event: 'pipe', src: Readable): boolean;
954
- emit(event: 'readable'): boolean;
955
- emit(event: 'resume'): boolean;
956
- emit(event: 'unpipe', src: Readable): boolean;
1140
+ emit(event: "close"): boolean;
1141
+ emit(event: "data", chunk: any): boolean;
1142
+ emit(event: "drain"): boolean;
1143
+ emit(event: "end"): boolean;
1144
+ emit(event: "error", err: Error): boolean;
1145
+ emit(event: "finish"): boolean;
1146
+ emit(event: "pause"): boolean;
1147
+ emit(event: "pipe", src: Readable): boolean;
1148
+ emit(event: "readable"): boolean;
1149
+ emit(event: "resume"): boolean;
1150
+ emit(event: "unpipe", src: Readable): boolean;
957
1151
  emit(event: string | symbol, ...args: any[]): boolean;
958
- on(event: 'close', listener: () => void): this;
959
- on(event: 'data', listener: (chunk: any) => void): this;
960
- on(event: 'drain', listener: () => void): this;
961
- on(event: 'end', listener: () => void): this;
962
- on(event: 'error', listener: (err: Error) => void): this;
963
- on(event: 'finish', listener: () => void): this;
964
- on(event: 'pause', listener: () => void): this;
965
- on(event: 'pipe', listener: (src: Readable) => void): this;
966
- on(event: 'readable', listener: () => void): this;
967
- on(event: 'resume', listener: () => void): this;
968
- on(event: 'unpipe', listener: (src: Readable) => void): this;
1152
+ on(event: "close", listener: () => void): this;
1153
+ on(event: "data", listener: (chunk: any) => void): this;
1154
+ on(event: "drain", listener: () => void): this;
1155
+ on(event: "end", listener: () => void): this;
1156
+ on(event: "error", listener: (err: Error) => void): this;
1157
+ on(event: "finish", listener: () => void): this;
1158
+ on(event: "pause", listener: () => void): this;
1159
+ on(event: "pipe", listener: (src: Readable) => void): this;
1160
+ on(event: "readable", listener: () => void): this;
1161
+ on(event: "resume", listener: () => void): this;
1162
+ on(event: "unpipe", listener: (src: Readable) => void): this;
969
1163
  on(event: string | symbol, listener: (...args: any[]) => void): this;
970
- once(event: 'close', listener: () => void): this;
971
- once(event: 'data', listener: (chunk: any) => void): this;
972
- once(event: 'drain', listener: () => void): this;
973
- once(event: 'end', listener: () => void): this;
974
- once(event: 'error', listener: (err: Error) => void): this;
975
- once(event: 'finish', listener: () => void): this;
976
- once(event: 'pause', listener: () => void): this;
977
- once(event: 'pipe', listener: (src: Readable) => void): this;
978
- once(event: 'readable', listener: () => void): this;
979
- once(event: 'resume', listener: () => void): this;
980
- once(event: 'unpipe', listener: (src: Readable) => void): this;
1164
+ once(event: "close", listener: () => void): this;
1165
+ once(event: "data", listener: (chunk: any) => void): this;
1166
+ once(event: "drain", listener: () => void): this;
1167
+ once(event: "end", listener: () => void): this;
1168
+ once(event: "error", listener: (err: Error) => void): this;
1169
+ once(event: "finish", listener: () => void): this;
1170
+ once(event: "pause", listener: () => void): this;
1171
+ once(event: "pipe", listener: (src: Readable) => void): this;
1172
+ once(event: "readable", listener: () => void): this;
1173
+ once(event: "resume", listener: () => void): this;
1174
+ once(event: "unpipe", listener: (src: Readable) => void): this;
981
1175
  once(event: string | symbol, listener: (...args: any[]) => void): this;
982
- prependListener(event: 'close', listener: () => void): this;
983
- prependListener(event: 'data', listener: (chunk: any) => void): this;
984
- prependListener(event: 'drain', listener: () => void): this;
985
- prependListener(event: 'end', listener: () => void): this;
986
- prependListener(event: 'error', listener: (err: Error) => void): this;
987
- prependListener(event: 'finish', listener: () => void): this;
988
- prependListener(event: 'pause', listener: () => void): this;
989
- prependListener(event: 'pipe', listener: (src: Readable) => void): this;
990
- prependListener(event: 'readable', listener: () => void): this;
991
- prependListener(event: 'resume', listener: () => void): this;
992
- prependListener(event: 'unpipe', listener: (src: Readable) => void): this;
1176
+ prependListener(event: "close", listener: () => void): this;
1177
+ prependListener(event: "data", listener: (chunk: any) => void): this;
1178
+ prependListener(event: "drain", listener: () => void): this;
1179
+ prependListener(event: "end", listener: () => void): this;
1180
+ prependListener(event: "error", listener: (err: Error) => void): this;
1181
+ prependListener(event: "finish", listener: () => void): this;
1182
+ prependListener(event: "pause", listener: () => void): this;
1183
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
1184
+ prependListener(event: "readable", listener: () => void): this;
1185
+ prependListener(event: "resume", listener: () => void): this;
1186
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
993
1187
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
994
- prependOnceListener(event: 'close', listener: () => void): this;
995
- prependOnceListener(event: 'data', listener: (chunk: any) => void): this;
996
- prependOnceListener(event: 'drain', listener: () => void): this;
997
- prependOnceListener(event: 'end', listener: () => void): this;
998
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
999
- prependOnceListener(event: 'finish', listener: () => void): this;
1000
- prependOnceListener(event: 'pause', listener: () => void): this;
1001
- prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this;
1002
- prependOnceListener(event: 'readable', listener: () => void): this;
1003
- prependOnceListener(event: 'resume', listener: () => void): this;
1004
- prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this;
1188
+ prependOnceListener(event: "close", listener: () => void): this;
1189
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
1190
+ prependOnceListener(event: "drain", listener: () => void): this;
1191
+ prependOnceListener(event: "end", listener: () => void): this;
1192
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
1193
+ prependOnceListener(event: "finish", listener: () => void): this;
1194
+ prependOnceListener(event: "pause", listener: () => void): this;
1195
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
1196
+ prependOnceListener(event: "readable", listener: () => void): this;
1197
+ prependOnceListener(event: "resume", listener: () => void): this;
1198
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
1005
1199
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1006
- removeListener(event: 'close', listener: () => void): this;
1007
- removeListener(event: 'data', listener: (chunk: any) => void): this;
1008
- removeListener(event: 'drain', listener: () => void): this;
1009
- removeListener(event: 'end', listener: () => void): this;
1010
- removeListener(event: 'error', listener: (err: Error) => void): this;
1011
- removeListener(event: 'finish', listener: () => void): this;
1012
- removeListener(event: 'pause', listener: () => void): this;
1013
- removeListener(event: 'pipe', listener: (src: Readable) => void): this;
1014
- removeListener(event: 'readable', listener: () => void): this;
1015
- removeListener(event: 'resume', listener: () => void): this;
1016
- removeListener(event: 'unpipe', listener: (src: Readable) => void): this;
1200
+ removeListener(event: "close", listener: () => void): this;
1201
+ removeListener(event: "data", listener: (chunk: any) => void): this;
1202
+ removeListener(event: "drain", listener: () => void): this;
1203
+ removeListener(event: "end", listener: () => void): this;
1204
+ removeListener(event: "error", listener: (err: Error) => void): this;
1205
+ removeListener(event: "finish", listener: () => void): this;
1206
+ removeListener(event: "pause", listener: () => void): this;
1207
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
1208
+ removeListener(event: "readable", listener: () => void): this;
1209
+ removeListener(event: "resume", listener: () => void): this;
1210
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1017
1211
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1018
1212
  }
1019
1213
  type TransformCallback = (error?: Error | null, data?: any) => void;
1020
1214
  interface TransformOptions extends DuplexOptions {
1021
1215
  construct?(this: Transform, callback: (error?: Error | null) => void): void;
1022
1216
  read?(this: Transform, size: number): void;
1023
- write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1217
+ write?(
1218
+ this: Transform,
1219
+ chunk: any,
1220
+ encoding: BufferEncoding,
1221
+ callback: (error?: Error | null) => void,
1222
+ ): void;
1024
1223
  writev?(
1025
1224
  this: Transform,
1026
1225
  chunks: Array<{
1027
1226
  chunk: any;
1028
1227
  encoding: BufferEncoding;
1029
1228
  }>,
1030
- callback: (error?: Error | null) => void
1229
+ callback: (error?: Error | null) => void,
1031
1230
  ): void;
1032
1231
  final?(this: Transform, callback: (error?: Error | null) => void): void;
1033
1232
  destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
@@ -1176,26 +1375,43 @@ declare module 'stream' {
1176
1375
  * @param callback A callback function that takes an optional error argument.
1177
1376
  * @return A cleanup function which removes all registered listeners.
1178
1377
  */
1179
- function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
1180
- function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
1378
+ function finished(
1379
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1380
+ options: FinishedOptions,
1381
+ callback: (err?: NodeJS.ErrnoException | null) => void,
1382
+ ): () => void;
1383
+ function finished(
1384
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1385
+ callback: (err?: NodeJS.ErrnoException | null) => void,
1386
+ ): () => void;
1181
1387
  namespace finished {
1182
- function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
1388
+ function __promisify__(
1389
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1390
+ options?: FinishedOptions,
1391
+ ): Promise<void>;
1183
1392
  }
1184
1393
  type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
1185
1394
  type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
1186
1395
  type PipelineTransform<S extends PipelineTransformSource<any>, U> =
1187
1396
  | NodeJS.ReadWriteStream
1188
- | ((source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST> : S) => AsyncIterable<U>);
1397
+ | ((
1398
+ source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST>
1399
+ : S,
1400
+ ) => AsyncIterable<U>);
1189
1401
  type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
1190
1402
  type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
1191
1403
  type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
1192
- type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends PipelineTransformSource<infer ST>
1193
- ? NodeJS.WritableStream | PipelineDestinationIterableFunction<ST> | PipelineDestinationPromiseFunction<ST, P>
1404
+ type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends
1405
+ PipelineTransformSource<infer ST> ?
1406
+ | NodeJS.WritableStream
1407
+ | PipelineDestinationIterableFunction<ST>
1408
+ | PipelineDestinationPromiseFunction<ST, P>
1194
1409
  : never;
1195
- type PipelineCallback<S extends PipelineDestination<any, any>> = S extends PipelineDestinationPromiseFunction<any, infer P>
1196
- ? (err: NodeJS.ErrnoException | null, value: P) => void
1410
+ type PipelineCallback<S extends PipelineDestination<any, any>> = S extends
1411
+ PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void
1197
1412
  : (err: NodeJS.ErrnoException | null) => void;
1198
- type PipelinePromise<S extends PipelineDestination<any, any>> = S extends PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
1413
+ type PipelinePromise<S extends PipelineDestination<any, any>> = S extends
1414
+ PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
1199
1415
  interface PipelineOptions {
1200
1416
  signal?: AbortSignal | undefined;
1201
1417
  end?: boolean | undefined;
@@ -1352,76 +1568,133 @@ declare module 'stream' {
1352
1568
  function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1353
1569
  source: A,
1354
1570
  destination: B,
1355
- callback?: PipelineCallback<B>
1571
+ callback?: PipelineCallback<B>,
1356
1572
  ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1357
- function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
1573
+ function pipeline<
1574
+ A extends PipelineSource<any>,
1575
+ T1 extends PipelineTransform<A, any>,
1576
+ B extends PipelineDestination<T1, any>,
1577
+ >(
1358
1578
  source: A,
1359
1579
  transform1: T1,
1360
1580
  destination: B,
1361
- callback?: PipelineCallback<B>
1581
+ callback?: PipelineCallback<B>,
1362
1582
  ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1363
- function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
1583
+ function pipeline<
1584
+ A extends PipelineSource<any>,
1585
+ T1 extends PipelineTransform<A, any>,
1586
+ T2 extends PipelineTransform<T1, any>,
1587
+ B extends PipelineDestination<T2, any>,
1588
+ >(
1364
1589
  source: A,
1365
1590
  transform1: T1,
1366
1591
  transform2: T2,
1367
1592
  destination: B,
1368
- callback?: PipelineCallback<B>
1593
+ callback?: PipelineCallback<B>,
1369
1594
  ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1370
1595
  function pipeline<
1371
1596
  A extends PipelineSource<any>,
1372
1597
  T1 extends PipelineTransform<A, any>,
1373
1598
  T2 extends PipelineTransform<T1, any>,
1374
1599
  T3 extends PipelineTransform<T2, any>,
1375
- B extends PipelineDestination<T3, any>
1376
- >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback<B>): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1600
+ B extends PipelineDestination<T3, any>,
1601
+ >(
1602
+ source: A,
1603
+ transform1: T1,
1604
+ transform2: T2,
1605
+ transform3: T3,
1606
+ destination: B,
1607
+ callback?: PipelineCallback<B>,
1608
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1377
1609
  function pipeline<
1378
1610
  A extends PipelineSource<any>,
1379
1611
  T1 extends PipelineTransform<A, any>,
1380
1612
  T2 extends PipelineTransform<T1, any>,
1381
1613
  T3 extends PipelineTransform<T2, any>,
1382
1614
  T4 extends PipelineTransform<T3, any>,
1383
- B extends PipelineDestination<T4, any>
1384
- >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback<B>): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1615
+ B extends PipelineDestination<T4, any>,
1616
+ >(
1617
+ source: A,
1618
+ transform1: T1,
1619
+ transform2: T2,
1620
+ transform3: T3,
1621
+ transform4: T4,
1622
+ destination: B,
1623
+ callback?: PipelineCallback<B>,
1624
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1385
1625
  function pipeline(
1386
1626
  streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
1387
- callback?: (err: NodeJS.ErrnoException | null) => void
1627
+ callback?: (err: NodeJS.ErrnoException | null) => void,
1388
1628
  ): NodeJS.WritableStream;
1389
1629
  function pipeline(
1390
1630
  stream1: NodeJS.ReadableStream,
1391
1631
  stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
1392
- ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)>
1632
+ ...streams: Array<
1633
+ NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)
1634
+ >
1393
1635
  ): NodeJS.WritableStream;
1394
1636
  namespace pipeline {
1395
- function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
1396
- function __promisify__<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
1637
+ function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1638
+ source: A,
1639
+ destination: B,
1640
+ options?: PipelineOptions,
1641
+ ): PipelinePromise<B>;
1642
+ function __promisify__<
1643
+ A extends PipelineSource<any>,
1644
+ T1 extends PipelineTransform<A, any>,
1645
+ B extends PipelineDestination<T1, any>,
1646
+ >(
1397
1647
  source: A,
1398
1648
  transform1: T1,
1399
1649
  destination: B,
1400
- options?: PipelineOptions
1650
+ options?: PipelineOptions,
1401
1651
  ): PipelinePromise<B>;
1402
- function __promisify__<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
1652
+ function __promisify__<
1653
+ A extends PipelineSource<any>,
1654
+ T1 extends PipelineTransform<A, any>,
1655
+ T2 extends PipelineTransform<T1, any>,
1656
+ B extends PipelineDestination<T2, any>,
1657
+ >(
1403
1658
  source: A,
1404
1659
  transform1: T1,
1405
1660
  transform2: T2,
1406
1661
  destination: B,
1407
- options?: PipelineOptions
1662
+ options?: PipelineOptions,
1408
1663
  ): PipelinePromise<B>;
1409
1664
  function __promisify__<
1410
1665
  A extends PipelineSource<any>,
1411
1666
  T1 extends PipelineTransform<A, any>,
1412
1667
  T2 extends PipelineTransform<T1, any>,
1413
1668
  T3 extends PipelineTransform<T2, any>,
1414
- B extends PipelineDestination<T3, any>
1415
- >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
1669
+ B extends PipelineDestination<T3, any>,
1670
+ >(
1671
+ source: A,
1672
+ transform1: T1,
1673
+ transform2: T2,
1674
+ transform3: T3,
1675
+ destination: B,
1676
+ options?: PipelineOptions,
1677
+ ): PipelinePromise<B>;
1416
1678
  function __promisify__<
1417
1679
  A extends PipelineSource<any>,
1418
1680
  T1 extends PipelineTransform<A, any>,
1419
1681
  T2 extends PipelineTransform<T1, any>,
1420
1682
  T3 extends PipelineTransform<T2, any>,
1421
1683
  T4 extends PipelineTransform<T3, any>,
1422
- B extends PipelineDestination<T4, any>
1423
- >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
1424
- function __promisify__(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
1684
+ B extends PipelineDestination<T4, any>,
1685
+ >(
1686
+ source: A,
1687
+ transform1: T1,
1688
+ transform2: T2,
1689
+ transform3: T3,
1690
+ transform4: T4,
1691
+ destination: B,
1692
+ options?: PipelineOptions,
1693
+ ): PipelinePromise<B>;
1694
+ function __promisify__(
1695
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
1696
+ options?: PipelineOptions,
1697
+ ): Promise<void>;
1425
1698
  function __promisify__(
1426
1699
  stream1: NodeJS.ReadableStream,
1427
1700
  stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
@@ -1452,7 +1725,7 @@ declare module 'stream' {
1452
1725
  }
1453
1726
  export = internal;
1454
1727
  }
1455
- declare module 'node:stream' {
1456
- import stream = require('stream');
1728
+ declare module "node:stream" {
1729
+ import stream = require("stream");
1457
1730
  export = stream;
1458
1731
  }