Skip to content

Commit 1604459

Browse files
committed
Fixup File API
1 parent 927ac5d commit 1604459

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

dom/src/main/scala/org/scalajs/dom/File.scala

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,28 @@ import scala.scalajs.js.annotation._
1919
*/
2020
@js.native
2121
@JSGlobal
22-
abstract class File extends Blob {
22+
abstract class File[A](bits: js.Iterable[A], name: String, options: FileOptions) extends Blob {
2323

2424
/** Returns the name of the file. For security reasons, the path is excluded from this property. */
2525
def name: String = js.native
26+
27+
/** The File.lastModified read-only property provides the last modified date of the file as the number of milliseconds
28+
* since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current
29+
* date.
30+
*/
31+
def lastModified: Int = js.native
32+
33+
/** The File.webkitRelativePath is a read-only property that contains a string which specifies the file's path
34+
* relative to the directory selected by the user in an <input> element with its webkitdirectory attribute set.
35+
*
36+
* @return
37+
* A string containing the path of the file relative to the ancestor directory the user selected.
38+
*/
39+
def webkitRelativePath: String = js.native
40+
}
41+
42+
/** An options object containing optional attributes for the file. */
43+
trait FileOptions extends js.Object {
44+
var `type`: js.UndefOr[String] = js.undefined
45+
var lastModified: js.UndefOr[Int] = js.undefined
2646
}

0 commit comments

Comments
 (0)