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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/FileAPI/#file
8 * https://wicg.github.io/entries-api
13 [Exposed=(Window,Worker)]
14 interface File : Blob {
16 constructor(sequence<BlobPart> fileBits,
17 USVString fileName, optional FilePropertyBag options = {});
19 readonly attribute DOMString name;
22 readonly attribute long long lastModified;
25 dictionary FilePropertyBag : BlobPropertyBag {
26 long long lastModified;
29 dictionary ChromeFilePropertyBag : FilePropertyBag {
31 boolean existenceCheck = true;
34 // https://wicg.github.io/entries-api
35 partial interface File {
36 [BinaryName="relativePath", Pref="dom.webkitBlink.dirPicker.enabled"]
37 readonly attribute USVString webkitRelativePath;
41 partial interface File {
42 [GetterThrows, ChromeOnly, NeedsCallerType]
43 readonly attribute DOMString mozFullPath;
47 // These 2 methods can be used only in these conditions:
49 // - parent process OR file process OR, only for testing, with pref
50 // `dom.file.createInChild' set to true.
52 partial interface File {
53 [ChromeOnly, Throws, NeedsCallerType]
54 static Promise<File> createFromNsIFile(nsIFile file,
55 optional ChromeFilePropertyBag options = {});
57 [ChromeOnly, Throws, NeedsCallerType]
58 static Promise<File> createFromFileName(USVString fileName,
59 optional ChromeFilePropertyBag options = {});