ladybird/Userland/Libraries/LibWeb/Streams/ReadableStream.idl
Timothy Flynn d8413774df LibWeb: Expose the ReadableStream tee IDL interface
This just sets up the plumbing to the underlying ReadableStreamTee AO,
which as of this commit, will just throw a NotImplemented exception.
2024-01-29 07:21:59 +01:00

32 lines
1.3 KiB
Plaintext

#import <Streams/QueuingStrategy.idl>
#import <Streams/ReadableStreamBYOBReader.idl>
#import <Streams/ReadableStreamDefaultReader.idl>
// https://streams.spec.whatwg.org/#enumdef-readablestreamreadermode
enum ReadableStreamReaderMode { "byob" };
// https://streams.spec.whatwg.org/#dictdef-readablestreamgetreaderoptions
dictionary ReadableStreamGetReaderOptions {
ReadableStreamReaderMode mode;
};
// https://streams.spec.whatwg.org/#readablestream
[Exposed=*, Transferable]
interface ReadableStream {
constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});
// FIXME: static ReadableStream from(any asyncIterable);
readonly attribute boolean locked;
Promise<undefined> cancel(optional any reason);
ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {});
// FIXME: ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {});
// FIXME: Promise<undefined> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
sequence<ReadableStream> tee();
// FIXME: async iterable<any>(optional ReadableStreamIteratorOptions options = {});
};
typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader;