web-streams-polyfill 3.0.3 → 3.1.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.
@@ -89,7 +89,9 @@ export declare interface QueuingStrategyInit {
89
89
 
90
90
  declare type QueuingStrategySizeCallback<T = any> = (chunk: T) => number;
91
91
 
92
- declare type ReadableByteStream = ReadableStream<Uint8Array>;
92
+ declare type ReadableByteStream = ReadableStream<Uint8Array> & {
93
+ _readableStreamController: ReadableByteStreamController;
94
+ };
93
95
 
94
96
  /**
95
97
  * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.
@@ -262,8 +264,11 @@ export declare class ReadableStreamBYOBReader {
262
264
  * @public
263
265
  */
264
266
  export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
265
- done: boolean;
267
+ done: false;
266
268
  value: T;
269
+ } | {
270
+ done: true;
271
+ value: T | undefined;
267
272
  };
268
273
 
269
274
  /**
@@ -677,6 +682,14 @@ export declare class WritableStream<W = any> {
677
682
  */
678
683
  export declare class WritableStreamDefaultController<W = any> {
679
684
  private constructor();
685
+ /**
686
+ * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.
687
+ */
688
+ readonly abortReason: any;
689
+ /**
690
+ * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.
691
+ */
692
+ readonly signal: AbortSignal;
680
693
  /**
681
694
  * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.
682
695
  *
@@ -89,7 +89,9 @@ export declare interface QueuingStrategyInit {
89
89
 
90
90
  declare type QueuingStrategySizeCallback<T = any> = (chunk: T) => number;
91
91
 
92
- declare type ReadableByteStream = ReadableStream<Uint8Array>;
92
+ declare type ReadableByteStream = ReadableStream<Uint8Array> & {
93
+ _readableStreamController: ReadableByteStreamController;
94
+ };
93
95
 
94
96
  /**
95
97
  * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.
@@ -262,8 +264,11 @@ export declare class ReadableStreamBYOBReader {
262
264
  * @public
263
265
  */
264
266
  export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
265
- done: boolean;
267
+ done: false;
266
268
  value: T;
269
+ } | {
270
+ done: true;
271
+ value: T | undefined;
267
272
  };
268
273
 
269
274
  /**
@@ -677,6 +682,14 @@ export declare class WritableStream<W = any> {
677
682
  */
678
683
  export declare class WritableStreamDefaultController<W = any> {
679
684
  private constructor();
685
+ /**
686
+ * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.
687
+ */
688
+ get abortReason(): any;
689
+ /**
690
+ * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.
691
+ */
692
+ get signal(): AbortSignal;
680
693
  /**
681
694
  * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.
682
695
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-streams-polyfill",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
4
4
  "description": "Web Streams, based on the WHATWG spec reference implementation",
5
5
  "main": "dist/polyfill",
6
6
  "browser": "dist/polyfill.min.js",