@rescript/webapi 0.1.0-pre-alpha-02fb350 → 0.1.0-pre-alpha-4542085
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/CSSFontLoadingAPI/FontFace.res +10 -5
- package/src/CSSFontLoadingAPI/FontFaceSet.res +11 -7
- package/src/CanvasAPI/CanvasGradient.res +4 -2
- package/src/CanvasAPI/CanvasPattern.res +4 -3
- package/src/CanvasAPI/FillStyle.res +15 -10
- package/src/CanvasAPI/ImageBitmap.res +4 -2
- package/src/CanvasAPI/ImageBitmapRenderingContext.res +5 -3
- package/src/CanvasAPI/OffscreenCanvas.res +27 -15
- package/src/CanvasAPI/Path2D.res +16 -15
- package/src/ChannelMessagingAPI/MessagePort.res +11 -6
- package/src/ClipboardAPI/Clipboard.res +9 -5
- package/src/CredentialManagementAPI/CredentialsContainer.res +10 -8
- package/src/FetchAPI/BodyInit.res +12 -12
- package/src/FetchAPI/FormData.res +18 -15
- package/src/FetchAPI/FormDataEntryValue.res +11 -9
- package/src/FetchAPI/Headers.res +14 -12
- package/src/FetchAPI/HeadersInit.res +6 -4
- package/src/FetchAPI/Request.res +16 -12
- package/src/FetchAPI/Response.res +27 -24
- package/src/FileAPI/Blob.res +10 -5
- package/src/FileAPI/File.res +8 -7
- package/src/FileAPI/FileSystemDirectoryHandle.res +18 -13
- package/src/FileAPI/FileSystemFileHandle.res +15 -5
- package/src/FileAPI/FileSystemHandle.res +4 -2
- package/src/FileAPI/ReadableStream.res +20 -10
- package/src/FileAPI/WritableStream.res +11 -8
- package/src/FileAPI/WritableStreamDefaultController.res +4 -2
- package/src/Global.res +0 -10
- package/src/HistoryAPI/History.res +9 -6
- package/src/IndexedDBAPI/IDBFactory.res +8 -4
- package/src/PerformanceAPI/Performance.res +18 -17
- package/src/PermissionsAPI/Permissions.res +5 -1
- 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/URLAPI/URL.res +6 -4
- package/src/URLAPI/URLSearchParams.res +18 -16
- package/src/WebCryptoAPI/Crypto.res +6 -2
- package/src/WebLocksAPI/LockManager.res +7 -4
- package/src/WebSocketsAPI/CloseEvent.res +6 -3
- package/src/WebSocketsAPI/MessageEvent.res +10 -9
- package/src/WebSocketsAPI/WebSocket.res +15 -10
- package/src/WebStorageAPI/Storage.res +11 -5
- package/src/WebWorkersAPI/SharedWorkerGlobalScope.res +3 -1
- package/src/WebWorkersAPI/WorkerGlobalScope.res +5 -1
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = FileTypes
|
|
2
|
+
|
|
3
|
+
type t<'r> = Types.readableStream<'r> = {...Types.readableStream<'r>}
|
|
4
|
+
type readableStreamReaderMode = Types.readableStreamReaderMode
|
|
5
|
+
type readableStreamGetReaderOptions = Types.readableStreamGetReaderOptions = {
|
|
6
|
+
...Types.readableStreamGetReaderOptions,
|
|
7
|
+
}
|
|
8
|
+
type readableWritablePair<'r, 'w> = Types.readableWritablePair<'r, 'w> = {
|
|
9
|
+
...Types.readableWritablePair<'r, 'w>,
|
|
10
|
+
}
|
|
11
|
+
type streamPipeOptions = Types.streamPipeOptions = {...Types.streamPipeOptions}
|
|
2
12
|
|
|
3
13
|
/**
|
|
4
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream)
|
|
5
15
|
*/
|
|
6
16
|
@new
|
|
7
|
-
external make: unit =>
|
|
17
|
+
external make: unit => t<array<int>> = "ReadableStream"
|
|
8
18
|
|
|
9
19
|
/**
|
|
10
20
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/cancel)
|
|
11
21
|
*/
|
|
12
22
|
@send
|
|
13
|
-
external cancel: (
|
|
23
|
+
external cancel: (t<'r>, ~reason: JSON.t=?) => promise<unit> = "cancel"
|
|
14
24
|
|
|
15
25
|
/**
|
|
16
26
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
|
|
17
27
|
*/
|
|
18
28
|
@send
|
|
19
29
|
external getReader: (
|
|
20
|
-
|
|
30
|
+
t<'r>,
|
|
21
31
|
~options: readableStreamGetReaderOptions=?,
|
|
22
|
-
) => readableStreamReader<'r> = "getReader"
|
|
32
|
+
) => Types.readableStreamReader<'r> = "getReader"
|
|
23
33
|
|
|
24
34
|
/**
|
|
25
35
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeThrough)
|
|
26
36
|
*/
|
|
27
37
|
@send
|
|
28
38
|
external pipeThrough: (
|
|
29
|
-
|
|
39
|
+
t<'r>,
|
|
30
40
|
~transform: readableWritablePair<'t, 'r>,
|
|
31
41
|
~options: streamPipeOptions=?,
|
|
32
|
-
) =>
|
|
42
|
+
) => t<'t> = "pipeThrough"
|
|
33
43
|
|
|
34
44
|
/**
|
|
35
45
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/pipeTo)
|
|
36
46
|
*/
|
|
37
47
|
@send
|
|
38
48
|
external pipeTo: (
|
|
39
|
-
|
|
40
|
-
~destination:
|
|
49
|
+
t<'r>,
|
|
50
|
+
~destination: WritableStream.t<'r>,
|
|
41
51
|
~options: streamPipeOptions=?,
|
|
42
52
|
) => promise<unit> = "pipeTo"
|
|
43
53
|
|
|
@@ -45,4 +55,4 @@ external pipeTo: (
|
|
|
45
55
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ReadableStream/tee)
|
|
46
56
|
*/
|
|
47
57
|
@send
|
|
48
|
-
external tee:
|
|
58
|
+
external tee: t<'r> => array<t<unit>> = "tee"
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = FileTypes
|
|
2
|
+
|
|
3
|
+
type t<'w> = Types.writableStream<'w> = {...Types.writableStream<'w>}
|
|
4
|
+
type queuingStrategy<'t> = Types.queuingStrategy<'t>
|
|
5
|
+
type underlyingSink<'t> = Types.underlyingSink<'t>
|
|
6
|
+
type writableStreamDefaultWriter<'t> = Types.writableStreamDefaultWriter<'t>
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream)
|
|
5
10
|
*/
|
|
6
11
|
@new
|
|
7
|
-
external make: (
|
|
8
|
-
|
|
9
|
-
~strategy: queuingStrategy<'w>=?,
|
|
10
|
-
) => writableStream<'w> = "WritableStream"
|
|
12
|
+
external make: (~underlyingSink: underlyingSink<'w>=?, ~strategy: queuingStrategy<'w>=?) => t<'w> =
|
|
13
|
+
"WritableStream"
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/abort)
|
|
14
17
|
*/
|
|
15
18
|
@send
|
|
16
|
-
external abort: (
|
|
19
|
+
external abort: (t<'w>, ~reason: JSON.t=?) => promise<unit> = "abort"
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/close)
|
|
20
23
|
*/
|
|
21
24
|
@send
|
|
22
|
-
external close:
|
|
25
|
+
external close: t<'w> => promise<unit> = "close"
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
|
|
26
29
|
*/
|
|
27
30
|
@send
|
|
28
|
-
external getWriter:
|
|
31
|
+
external getWriter: t<'w> => writableStreamDefaultWriter<'w> = "getWriter"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = FileTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.writableStreamDefaultController = {...Types.writableStreamDefaultController}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultController/error)
|
|
5
7
|
*/
|
|
6
8
|
@send
|
|
7
|
-
external error: (
|
|
9
|
+
external error: (t, ~e: JSON.t=?) => unit = "error"
|
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"
|
package/src/URLAPI/URL.res
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = URLTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.url = {...Types.url}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL)
|
|
5
7
|
*/
|
|
6
8
|
@new
|
|
7
|
-
external make: (~url: string, ~base: string=?) =>
|
|
9
|
+
external make: (~url: string, ~base: string=?) => t = "URL"
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/parse_static)
|
|
11
13
|
*/
|
|
12
14
|
@scope("URL")
|
|
13
|
-
external parse: (~url: string, ~base: string=?) =>
|
|
15
|
+
external parse: (~url: string, ~base: string=?) => t = "parse"
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/canParse_static)
|
|
@@ -22,7 +24,7 @@ external canParse: (~url: string, ~base: string=?) => bool = "canParse"
|
|
|
22
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
|
23
25
|
*/
|
|
24
26
|
@send
|
|
25
|
-
external toJSON:
|
|
27
|
+
external toJSON: t => string = "toJSON"
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
|
@@ -1,101 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = URLTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.urlSearchParams = {...Types.urlSearchParams}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
5
7
|
*/
|
|
6
8
|
@new
|
|
7
|
-
external make: unit =>
|
|
9
|
+
external make: unit => t = "URLSearchParams"
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
11
13
|
*/
|
|
12
14
|
@new
|
|
13
|
-
external fromKeyValueArray: array<(string, string)> =>
|
|
15
|
+
external fromKeyValueArray: array<(string, string)> => t = "URLSearchParams"
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
17
19
|
*/
|
|
18
20
|
@new
|
|
19
|
-
external fromDict: dict<string> =>
|
|
21
|
+
external fromDict: dict<string> => t = "URLSearchParams"
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
23
25
|
*/
|
|
24
26
|
@new
|
|
25
|
-
external fromString: string =>
|
|
27
|
+
external fromString: string => t = "URLSearchParams"
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
Appends a specified key/value pair as a new search parameter.
|
|
29
31
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
30
32
|
*/
|
|
31
33
|
@send
|
|
32
|
-
external append: (
|
|
34
|
+
external append: (t, ~name: string, ~value: string) => unit = "append"
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
36
38
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
37
39
|
*/
|
|
38
40
|
@send
|
|
39
|
-
external delete: (
|
|
41
|
+
external delete: (t, ~name: string, ~value: string=?) => unit = "delete"
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
Returns key/value pairs in the same order as they appear in the query string.
|
|
43
45
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/entries)
|
|
44
46
|
*/
|
|
45
47
|
@send
|
|
46
|
-
external entries:
|
|
48
|
+
external entries: t => Iterator.t<(string, string)> = "entries"
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
Returns the first value associated to the given search parameter.
|
|
50
52
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
51
53
|
*/
|
|
52
54
|
@send
|
|
53
|
-
external get: (
|
|
55
|
+
external get: (t, string) => null<string> = "get"
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
Returns all the values association with a given search parameter.
|
|
57
59
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
58
60
|
*/
|
|
59
61
|
@send
|
|
60
|
-
external getAll: (
|
|
62
|
+
external getAll: (t, string) => array<string> = "getAll"
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
Returns a Boolean indicating if such a search parameter exists.
|
|
64
66
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
65
67
|
*/
|
|
66
68
|
@send
|
|
67
|
-
external has: (
|
|
69
|
+
external has: (t, ~name: string, ~value: string=?) => bool = "has"
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
Returns an iterator allowing iteration through all keys contained in this object.
|
|
71
73
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/keys)
|
|
72
74
|
*/
|
|
73
75
|
@send
|
|
74
|
-
external keys:
|
|
76
|
+
external keys: t => Iterator.t<string> = "keys"
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
79
|
Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
78
80
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
79
81
|
*/
|
|
80
82
|
@send
|
|
81
|
-
external set: (
|
|
83
|
+
external set: (t, ~name: string, ~value: string) => unit = "set"
|
|
82
84
|
|
|
83
85
|
/**
|
|
84
86
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
|
85
87
|
*/
|
|
86
88
|
@send
|
|
87
|
-
external sort:
|
|
89
|
+
external sort: t => unit = "sort"
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
Returns the query string suitable for use in a URL, without the question mark.
|
|
91
93
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/toString)
|
|
92
94
|
*/
|
|
93
95
|
@send
|
|
94
|
-
external toString:
|
|
96
|
+
external toString: t => string = "toString"
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
99
|
Returns an iterator allowing iteration through all values contained in this object.
|
|
98
100
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams/values)
|
|
99
101
|
*/
|
|
100
102
|
@send
|
|
101
|
-
external values:
|
|
103
|
+
external values: t => Iterator.t<string> = "values"
|
|
@@ -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"
|