2022-01-24 15:11:29 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
enum WriteCommandType {
|
|
|
|
"write",
|
|
|
|
"seek",
|
2022-11-09 20:15:25 +03:00
|
|
|
"truncate"
|
2022-01-24 15:11:29 +03:00
|
|
|
};
|
|
|
|
|
2022-12-14 16:20:45 +03:00
|
|
|
[GenerateConversionToJS]
|
2022-01-24 15:11:29 +03:00
|
|
|
dictionary WriteParams {
|
|
|
|
required WriteCommandType type;
|
|
|
|
unsigned long long? size;
|
|
|
|
unsigned long long? position;
|
2023-01-11 11:33:47 +03:00
|
|
|
(BufferSource or Blob or UTF8String)? data;
|
2022-01-24 15:11:29 +03:00
|
|
|
};
|
|
|
|
|
2023-01-11 11:33:47 +03:00
|
|
|
typedef (BufferSource or Blob or UTF8String or WriteParams) FileSystemWriteChunkType;
|
2022-01-24 15:11:29 +03:00
|
|
|
|
|
|
|
[Exposed=(Window,Worker), SecureContext, Pref="dom.fs.enabled"]
|
|
|
|
interface FileSystemWritableFileStream : WritableStream {
|
2022-11-09 20:15:25 +03:00
|
|
|
[NewObject, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
Promise<undefined> write(FileSystemWriteChunkType data);
|
2022-05-02 10:44:23 +03:00
|
|
|
[NewObject]
|
2022-09-21 10:44:58 +03:00
|
|
|
Promise<undefined> seek(unsigned long long position);
|
2022-05-02 10:44:23 +03:00
|
|
|
[NewObject]
|
2022-09-21 10:44:58 +03:00
|
|
|
Promise<undefined> truncate(unsigned long long size);
|
2022-01-24 15:11:29 +03:00
|
|
|
};
|