-
Notifications
You must be signed in to change notification settings - Fork 441
/
Copy pathStreams.widl
195 lines (159 loc) · 5.87 KB
/
Streams.widl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
[Constructor(optional UnderlyingSource underlyingSource, optional QueuingStrategy strategy),
Constructor(optional UnderlyingByteSource underlyingSource, optional QueuingStrategy strategy),
Exposed=(Window,Worker)]
interface ReadableStream {
readonly attribute boolean locked;
Promise<void> cancel(optional any reason);
ReadableStreamBYOBReader getReader(any options);
ReadableStreamDefaultReader getReader();
any pipeThrough(any pair, optional PipeOptions options);
Promise<void> pipeTo(WritableStream dest, optional PipeOptions options);
[ReadableStream, ReadableStream] tee();
};
callback QueuingStrategySizeCallback = double (any chunk);
dictionary QueuingStrategy {
unrestricted double? highWaterMark;
QueuingStrategySizeCallback? size;
};
callback ReadableByteStreamControllerCallback = any (ReadableByteStreamController controller);
callback ReadableStreamDefaultControllerCallback = any (ReadableStreamDefaultController controller);
callback ReadableStreamErrorCallback = any (any reason);
dictionary UnderlyingSource {
ReadableStreamDefaultControllerCallback? start;
ReadableStreamDefaultControllerCallback? pull;
ReadableStreamErrorCallback? cancel;
any type;
};
dictionary UnderlyingByteSource {
ReadableByteStreamControllerCallback? start;
ReadableByteStreamControllerCallback? pull;
ReadableStreamErrorCallback? cancel;
required DOMString type;
unsigned long? autoAllocateChunkSize;
};
dictionary PipeOptions {
boolean? preventClose;
boolean? preventAbort;
boolean? preventCancel;
AbortSignal? signal;
};
dictionary ReadableStreamReadValueResult {
required boolean done;
required any value;
};
dictionary ReadableStreamReadDoneResult {
required boolean done;
any value;
};
[Exposed=(Window,Worker)]
typedef (ReadableStreamReadValueResult or ReadableStreamReadDoneResult) ReadableStreamReadResult;
[Exposed=(Window,Worker),
NoInterfaceObject]
interface ReadableStreamDefaultReader {
readonly attribute Promise<void> closed;
Promise<void> cancel(optional any reason);
Promise<ReadableStreamReadResult> read();
void releaseLock();
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface ReadableStreamBYOBReader {
readonly attribute Promise<void> closed;
Promise<void> cancel(optional any reason);
Promise<ReadableStreamReadResult> read(ArrayBufferView view);
void releaseLock();
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface ReadableStreamDefaultController {
readonly attribute unrestricted double? desiredSize;
void close();
void enqueue(any chunk);
void error(optional any error);
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface ReadableByteStreamController {
readonly attribute ReadableStreamBYOBRequest byobRequest;
readonly attribute unrestricted double? desiredSize;
void close();
void enqueue(ArrayBufferView chunk);
void error(optional any error);
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface ReadableStreamBYOBRequest {
readonly attribute ArrayBufferView view;
void respond(unsigned long bytesWritten);
void respondWithNewView(ArrayBufferView view);
};
[Constructor(optional UnderlyingSink underlyingSink, optional QueuingStrategy strategy),
Exposed=(Window,Worker)]
interface WritableStream {
readonly attribute boolean locked;
Promise<void> abort(optional any reason);
Promise<void> close();
WritableStreamDefaultWriter getWriter();
};
callback WritableStreamDefaultControllerStartCallback = any (WritableStreamDefaultController controller);
callback WritableStreamDefaultControllerWriteCallback = any (any chunk, WritableStreamDefaultController controller);
callback WritableStreamDefaultControllerCloseCallback = any ();
callback WritableStreamErrorCallback = any (any reason);
dictionary UnderlyingSink {
WritableStreamDefaultControllerStartCallback? start;
WritableStreamDefaultControllerWriteCallback? write;
WritableStreamDefaultControllerCloseCallback? close;
WritableStreamErrorCallback? abort;
any type;
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface WritableStreamDefaultWriter {
readonly attribute Promise<void> closed;
readonly attribute unrestricted double? desiredSize;
readonly attribute Promise<void> ready;
Promise<void> abort(optional any reason);
Promise<void> close();
void releaseLock();
Promise<void> write(any chunk);
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface WritableStreamDefaultController {
void error(optional any error);
};
[Constructor(optional Transformer transformer, optional QueuingStrategy writableStrategy, optional QueuingStrategy readableStrategy),
Exposed=(Window,Worker)]
interface TransformStream {
readonly attribute ReadableStream readable;
readonly attribute WritableStream writable;
};
callback TransformStreamDefaultControllerCallback = any (TransformStreamDefaultController controller);
callback TransformStreamDefaultControllerTransformCallback = any (any chunk, TransformStreamDefaultController controller);
dictionary Transformer {
TransformStreamDefaultControllerCallback? start;
TransformStreamDefaultControllerTransformCallback? transform;
TransformStreamDefaultControllerCallback? flush;
any readableType;
any writableType;
};
[Exposed=(Window,Worker),
NoInterfaceObject]
interface TransformStreamDefaultController {
readonly attribute unrestricted double? desiredSize;
void enqueue(any chunk);
void error(optional any reason);
void terminate();
};
[Constructor(any options),
Exposed=(Window,Worker)]
interface ByteLengthQueuingStrategy: QueuingStrategy {
attribute unrestricted double highWaterMark;
double size(ArrayBufferView chunk);
};
[Constructor(any options),
Exposed=(Window,Worker)]
interface CountQueuingStrategy: QueuingStrategy {
attribute unrestricted double highWaterMark;
double size(any chunk);
};