2022-01-24 12:11:29 +00: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 17:15:25 +00:00
|
|
|
"truncate"
|
2022-01-24 12:11:29 +00:00
|
|
|
};
|
|
|
|
|
2022-12-14 13:20:45 +00:00
|
|
|
[GenerateConversionToJS]
|
2022-01-24 12:11:29 +00:00
|
|
|
dictionary WriteParams {
|
|
|
|
required WriteCommandType type;
|
|
|
|
unsigned long long? size;
|
|
|
|
unsigned long long? position;
|
2023-01-11 08:33:47 +00:00
|
|
|
(BufferSource or Blob or UTF8String)? data;
|
2022-01-24 12:11:29 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 08:33:47 +00:00
|
|
|
typedef (BufferSource or Blob or UTF8String or WriteParams) FileSystemWriteChunkType;
|
2022-01-24 12:11:29 +00:00
|
|
|
|
|
|
|
[Exposed=(Window,Worker), SecureContext, Pref="dom.fs.enabled"]
|
|
|
|
interface FileSystemWritableFileStream : WritableStream {
|
2022-11-09 17:15:25 +00:00
|
|
|
[NewObject, Throws]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> write(FileSystemWriteChunkType data);
|
2022-05-02 07:44:23 +00:00
|
|
|
[NewObject]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> seek(unsigned long long position);
|
2022-05-02 07:44:23 +00:00
|
|
|
[NewObject]
|
2022-09-21 07:44:58 +00:00
|
|
|
Promise<undefined> truncate(unsigned long long size);
|
2022-01-24 12:11:29 +00:00
|
|
|
};
|