web-streams-polyfill 3.0.2 → 3.2.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.
- package/CHANGELOG.md +26 -1
- package/README.md +10 -6
- package/dist/polyfill.es2018.js +491 -124
- package/dist/polyfill.es2018.js.map +1 -1
- package/dist/polyfill.es2018.min.js +1 -1
- package/dist/polyfill.es2018.min.js.map +1 -1
- package/dist/polyfill.es2018.mjs +490 -123
- package/dist/polyfill.es2018.mjs.map +1 -1
- package/dist/polyfill.es6.js +491 -124
- package/dist/polyfill.es6.js.map +1 -1
- package/dist/polyfill.es6.min.js +1 -1
- package/dist/polyfill.es6.min.js.map +1 -1
- package/dist/polyfill.es6.mjs +490 -123
- package/dist/polyfill.es6.mjs.map +1 -1
- package/dist/polyfill.js +499 -124
- package/dist/polyfill.js.map +1 -1
- package/dist/polyfill.min.js +1 -1
- package/dist/polyfill.min.js.map +1 -1
- package/dist/polyfill.mjs +498 -123
- package/dist/polyfill.mjs.map +1 -1
- package/dist/ponyfill.es2018.js +491 -124
- package/dist/ponyfill.es2018.js.map +1 -1
- package/dist/ponyfill.es2018.mjs +490 -123
- package/dist/ponyfill.es2018.mjs.map +1 -1
- package/dist/ponyfill.es6.js +491 -124
- package/dist/ponyfill.es6.js.map +1 -1
- package/dist/ponyfill.es6.mjs +490 -123
- package/dist/ponyfill.es6.mjs.map +1 -1
- package/dist/ponyfill.js +499 -124
- package/dist/ponyfill.js.map +1 -1
- package/dist/ponyfill.mjs +498 -123
- package/dist/ponyfill.mjs.map +1 -1
- package/dist/types/polyfill.d.ts +30 -10
- package/dist/types/ts3.6/polyfill.d.ts +30 -10
- package/dist/types/tsdoc-metadata.json +1 -1
- package/package.json +16 -16
package/dist/types/polyfill.d.ts
CHANGED
|
@@ -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.
|
|
@@ -173,7 +175,10 @@ export declare class ReadableStream<R = any> {
|
|
|
173
175
|
*
|
|
174
176
|
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
|
175
177
|
*/
|
|
176
|
-
pipeThrough<
|
|
178
|
+
pipeThrough<RS extends ReadableStream>(transform: {
|
|
179
|
+
readable: RS;
|
|
180
|
+
writable: WritableStream<R>;
|
|
181
|
+
}, options?: StreamPipeOptions): RS;
|
|
177
182
|
/**
|
|
178
183
|
* Pipes this readable stream to a given writable stream. The way in which the piping process behaves under
|
|
179
184
|
* various error conditions can be customized with a number of passed options. It returns a promise that fulfills
|
|
@@ -218,7 +223,7 @@ export declare class ReadableStream<R = any> {
|
|
|
218
223
|
* @public
|
|
219
224
|
*/
|
|
220
225
|
export declare interface ReadableStreamAsyncIterator<R> extends AsyncIterator<R> {
|
|
221
|
-
next(): Promise<IteratorResult<R>>;
|
|
226
|
+
next(): Promise<IteratorResult<R, undefined>>;
|
|
222
227
|
return(value?: any): Promise<IteratorResult<any>>;
|
|
223
228
|
}
|
|
224
229
|
|
|
@@ -233,7 +238,7 @@ export declare class ReadableStreamBYOBReader {
|
|
|
233
238
|
* Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or
|
|
234
239
|
* the reader's lock is released before the stream finishes closing.
|
|
235
240
|
*/
|
|
236
|
-
readonly closed: Promise<
|
|
241
|
+
readonly closed: Promise<undefined>;
|
|
237
242
|
/**
|
|
238
243
|
* If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.
|
|
239
244
|
*/
|
|
@@ -262,8 +267,11 @@ export declare class ReadableStreamBYOBReader {
|
|
|
262
267
|
* @public
|
|
263
268
|
*/
|
|
264
269
|
export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
|
|
265
|
-
done:
|
|
270
|
+
done: false;
|
|
266
271
|
value: T;
|
|
272
|
+
} | {
|
|
273
|
+
done: true;
|
|
274
|
+
value: T | undefined;
|
|
267
275
|
};
|
|
268
276
|
|
|
269
277
|
/**
|
|
@@ -333,7 +341,7 @@ export declare class ReadableStreamDefaultReader<R = any> {
|
|
|
333
341
|
* Returns a promise that will be fulfilled when the stream becomes closed,
|
|
334
342
|
* or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.
|
|
335
343
|
*/
|
|
336
|
-
readonly closed: Promise<
|
|
344
|
+
readonly closed: Promise<undefined>;
|
|
337
345
|
/**
|
|
338
346
|
* If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.
|
|
339
347
|
*/
|
|
@@ -366,7 +374,7 @@ export declare type ReadableStreamDefaultReadResult<T> = {
|
|
|
366
374
|
value: T;
|
|
367
375
|
} | {
|
|
368
376
|
done: true;
|
|
369
|
-
value
|
|
377
|
+
value?: undefined;
|
|
370
378
|
};
|
|
371
379
|
|
|
372
380
|
/**
|
|
@@ -658,7 +666,7 @@ export declare class WritableStream<W = any> {
|
|
|
658
666
|
* successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with
|
|
659
667
|
* a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.
|
|
660
668
|
*/
|
|
661
|
-
close(): Promise<
|
|
669
|
+
close(): Promise<undefined>;
|
|
662
670
|
/**
|
|
663
671
|
* Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream
|
|
664
672
|
* is locked, no other writer can be acquired until this one is released.
|
|
@@ -677,6 +685,18 @@ export declare class WritableStream<W = any> {
|
|
|
677
685
|
*/
|
|
678
686
|
export declare class WritableStreamDefaultController<W = any> {
|
|
679
687
|
private constructor();
|
|
688
|
+
/**
|
|
689
|
+
* The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.
|
|
690
|
+
*
|
|
691
|
+
* @deprecated
|
|
692
|
+
* This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.
|
|
693
|
+
* Use {@link WritableStreamDefaultController.signal}'s `reason` instead.
|
|
694
|
+
*/
|
|
695
|
+
readonly abortReason: any;
|
|
696
|
+
/**
|
|
697
|
+
* An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.
|
|
698
|
+
*/
|
|
699
|
+
readonly signal: AbortSignal;
|
|
680
700
|
/**
|
|
681
701
|
* Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.
|
|
682
702
|
*
|
|
@@ -698,7 +718,7 @@ export declare class WritableStreamDefaultWriter<W = any> {
|
|
|
698
718
|
* Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or
|
|
699
719
|
* the writer’s lock is released before the stream finishes closing.
|
|
700
720
|
*/
|
|
701
|
-
readonly closed: Promise<
|
|
721
|
+
readonly closed: Promise<undefined>;
|
|
702
722
|
/**
|
|
703
723
|
* Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.
|
|
704
724
|
* A producer can use this information to determine the right amount of data to write.
|
|
@@ -716,7 +736,7 @@ export declare class WritableStreamDefaultWriter<W = any> {
|
|
|
716
736
|
* If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become
|
|
717
737
|
* rejected.
|
|
718
738
|
*/
|
|
719
|
-
readonly ready: Promise<
|
|
739
|
+
readonly ready: Promise<undefined>;
|
|
720
740
|
/**
|
|
721
741
|
* If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.
|
|
722
742
|
*/
|
|
@@ -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.
|
|
@@ -173,7 +175,10 @@ export declare class ReadableStream<R = any> {
|
|
|
173
175
|
*
|
|
174
176
|
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
|
175
177
|
*/
|
|
176
|
-
pipeThrough<
|
|
178
|
+
pipeThrough<RS extends ReadableStream>(transform: {
|
|
179
|
+
readable: RS;
|
|
180
|
+
writable: WritableStream<R>;
|
|
181
|
+
}, options?: StreamPipeOptions): RS;
|
|
177
182
|
/**
|
|
178
183
|
* Pipes this readable stream to a given writable stream. The way in which the piping process behaves under
|
|
179
184
|
* various error conditions can be customized with a number of passed options. It returns a promise that fulfills
|
|
@@ -218,7 +223,7 @@ export declare class ReadableStream<R = any> {
|
|
|
218
223
|
* @public
|
|
219
224
|
*/
|
|
220
225
|
export declare interface ReadableStreamAsyncIterator<R> extends AsyncIterator<R> {
|
|
221
|
-
next(): Promise<IteratorResult<R>>;
|
|
226
|
+
next(): Promise<IteratorResult<R, undefined>>;
|
|
222
227
|
return(value?: any): Promise<IteratorResult<any>>;
|
|
223
228
|
}
|
|
224
229
|
|
|
@@ -233,7 +238,7 @@ export declare class ReadableStreamBYOBReader {
|
|
|
233
238
|
* Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or
|
|
234
239
|
* the reader's lock is released before the stream finishes closing.
|
|
235
240
|
*/
|
|
236
|
-
get closed(): Promise<
|
|
241
|
+
get closed(): Promise<undefined>;
|
|
237
242
|
/**
|
|
238
243
|
* If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.
|
|
239
244
|
*/
|
|
@@ -262,8 +267,11 @@ export declare class ReadableStreamBYOBReader {
|
|
|
262
267
|
* @public
|
|
263
268
|
*/
|
|
264
269
|
export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
|
|
265
|
-
done:
|
|
270
|
+
done: false;
|
|
266
271
|
value: T;
|
|
272
|
+
} | {
|
|
273
|
+
done: true;
|
|
274
|
+
value: T | undefined;
|
|
267
275
|
};
|
|
268
276
|
|
|
269
277
|
/**
|
|
@@ -333,7 +341,7 @@ export declare class ReadableStreamDefaultReader<R = any> {
|
|
|
333
341
|
* Returns a promise that will be fulfilled when the stream becomes closed,
|
|
334
342
|
* or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.
|
|
335
343
|
*/
|
|
336
|
-
get closed(): Promise<
|
|
344
|
+
get closed(): Promise<undefined>;
|
|
337
345
|
/**
|
|
338
346
|
* If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.
|
|
339
347
|
*/
|
|
@@ -366,7 +374,7 @@ export declare type ReadableStreamDefaultReadResult<T> = {
|
|
|
366
374
|
value: T;
|
|
367
375
|
} | {
|
|
368
376
|
done: true;
|
|
369
|
-
value
|
|
377
|
+
value?: undefined;
|
|
370
378
|
};
|
|
371
379
|
|
|
372
380
|
/**
|
|
@@ -658,7 +666,7 @@ export declare class WritableStream<W = any> {
|
|
|
658
666
|
* successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with
|
|
659
667
|
* a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.
|
|
660
668
|
*/
|
|
661
|
-
close(): Promise<
|
|
669
|
+
close(): Promise<undefined>;
|
|
662
670
|
/**
|
|
663
671
|
* Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream
|
|
664
672
|
* is locked, no other writer can be acquired until this one is released.
|
|
@@ -677,6 +685,18 @@ export declare class WritableStream<W = any> {
|
|
|
677
685
|
*/
|
|
678
686
|
export declare class WritableStreamDefaultController<W = any> {
|
|
679
687
|
private constructor();
|
|
688
|
+
/**
|
|
689
|
+
* The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.
|
|
690
|
+
*
|
|
691
|
+
* @deprecated
|
|
692
|
+
* This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.
|
|
693
|
+
* Use {@link WritableStreamDefaultController.signal}'s `reason` instead.
|
|
694
|
+
*/
|
|
695
|
+
get abortReason(): any;
|
|
696
|
+
/**
|
|
697
|
+
* An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.
|
|
698
|
+
*/
|
|
699
|
+
get signal(): AbortSignal;
|
|
680
700
|
/**
|
|
681
701
|
* Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.
|
|
682
702
|
*
|
|
@@ -698,7 +718,7 @@ export declare class WritableStreamDefaultWriter<W = any> {
|
|
|
698
718
|
* Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or
|
|
699
719
|
* the writer’s lock is released before the stream finishes closing.
|
|
700
720
|
*/
|
|
701
|
-
get closed(): Promise<
|
|
721
|
+
get closed(): Promise<undefined>;
|
|
702
722
|
/**
|
|
703
723
|
* Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.
|
|
704
724
|
* A producer can use this information to determine the right amount of data to write.
|
|
@@ -716,7 +736,7 @@ export declare class WritableStreamDefaultWriter<W = any> {
|
|
|
716
736
|
* If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become
|
|
717
737
|
* rejected.
|
|
718
738
|
*/
|
|
719
|
-
get ready(): Promise<
|
|
739
|
+
get ready(): Promise<undefined>;
|
|
720
740
|
/**
|
|
721
741
|
* If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.
|
|
722
742
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-streams-polyfill",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.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",
|
|
@@ -54,23 +54,23 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/MattiasBuelens/web-streams-polyfill#readme",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@microsoft/api-extractor": "^7.
|
|
57
|
+
"@microsoft/api-extractor": "^7.13.4",
|
|
58
58
|
"@rollup/plugin-inject": "^4.0.2",
|
|
59
|
-
"@rollup/plugin-replace": "^2.
|
|
59
|
+
"@rollup/plugin-replace": "^2.4.2",
|
|
60
60
|
"@rollup/plugin-strip": "^2.0.0",
|
|
61
|
-
"@rollup/plugin-typescript": "^
|
|
62
|
-
"@types/node": "^
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
64
|
-
"@typescript-eslint/parser": "^
|
|
65
|
-
"@ungap/promise-all-settled": "^1.1.
|
|
66
|
-
"eslint": "^7.
|
|
67
|
-
"jasmine": "^3.
|
|
61
|
+
"@rollup/plugin-typescript": "^8.2.1",
|
|
62
|
+
"@types/node": "^14.14.37",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^4.21.0",
|
|
64
|
+
"@typescript-eslint/parser": "^4.21.0",
|
|
65
|
+
"@ungap/promise-all-settled": "^1.1.2",
|
|
66
|
+
"eslint": "^7.23.0",
|
|
67
|
+
"jasmine": "^3.7.0",
|
|
68
68
|
"micromatch": "^4.0.2",
|
|
69
|
-
"rollup": "^2.
|
|
70
|
-
"rollup-plugin-terser": "^
|
|
71
|
-
"ts-morph": "^
|
|
72
|
-
"tslib": "^2.
|
|
73
|
-
"typescript": "^
|
|
74
|
-
"wpt-runner": "^3.2.
|
|
69
|
+
"rollup": "^2.44.0",
|
|
70
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
71
|
+
"ts-morph": "^10.0.2",
|
|
72
|
+
"tslib": "^2.2.0",
|
|
73
|
+
"typescript": "^4.2.4",
|
|
74
|
+
"wpt-runner": "^3.2.1"
|
|
75
75
|
}
|
|
76
76
|
}
|