File tree 1 file changed +32
-0
lines changed
src/main/scala/org/scalajs/dom/experimental/storage
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .scalajs .dom .experimental
2
+
3
+ import org .scalajs .dom
4
+
5
+ import scala .language .implicitConversions
6
+ import scala .scalajs .js
7
+
8
+ /**
9
+ * https://storage.spec.whatwg.org/
10
+ */
11
+ package object storage {
12
+ implicit def toNavigatorStorage (navigator : dom.Navigator ): NavigatorStorage =
13
+ navigator.asInstanceOf [NavigatorStorage ]
14
+
15
+ @ js.native
16
+ trait NavigatorStorage extends js.Object {
17
+ val storage : StorageManager = js.native
18
+ }
19
+
20
+ @ js.native
21
+ trait StorageManager extends js.Any {
22
+ def persisted (): js.Promise [Boolean ] = js.native
23
+ def persist (): js.Promise [Boolean ] = js.native
24
+ def estimate (): js.Promise [StorageEstimate ] = js.native
25
+ }
26
+
27
+ @ js.native
28
+ trait StorageEstimate extends js.Any {
29
+ val usage : Double = js.native
30
+ val quota : Double = js.native
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments