chromium/third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.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.

// https://fs.spec.whatwg.org/#filesystemwritablefilestream
[
    Exposed=(Window,Worker),
    SecureContext,
    RuntimeEnabled=FileSystemAccess
] interface FileSystemWritableFileStream : WritableStream {
    [RuntimeEnabled=FileSystemAccessLockingScheme] readonly attribute USVString mode;

    [
        CallWith=ScriptState,
        RaisesException
    ] Promise<undefined> write((BufferSource or Blob or USVString or WriteParams) data);

    [
        CallWith=ScriptState,
        RaisesException
    ] Promise<undefined> truncate(unsigned long long size);

    [
        CallWith=ScriptState,
        RaisesException
    ] Promise<undefined> seek(unsigned long long offset);
};