FileSystemWritableFileStream.webidl (975B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 enum WriteCommandType { 7 "write", 8 "seek", 9 "truncate" 10 }; 11 12 [GenerateConversionToJS] 13 dictionary WriteParams { 14 required WriteCommandType type; 15 unsigned long long? size; 16 unsigned long long? position; 17 (BufferSource or Blob or UTF8String)? data; 18 }; 19 20 typedef (BufferSource or Blob or UTF8String or WriteParams) FileSystemWriteChunkType; 21 22 [Exposed=(Window,Worker), SecureContext, Pref="dom.fs.enabled"] 23 interface FileSystemWritableFileStream : WritableStream { 24 [NewObject, Throws] 25 Promise<undefined> write(FileSystemWriteChunkType data); 26 [NewObject] 27 Promise<undefined> seek(unsigned long long position); 28 [NewObject] 29 Promise<undefined> truncate(unsigned long long size); 30 };