Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / webidl / ReadableStream.webidl
blobf5d2b86a7dc27f52ae64ddfd6c361fe3fd838f39
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://streams.spec.whatwg.org/#rs-class-definition
8  */
10 [Exposed=*] // [Transferable] - See Bug 1562065
11 interface ReadableStream {
12   [Throws]
13   constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});
15   [Pref="dom.streams.from.enabled", Throws]
16   static ReadableStream from(any asyncIterable);
18   readonly attribute boolean locked;
20   [NewObject]
21   Promise<undefined> cancel(optional any reason);
23   [Throws]
24   ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {});
26   [Throws]
27   ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {});
29   [NewObject]
30   Promise<undefined> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
32   [Throws]
33   sequence<ReadableStream> tee();
35   [GenerateReturnMethod]
36   async iterable<any>(optional ReadableStreamIteratorOptions options = {});
39 enum ReadableStreamReaderMode { "byob" };
41 dictionary ReadableStreamGetReaderOptions {
42   ReadableStreamReaderMode mode;
45 dictionary ReadableStreamIteratorOptions {
46   boolean preventCancel = false;
49 dictionary ReadableWritablePair {
50   required ReadableStream readable;
51   required WritableStream writable;
54 dictionary StreamPipeOptions {
55   boolean preventClose = false;
56   boolean preventAbort = false;
57   boolean preventCancel = false;
58   AbortSignal signal;