blob: 785e39445363c24cd649ce3c517e50f67f51b787 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://streams.spec.whatwg.org/#rs-class
[
Exposed=(Window,Worker,Worklet)
] interface ReadableStream {
[CallWith=ScriptState, RaisesException] constructor(optional any underlyingSource, optional any strategy);
// As long as we use V8Extras, anything can raise an exception.
[RaisesException, CallWith=ScriptState, NotEnumerable] readonly attribute boolean locked;
// TODO(yhirano): function length is different from what's specced. Fix it.
[RaisesException, CallWith=ScriptState, NotEnumerable] Promise<any> cancel(
optional any reason);
[RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamGetReader] ReadableStreamDefaultReader getReader(optional any mode);
[RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamPipeThrough] any pipeThrough(
any transformStream, optional any options);
[RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamPipeTo] Promise<any> pipeTo(
any destination, optional any option);
[RaisesException, CallWith=ScriptState, NotEnumerable] any tee();
};