blob: fd5420f16a09673c0cb52294682f3728d996d042 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:051// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: Streams Standard (https://streams.spec.whatwg.org/)
5
6[Exposed=*, Transferable]
7interface ReadableStream {
8 constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});
9
10 readonly attribute boolean locked;
11
12 Promise<undefined> cancel(optional any reason);
13 ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {});
14 ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {});
15 Promise<undefined> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
16 sequence<ReadableStream> tee();
17
18 async iterable<any>(optional ReadableStreamIteratorOptions options = {});
19};
20
21typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader;
22
23enum ReadableStreamReaderMode { "byob" };
24
25dictionary ReadableStreamGetReaderOptions {
26 ReadableStreamReaderMode mode;
27};
28
29dictionary ReadableStreamIteratorOptions {
30 boolean preventCancel = false;
31};
32
33dictionary ReadableWritablePair {
34 required ReadableStream readable;
35 required WritableStream writable;
36};
37
38dictionary StreamPipeOptions {
39 boolean preventClose = false;
40 boolean preventAbort = false;
41 boolean preventCancel = false;
42 AbortSignal signal;
43};
44
45dictionary UnderlyingSource {
46 UnderlyingSourceStartCallback start;
47 UnderlyingSourcePullCallback pull;
48 UnderlyingSourceCancelCallback cancel;
49 ReadableStreamType type;
50 [EnforceRange] unsigned long long autoAllocateChunkSize;
51};
52
53typedef (ReadableStreamDefaultController or ReadableByteStreamController) ReadableStreamController;
54
55callback UnderlyingSourceStartCallback = any (ReadableStreamController controller);
56callback UnderlyingSourcePullCallback = Promise<undefined> (ReadableStreamController controller);
57callback UnderlyingSourceCancelCallback = Promise<undefined> (optional any reason);
58
59enum ReadableStreamType { "bytes" };
60
61interface mixin ReadableStreamGenericReader {
62 readonly attribute Promise<undefined> closed;
63
64 Promise<undefined> cancel(optional any reason);
65};
66
67[Exposed=*]
68interface ReadableStreamDefaultReader {
69 constructor(ReadableStream stream);
70
71 Promise<ReadableStreamReadResult> read();
72 undefined releaseLock();
73};
74ReadableStreamDefaultReader includes ReadableStreamGenericReader;
75
76dictionary ReadableStreamReadResult {
77 any value;
78 boolean done;
79};
80
81[Exposed=*]
82interface ReadableStreamBYOBReader {
83 constructor(ReadableStream stream);
84
85 Promise<ReadableStreamReadResult> read(ArrayBufferView view);
86 undefined releaseLock();
87};
88ReadableStreamBYOBReader includes ReadableStreamGenericReader;
89
90[Exposed=*]
91interface ReadableStreamDefaultController {
92 readonly attribute unrestricted double? desiredSize;
93
94 undefined close();
95 undefined enqueue(optional any chunk);
96 undefined error(optional any e);
97};
98
99[Exposed=*]
100interface ReadableByteStreamController {
101 readonly attribute ReadableStreamBYOBRequest? byobRequest;
102 readonly attribute unrestricted double? desiredSize;
103
104 undefined close();
105 undefined enqueue(ArrayBufferView chunk);
106 undefined error(optional any e);
107};
108
109[Exposed=*]
110interface ReadableStreamBYOBRequest {
111 readonly attribute ArrayBufferView? view;
112
113 undefined respond([EnforceRange] unsigned long long bytesWritten);
114 undefined respondWithNewView(ArrayBufferView view);
115};
116
117[Exposed=*, Transferable]
118interface WritableStream {
119 constructor(optional object underlyingSink, optional QueuingStrategy strategy = {});
120
121 readonly attribute boolean locked;
122
123 Promise<undefined> abort(optional any reason);
124 Promise<undefined> close();
125 WritableStreamDefaultWriter getWriter();
126};
127
128dictionary UnderlyingSink {
129 UnderlyingSinkStartCallback start;
130 UnderlyingSinkWriteCallback write;
131 UnderlyingSinkCloseCallback close;
132 UnderlyingSinkAbortCallback abort;
133 any type;
134};
135
136callback UnderlyingSinkStartCallback = any (WritableStreamDefaultController controller);
137callback UnderlyingSinkWriteCallback = Promise<undefined> (any chunk, WritableStreamDefaultController controller);
138callback UnderlyingSinkCloseCallback = Promise<undefined> ();
139callback UnderlyingSinkAbortCallback = Promise<undefined> (optional any reason);
140
141[Exposed=*]
142interface WritableStreamDefaultWriter {
143 constructor(WritableStream stream);
144
145 readonly attribute Promise<undefined> closed;
146 readonly attribute unrestricted double? desiredSize;
147 readonly attribute Promise<undefined> ready;
148
149 Promise<undefined> abort(optional any reason);
150 Promise<undefined> close();
151 undefined releaseLock();
152 Promise<undefined> write(optional any chunk);
153};
154
155[Exposed=*]
156interface WritableStreamDefaultController {
157 readonly attribute AbortSignal signal;
158 undefined error(optional any e);
159};
160
161[Exposed=*, Transferable]
162interface TransformStream {
163 constructor(optional object transformer,
164 optional QueuingStrategy writableStrategy = {},
165 optional QueuingStrategy readableStrategy = {});
166
167 readonly attribute ReadableStream readable;
168 readonly attribute WritableStream writable;
169};
170
171dictionary Transformer {
172 TransformerStartCallback start;
173 TransformerTransformCallback transform;
174 TransformerFlushCallback flush;
175 any readableType;
176 any writableType;
177};
178
179callback TransformerStartCallback = any (TransformStreamDefaultController controller);
180callback TransformerFlushCallback = Promise<undefined> (TransformStreamDefaultController controller);
181callback TransformerTransformCallback = Promise<undefined> (any chunk, TransformStreamDefaultController controller);
182
183[Exposed=*]
184interface TransformStreamDefaultController {
185 readonly attribute unrestricted double? desiredSize;
186
187 undefined enqueue(optional any chunk);
188 undefined error(optional any reason);
189 undefined terminate();
190};
191
192dictionary QueuingStrategy {
193 unrestricted double highWaterMark;
194 QueuingStrategySize size;
195};
196
197callback QueuingStrategySize = unrestricted double (any chunk);
198
199dictionary QueuingStrategyInit {
200 required unrestricted double highWaterMark;
201};
202
203[Exposed=*]
204interface ByteLengthQueuingStrategy {
205 constructor(QueuingStrategyInit init);
206
207 readonly attribute unrestricted double highWaterMark;
208 readonly attribute Function size;
209};
210
211[Exposed=*]
212interface CountQueuingStrategy {
213 constructor(QueuingStrategyInit init);
214
215 readonly attribute unrestricted double highWaterMark;
216 readonly attribute Function size;
217};
218
219interface mixin GenericTransformStream {
220 readonly attribute ReadableStream readable;
221 readonly attribute WritableStream writable;
222};