blob: 798ebcb228a0c01abea5ad0135a40d6db799e767 [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/#ws-class
[
Exposed=(Window,Worker,Worklet),
// TODO(yhirano): Remove CustomConstructor. See https://crbug.com/906476.
CustomConstructor(optional any underlyingSink, optional any strategy),
MeasureAs=WritableStreamConstructor,
RaisesException=Constructor,
ConstructorCallWith=ScriptState
] interface WritableStream {
// As long as we use V8Extras, anything can raise an exception.
[RaisesException, CallWith=ScriptState, NotEnumerable] readonly attribute boolean locked;
[RaisesException, CallWith=ScriptState, NotEnumerable] Promise<void> abort(
optional any reason);
// TODO(ricea): Return WritableStreamDefaultWriter once the V8Extras-based
// implementation has been deleted.
[RaisesException, CallWith=ScriptState, NotEnumerable] any getWriter();
};