ReadableStream.idl 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. #import <Streams/QueuingStrategy.idl>
  2. #import <Streams/ReadableStreamBYOBReader.idl>
  3. #import <Streams/ReadableStreamDefaultReader.idl>
  4. // https://streams.spec.whatwg.org/#enumdef-readablestreamreadermode
  5. enum ReadableStreamReaderMode { "byob" };
  6. // https://streams.spec.whatwg.org/#dictdef-readablestreamgetreaderoptions
  7. dictionary ReadableStreamGetReaderOptions {
  8. ReadableStreamReaderMode mode;
  9. };
  10. // https://streams.spec.whatwg.org/#readablestream
  11. [Exposed=*, Transferable]
  12. interface ReadableStream {
  13. constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});
  14. // FIXME: static ReadableStream from(any asyncIterable);
  15. readonly attribute boolean locked;
  16. Promise<undefined> cancel(optional any reason);
  17. ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {});
  18. // FIXME: ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {});
  19. // FIXME: Promise<undefined> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
  20. sequence<ReadableStream> tee();
  21. // FIXME: async iterable<any>(optional ReadableStreamIteratorOptions options = {});
  22. };
  23. typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader;