@rescript/webapi 0.1.0-pre-alpha-4ffc5e2 → 0.1.0-pre-alpha-b7f8547
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ClipboardAPI/Clipboard.res +9 -5
- package/src/CredentialManagementAPI/CredentialsContainer.res +10 -8
- package/src/DOMAPI/Document.res +2 -0
- package/src/DOMAPI/Element.res +2 -0
- package/src/DOMAPI/HTMLCanvasElement.res +2 -0
- package/src/DOMAPI/HTMLElement.res +2 -0
- package/src/DOMAPI/HTMLImageElement.res +2 -0
- package/src/DOMAPI/HTMLInputElement.res +2 -0
- package/src/DOMAPI/Location.res +2 -0
- package/src/DOMAPI/Node.res +2 -0
- package/src/DOMAPI/Window.res +1 -1
- package/src/EventAPI/AbortController.res +2 -0
- package/src/EventAPI/AbortSignal.res +2 -0
- package/src/EventAPI/Event.res +2 -0
- package/src/EventAPI/EventTarget.res +2 -0
- package/src/EventAPI/ExtendableEvent.res +2 -0
- package/src/Global.res +0 -10
- package/src/HistoryAPI/History.res +9 -6
- package/src/IndexedDBAPI/IDBFactory.res +8 -4
- package/src/IntersectionObserverAPI/IntersectionObserver.res +2 -0
- package/src/IntersectionObserverAPI/IntersectionObserverRoot.res +2 -0
- package/src/MutationObserverAPI/MutationObserver.res +2 -0
- package/src/PerformanceAPI/Performance.res +18 -17
- package/src/PermissionsAPI/Permissions.res +5 -1
- package/src/ResizeObserverAPI/ResizeObserver.res +2 -0
- package/src/ScreenWakeLockAPI/WakeLock.res +5 -1
- package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +10 -9
- package/src/ServiceWorkerAPI/ServiceWorkerGlobalScope.res +6 -2
- package/src/StorageAPI/StorageManager.res +8 -4
- package/src/UIEventsAPI/CompositionEvent.res +2 -0
- package/src/UIEventsAPI/DataTransfer.res +2 -0
- package/src/UIEventsAPI/DataTransferItem.res +2 -0
- package/src/UIEventsAPI/DataTransferItemList.res +2 -0
- package/src/UIEventsAPI/FocusEvent.res +2 -0
- package/src/UIEventsAPI/InputEvent.res +2 -0
- package/src/UIEventsAPI/KeyboardEvent.res +2 -0
- package/src/UIEventsAPI/MouseEvent.res +2 -0
- package/src/UIEventsAPI/PointerEvent.res +2 -0
- package/src/UIEventsAPI/Touch.res +2 -0
- package/src/UIEventsAPI/TouchEvent.res +2 -0
- package/src/UIEventsAPI/TouchList.res +2 -0
- package/src/UIEventsAPI/UIEvent.res +2 -0
- package/src/UIEventsAPI/WheelEvent.res +2 -0
- package/src/ViewTransitionsAPI/ViewTransition.res +2 -0
- package/src/WebCryptoAPI/Crypto.res +6 -2
- package/src/WebLocksAPI/LockManager.res +7 -4
- package/src/WebStorageAPI/Storage.res +11 -5
- package/src/WebWorkersAPI/SharedWorkerGlobalScope.res +3 -1
- package/src/WebWorkersAPI/WorkerGlobalScope.res +5 -1
package/package.json
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
open ClipboardTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = ClipboardTypes.clipboard = {...ClipboardTypes.clipboard}
|
|
4
|
+
|
|
5
|
+
external current: t = "clipboard"
|
|
6
|
+
|
|
7
|
+
include EventTarget.Impl({type t = t})
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read)
|
|
7
11
|
*/
|
|
8
12
|
@send
|
|
9
|
-
external read:
|
|
13
|
+
external read: t => promise<array<clipboardItem>> = "read"
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/readText)
|
|
13
17
|
*/
|
|
14
18
|
@send
|
|
15
|
-
external readText:
|
|
19
|
+
external readText: t => promise<string> = "readText"
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/write)
|
|
19
23
|
*/
|
|
20
24
|
@send
|
|
21
|
-
external write: (
|
|
25
|
+
external write: (t, array<clipboardItem>) => promise<unit> = "write"
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText)
|
|
25
29
|
*/
|
|
26
30
|
@send
|
|
27
|
-
external writeText: (
|
|
31
|
+
external writeText: (t, string) => promise<unit> = "writeText"
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
open CredentialManagementTypes
|
|
2
2
|
|
|
3
|
+
type t = CredentialManagementTypes.credentialsContainer = {
|
|
4
|
+
...CredentialManagementTypes.credentialsContainer,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
external current: t = "credentials"
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get)
|
|
5
11
|
*/
|
|
6
12
|
@send
|
|
7
|
-
external get: (
|
|
8
|
-
"get"
|
|
13
|
+
external get: (t, ~options: credentialRequestOptions=?) => promise<credential> = "get"
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store)
|
|
12
17
|
*/
|
|
13
18
|
@send
|
|
14
|
-
external store: (
|
|
19
|
+
external store: (t, credential) => promise<unit> = "store"
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create)
|
|
18
23
|
*/
|
|
19
24
|
@send
|
|
20
|
-
external create: (
|
|
21
|
-
credentialsContainer,
|
|
22
|
-
~options: credentialCreationOptions=?,
|
|
23
|
-
) => promise<credential> = "create"
|
|
25
|
+
external create: (t, ~options: credentialCreationOptions=?) => promise<credential> = "create"
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess)
|
|
27
29
|
*/
|
|
28
30
|
@send
|
|
29
|
-
external preventSilentAccess:
|
|
31
|
+
external preventSilentAccess: t => promise<unit> = "preventSilentAccess"
|
package/src/DOMAPI/Document.res
CHANGED
package/src/DOMAPI/Element.res
CHANGED
package/src/DOMAPI/Location.res
CHANGED
package/src/DOMAPI/Node.res
CHANGED
package/src/DOMAPI/Window.res
CHANGED
|
@@ -67,7 +67,7 @@ external clearInterval: (window, int) => unit = "clearInterval"
|
|
|
67
67
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask)
|
|
68
68
|
*/
|
|
69
69
|
@send
|
|
70
|
-
external queueMicrotask: (window,
|
|
70
|
+
external queueMicrotask: (window, unit => unit) => unit = "queueMicrotask"
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap)
|
package/src/EventAPI/Event.res
CHANGED
package/src/Global.res
CHANGED
|
@@ -13,11 +13,6 @@ open ChannelMessagingTypes
|
|
|
13
13
|
open FetchTypes
|
|
14
14
|
open EventTypes
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/window)
|
|
18
|
-
*/
|
|
19
|
-
external window: window = "window"
|
|
20
|
-
|
|
21
16
|
/**
|
|
22
17
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/self)
|
|
23
18
|
*/
|
|
@@ -124,11 +119,6 @@ external parent: window = "parent"
|
|
|
124
119
|
*/
|
|
125
120
|
external frameElement: element = "frameElement"
|
|
126
121
|
|
|
127
|
-
/**
|
|
128
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/navigator)
|
|
129
|
-
*/
|
|
130
|
-
external navigator: navigator = "navigator"
|
|
131
|
-
|
|
132
122
|
/**
|
|
133
123
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screen)
|
|
134
124
|
*/
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
open HistoryTypes
|
|
2
2
|
|
|
3
|
+
type t = HistoryTypes.history = {...HistoryTypes.history}
|
|
4
|
+
|
|
5
|
+
external current: t = "history"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/go)
|
|
5
9
|
*/
|
|
6
10
|
@send
|
|
7
|
-
external go: (
|
|
11
|
+
external go: (t, ~delta: int=?) => unit = "go"
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/back)
|
|
11
15
|
*/
|
|
12
16
|
@send
|
|
13
|
-
external back:
|
|
17
|
+
external back: t => unit = "back"
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/forward)
|
|
17
21
|
*/
|
|
18
22
|
@send
|
|
19
|
-
external forward:
|
|
23
|
+
external forward: t => unit = "forward"
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/pushState)
|
|
23
27
|
*/
|
|
24
28
|
@send
|
|
25
|
-
external pushState: (
|
|
29
|
+
external pushState: (t, ~data: JSON.t, ~unused: string, ~url: string=?) => unit = "pushState"
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/replaceState)
|
|
29
33
|
*/
|
|
30
34
|
@send
|
|
31
|
-
external replaceState: (
|
|
32
|
-
"replaceState"
|
|
35
|
+
external replaceState: (t, ~data: JSON.t, ~unused: string, ~url: string=?) => unit = "replaceState"
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
open IndexedDBTypes
|
|
2
2
|
|
|
3
|
+
type t = IndexedDBTypes.idbFactory = {...IndexedDBTypes.idbFactory}
|
|
4
|
+
|
|
5
|
+
external current: t = "indexedDB"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection.
|
|
5
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/open)
|
|
6
10
|
*/
|
|
7
11
|
@send
|
|
8
|
-
external open_: (
|
|
12
|
+
external open_: (t, ~name: string, ~version: int=?) => idbOpenDBRequest = "open"
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
15
|
Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null.
|
|
12
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/deleteDatabase)
|
|
13
17
|
*/
|
|
14
18
|
@send
|
|
15
|
-
external deleteDatabase: (
|
|
19
|
+
external deleteDatabase: (t, string) => idbOpenDBRequest = "deleteDatabase"
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/databases)
|
|
19
23
|
*/
|
|
20
24
|
@send
|
|
21
|
-
external databases:
|
|
25
|
+
external databases: t => promise<array<idbDatabaseInfo>> = "databases"
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.
|
|
@@ -27,4 +31,4 @@ Throws a "DataError" DOMException if either input is not a valid key.
|
|
|
27
31
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp)
|
|
28
32
|
*/
|
|
29
33
|
@send
|
|
30
|
-
external cmp: (
|
|
34
|
+
external cmp: (t, ~first: JSON.t, ~second: JSON.t) => int = "cmp"
|
|
@@ -1,72 +1,73 @@
|
|
|
1
1
|
open PerformanceTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = PerformanceTypes.performance = {...PerformanceTypes.performance}
|
|
4
|
+
|
|
5
|
+
external current: t = "performance"
|
|
6
|
+
|
|
7
|
+
include EventTarget.Impl({type t = t})
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/now)
|
|
7
11
|
*/
|
|
8
12
|
@send
|
|
9
|
-
external now:
|
|
13
|
+
external now: t => float = "now"
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
13
17
|
*/
|
|
14
18
|
@send
|
|
15
|
-
external toJSON:
|
|
19
|
+
external toJSON: t => Dict.t<string> = "toJSON"
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/getEntries)
|
|
19
23
|
*/
|
|
20
24
|
@send
|
|
21
|
-
external getEntries:
|
|
25
|
+
external getEntries: t => performanceEntryList = "getEntries"
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType)
|
|
25
29
|
*/
|
|
26
30
|
@send
|
|
27
|
-
external getEntriesByType: (
|
|
31
|
+
external getEntriesByType: (t, string) => performanceEntryList = "getEntriesByType"
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName)
|
|
31
35
|
*/
|
|
32
36
|
@send
|
|
33
|
-
external getEntriesByName: (
|
|
37
|
+
external getEntriesByName: (t, ~name: string, ~type_: string=?) => performanceEntryList =
|
|
34
38
|
"getEntriesByName"
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings)
|
|
38
42
|
*/
|
|
39
43
|
@send
|
|
40
|
-
external clearResourceTimings:
|
|
44
|
+
external clearResourceTimings: t => unit = "clearResourceTimings"
|
|
41
45
|
|
|
42
46
|
/**
|
|
43
47
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize)
|
|
44
48
|
*/
|
|
45
49
|
@send
|
|
46
|
-
external setResourceTimingBufferSize: (
|
|
50
|
+
external setResourceTimingBufferSize: (t, int) => unit = "setResourceTimingBufferSize"
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/mark)
|
|
50
54
|
*/
|
|
51
55
|
@send
|
|
52
|
-
external mark: (
|
|
53
|
-
|
|
54
|
-
~markName: string,
|
|
55
|
-
~markOptions: performanceMarkOptions=?,
|
|
56
|
-
) => performanceMark = "mark"
|
|
56
|
+
external mark: (t, ~markName: string, ~markOptions: performanceMarkOptions=?) => performanceMark =
|
|
57
|
+
"mark"
|
|
57
58
|
|
|
58
59
|
/**
|
|
59
60
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks)
|
|
60
61
|
*/
|
|
61
62
|
@send
|
|
62
|
-
external clearMarks: (
|
|
63
|
+
external clearMarks: (t, ~markName: string=?) => unit = "clearMarks"
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/measure)
|
|
66
67
|
*/
|
|
67
68
|
@send
|
|
68
69
|
external measure: (
|
|
69
|
-
|
|
70
|
+
t,
|
|
70
71
|
~measureName: string,
|
|
71
72
|
~startOrMeasureOptions: string=?,
|
|
72
73
|
~endMark: string=?,
|
|
@@ -77,7 +78,7 @@ external measure: (
|
|
|
77
78
|
*/
|
|
78
79
|
@send
|
|
79
80
|
external measureWithOptions: (
|
|
80
|
-
|
|
81
|
+
t,
|
|
81
82
|
~measureName: string,
|
|
82
83
|
~startOrMeasureOptions: performanceMeasureOptions=?,
|
|
83
84
|
~endMark: string=?,
|
|
@@ -87,4 +88,4 @@ external measureWithOptions: (
|
|
|
87
88
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures)
|
|
88
89
|
*/
|
|
89
90
|
@send
|
|
90
|
-
external clearMeasures: (
|
|
91
|
+
external clearMeasures: (t, ~measureName: string=?) => unit = "clearMeasures"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
open PermissionsTypes
|
|
2
2
|
|
|
3
|
+
type t = PermissionsTypes.permissions = {...PermissionsTypes.permissions}
|
|
4
|
+
|
|
5
|
+
external current: t = "permissions"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Permissions/query)
|
|
5
9
|
*/
|
|
6
10
|
@send
|
|
7
|
-
external query: (
|
|
11
|
+
external query: (t, permissionDescriptor) => promise<permissionStatus> = "query"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
open ScreenWakeLockTypes
|
|
2
2
|
|
|
3
|
+
type t = ScreenWakeLockTypes.wakeLock = {...ScreenWakeLockTypes.wakeLock}
|
|
4
|
+
|
|
5
|
+
external current: t = "wakeLock"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLock/request)
|
|
5
9
|
*/
|
|
6
10
|
@send
|
|
7
|
-
external request: (
|
|
11
|
+
external request: (t, ~type_: wakeLockType=?) => promise<wakeLockSentinel> = "request"
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
open ServiceWorkerTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = ServiceWorkerTypes.serviceWorkerContainer = {...ServiceWorkerTypes.serviceWorkerContainer}
|
|
4
|
+
|
|
5
|
+
external current: t = "serviceWorker"
|
|
6
|
+
|
|
7
|
+
include EventTarget.Impl({type t = t})
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerContainer/register)
|
|
7
11
|
*/
|
|
8
12
|
@send
|
|
9
13
|
external register: (
|
|
10
|
-
|
|
14
|
+
t,
|
|
11
15
|
string,
|
|
12
16
|
~options: registrationOptions=?,
|
|
13
17
|
) => promise<serviceWorkerRegistration> = "register"
|
|
@@ -16,20 +20,17 @@ external register: (
|
|
|
16
20
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerContainer/getRegistration)
|
|
17
21
|
*/
|
|
18
22
|
@send
|
|
19
|
-
external getRegistration: (
|
|
20
|
-
|
|
21
|
-
~clientURL: string=?,
|
|
22
|
-
) => Nullable.t<serviceWorkerRegistration> = "getRegistration"
|
|
23
|
+
external getRegistration: (t, ~clientURL: string=?) => Nullable.t<serviceWorkerRegistration> =
|
|
24
|
+
"getRegistration"
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerContainer/getRegistrations)
|
|
26
28
|
*/
|
|
27
29
|
@send
|
|
28
|
-
external getRegistrations:
|
|
29
|
-
"getRegistrations"
|
|
30
|
+
external getRegistrations: t => promise<array<serviceWorkerRegistration>> = "getRegistrations"
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerContainer/startMessages)
|
|
33
34
|
*/
|
|
34
35
|
@send
|
|
35
|
-
external startMessages:
|
|
36
|
+
external startMessages: t => unit = "startMessages"
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
open ServiceWorkerTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = ServiceWorkerTypes.serviceWorkerGlobalScope = {
|
|
4
|
+
...ServiceWorkerTypes.serviceWorkerGlobalScope,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
include WorkerGlobalScope.Impl({type t = t})
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
Forces the waiting service worker to become the active service worker.
|
|
7
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting)
|
|
8
12
|
*/
|
|
9
13
|
@send
|
|
10
|
-
external skipWaiting:
|
|
14
|
+
external skipWaiting: t => promise<unit> = "skipWaiting"
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
open StorageTypes
|
|
2
2
|
open FileTypes
|
|
3
3
|
|
|
4
|
+
type t = StorageTypes.storageManager = {...StorageTypes.storageManager}
|
|
5
|
+
|
|
6
|
+
external current: t = "storage"
|
|
7
|
+
|
|
4
8
|
/**
|
|
5
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StorageManager/persisted)
|
|
6
10
|
*/
|
|
7
11
|
@send
|
|
8
|
-
external persisted:
|
|
12
|
+
external persisted: t => promise<bool> = "persisted"
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
15
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StorageManager/persist)
|
|
12
16
|
*/
|
|
13
17
|
@send
|
|
14
|
-
external persist:
|
|
18
|
+
external persist: t => promise<bool> = "persist"
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StorageManager/estimate)
|
|
18
22
|
*/
|
|
19
23
|
@send
|
|
20
|
-
external estimate:
|
|
24
|
+
external estimate: t => promise<storageEstimate> = "estimate"
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StorageManager/getDirectory)
|
|
24
28
|
*/
|
|
25
29
|
@send
|
|
26
|
-
external getDirectory:
|
|
30
|
+
external getDirectory: t => promise<fileSystemDirectoryHandle> = "getDirectory"
|
|
@@ -2,6 +2,8 @@ open UIEventsTypes
|
|
|
2
2
|
open FileTypes
|
|
3
3
|
open FileAndDirectoryEntriesTypes
|
|
4
4
|
|
|
5
|
+
type t = dataTransferItem = {...dataTransferItem}
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
Invokes the callback with the string data as the argument, if the drag data item kind is text.
|
|
7
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsString)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
open UIEventsTypes
|
|
2
2
|
open FileTypes
|
|
3
3
|
|
|
4
|
+
type t = dataTransferItemList = {...dataTransferItemList}
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.
|
|
6
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add)
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
open WebCryptoTypes
|
|
2
2
|
|
|
3
|
+
type t = WebCryptoTypes.crypto = {...WebCryptoTypes.crypto}
|
|
4
|
+
|
|
5
|
+
external current: t = "crypto"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues)
|
|
5
9
|
*/
|
|
6
10
|
@send
|
|
7
|
-
external getRandomValues: (
|
|
11
|
+
external getRandomValues: (t, 't) => 't = "getRandomValues"
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
11
15
|
*/
|
|
12
16
|
@send
|
|
13
|
-
external randomUUID:
|
|
17
|
+
external randomUUID: t => string = "randomUUID"
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
open WebLocksTypes
|
|
2
2
|
|
|
3
|
+
type t = WebLocksTypes.lockManager = {...WebLocksTypes.lockManager}
|
|
4
|
+
|
|
5
|
+
external current: t = "locks"
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|
|
5
9
|
*/
|
|
6
10
|
@send
|
|
7
|
-
external request: (
|
|
8
|
-
"request"
|
|
11
|
+
external request: (t, ~name: string, ~callback: lockGrantedCallback) => promise<JSON.t> = "request"
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|
|
12
15
|
*/
|
|
13
16
|
@send
|
|
14
17
|
external requestWithOptions: (
|
|
15
|
-
|
|
18
|
+
t,
|
|
16
19
|
~name: string,
|
|
17
20
|
~options: lockOptions,
|
|
18
21
|
~callback: lockGrantedCallback,
|
|
@@ -22,4 +25,4 @@ external requestWithOptions: (
|
|
|
22
25
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/query)
|
|
23
26
|
*/
|
|
24
27
|
@send
|
|
25
|
-
external query:
|
|
28
|
+
external query: t => promise<lockManagerSnapshot> = "query"
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
open WebStorageTypes
|
|
2
2
|
|
|
3
|
+
type t = WebStorageTypes.storage = {...WebStorageTypes.storage}
|
|
4
|
+
|
|
5
|
+
external local: t = "localStorage"
|
|
6
|
+
|
|
7
|
+
external session: t = "sessionStorage"
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
|
5
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Storage/key)
|
|
6
12
|
*/
|
|
7
13
|
@send
|
|
8
|
-
external key: (
|
|
14
|
+
external key: (t, int) => Null.t<string> = "key"
|
|
9
15
|
|
|
10
16
|
/**
|
|
11
17
|
Returns the current value associated with the given key, or null if the given key does not exist.
|
|
12
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Storage/getItem)
|
|
13
19
|
*/
|
|
14
20
|
@send
|
|
15
|
-
external getItem: (
|
|
21
|
+
external getItem: (t, string) => Null.t<string> = "getItem"
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
|
@@ -23,7 +29,7 @@ Dispatches a storage event on Window objects holding an equivalent Storage objec
|
|
|
23
29
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Storage/setItem)
|
|
24
30
|
*/
|
|
25
31
|
@send
|
|
26
|
-
external setItem: (
|
|
32
|
+
external setItem: (t, ~key: string, ~value: string) => unit = "setItem"
|
|
27
33
|
|
|
28
34
|
/**
|
|
29
35
|
Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
|
@@ -32,7 +38,7 @@ Dispatches a storage event on Window objects holding an equivalent Storage objec
|
|
|
32
38
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Storage/removeItem)
|
|
33
39
|
*/
|
|
34
40
|
@send
|
|
35
|
-
external removeItem: (
|
|
41
|
+
external removeItem: (t, string) => unit = "removeItem"
|
|
36
42
|
|
|
37
43
|
/**
|
|
38
44
|
Removes all key/value pairs, if there are any.
|
|
@@ -41,4 +47,4 @@ Dispatches a storage event on Window objects holding an equivalent Storage objec
|
|
|
41
47
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Storage/clear)
|
|
42
48
|
*/
|
|
43
49
|
@send
|
|
44
|
-
external clear:
|
|
50
|
+
external clear: t => unit = "clear"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
open WebWorkersTypes
|
|
2
2
|
|
|
3
|
+
type t = WebWorkersTypes.sharedWorkerGlobalScope = {...WebWorkersTypes.sharedWorkerGlobalScope}
|
|
4
|
+
|
|
3
5
|
module Impl = (
|
|
4
6
|
T: {
|
|
5
7
|
type t
|
|
@@ -24,4 +26,4 @@ self -> SharedWorkerGlobalScope.close
|
|
|
24
26
|
external close: T.t => unit = "close"
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
include Impl({type t =
|
|
29
|
+
include Impl({type t = t})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
open WebWorkersTypes
|
|
2
2
|
open FetchTypes
|
|
3
3
|
|
|
4
|
+
type t = WebWorkersTypes.workerGlobalScope = {...WebWorkersTypes.workerGlobalScope}
|
|
5
|
+
|
|
4
6
|
module Impl = (
|
|
5
7
|
T: {
|
|
6
8
|
type t
|
|
@@ -8,6 +10,8 @@ module Impl = (
|
|
|
8
10
|
) => {
|
|
9
11
|
include EventTarget.Impl({type t = T.t})
|
|
10
12
|
|
|
13
|
+
external current: T.t = "self"
|
|
14
|
+
|
|
11
15
|
/**
|
|
12
16
|
`fetch(workerGlobalScope, string, init)`
|
|
13
17
|
|
|
@@ -38,4 +42,4 @@ let response = await self->WorkerGlobalScope.fetch(myRequest)
|
|
|
38
42
|
external fetchWithRequest: (T.t, request, ~init: requestInit=?) => promise<response> = "fetch"
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
include Impl({type t =
|
|
45
|
+
include Impl({type t = t})
|