chromium/third_party/blink/renderer/core/streams/writable_stream_default_writer.idl

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This is only used when the new C++ implementation is enabled.

// https://streams.spec.whatwg.org/#default-writer-class-definition
[
    Exposed=(Window,Worker,Worklet)
] interface WritableStreamDefaultWriter {
    [CallWith=ScriptState, RaisesException] constructor(WritableStream stream);
    [CallWith=ScriptState] readonly attribute Promise<undefined>
        closed;
    [RaisesException, CallWith=ScriptState] readonly attribute
        any desiredSize;
    [CallWith=ScriptState] readonly attribute Promise<undefined>
        ready;

    [CallWith=ScriptState, RaisesException] Promise<undefined> abort(
        optional any reason);
    [CallWith=ScriptState, RaisesException] Promise<undefined> close();
    [CallWith=ScriptState] void releaseLock();
    [CallWith=ScriptState, RaisesException] Promise<undefined> write(
        optional any chunk);
};