@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
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = CSSFontLoadingTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.fontFace = {...Types.fontFace}
|
|
4
|
+
type fontDisplay = Types.fontDisplay
|
|
5
|
+
type fontFaceLoadStatus = Types.fontFaceLoadStatus
|
|
6
|
+
type fontFaceDescriptors = Types.fontFaceDescriptors = {...Types.fontFaceDescriptors}
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
|
|
5
10
|
*/
|
|
6
11
|
@new
|
|
7
|
-
external make: (~family: string, ~source: string, ~descriptors: fontFaceDescriptors=?) =>
|
|
12
|
+
external make: (~family: string, ~source: string, ~descriptors: fontFaceDescriptors=?) => t =
|
|
8
13
|
"FontFace"
|
|
9
14
|
|
|
10
15
|
/**
|
|
@@ -15,7 +20,7 @@ external fromDataView: (
|
|
|
15
20
|
~family: string,
|
|
16
21
|
~source: DataView.t,
|
|
17
22
|
~descriptors: fontFaceDescriptors=?,
|
|
18
|
-
) =>
|
|
23
|
+
) => t = "FontFace"
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
|
|
@@ -25,10 +30,10 @@ external fromArrayBuffer: (
|
|
|
25
30
|
~family: string,
|
|
26
31
|
~source: ArrayBuffer.t,
|
|
27
32
|
~descriptors: fontFaceDescriptors=?,
|
|
28
|
-
) =>
|
|
33
|
+
) => t = "FontFace"
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
36
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace/load)
|
|
32
37
|
*/
|
|
33
38
|
@send
|
|
34
|
-
external load:
|
|
39
|
+
external load: t => promise<t> = "load"
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = CSSFontLoadingTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = Types.fontFaceSet = {...Types.fontFaceSet}
|
|
4
|
+
type fontFace = Types.fontFace = {...Types.fontFace}
|
|
5
|
+
type fontFaceSetLoadStatus = Types.fontFaceSetLoadStatus
|
|
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/FontFaceSet/add)
|
|
7
11
|
*/
|
|
8
12
|
@send
|
|
9
|
-
external add: (
|
|
13
|
+
external add: (t, fontFace) => t = "add"
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/delete)
|
|
13
17
|
*/
|
|
14
18
|
@send
|
|
15
|
-
external delete: (
|
|
19
|
+
external delete: (t, fontFace) => bool = "delete"
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/clear)
|
|
19
23
|
*/
|
|
20
24
|
@send
|
|
21
|
-
external clear:
|
|
25
|
+
external clear: t => unit = "clear"
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load)
|
|
25
29
|
*/
|
|
26
30
|
@send
|
|
27
|
-
external load: (
|
|
31
|
+
external load: (t, ~font: string, ~text: string=?) => promise<array<fontFace>> = "load"
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check)
|
|
31
35
|
*/
|
|
32
36
|
@send
|
|
33
|
-
external check: (
|
|
37
|
+
external check: (t, ~font: string, ~text: string=?) => bool = "check"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = CanvasTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.canvasGradient = {...Types.canvasGradient}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.
|
|
@@ -7,6 +9,6 @@ Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a
|
|
|
7
9
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasGradient/addColorStop)
|
|
8
10
|
*/
|
|
9
11
|
@send
|
|
10
|
-
external addColorStop: (
|
|
12
|
+
external addColorStop: (t, ~offset: float, ~color: string) => unit = "addColorStop"
|
|
11
13
|
|
|
12
14
|
let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasGradient`)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
module Types = CanvasTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.canvasPattern = {...Types.canvasPattern}
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.
|
|
6
7
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform)
|
|
7
8
|
*/
|
|
8
9
|
@send
|
|
9
|
-
external setTransform: (
|
|
10
|
+
external setTransform: (t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "setTransform"
|
|
10
11
|
|
|
11
12
|
let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasPattern`)
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
open Prelude
|
|
2
|
-
open CanvasTypes
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
module Types = CanvasTypes
|
|
4
|
+
|
|
5
|
+
type t = Types.fillStyle
|
|
6
|
+
type canvasGradient = Types.canvasGradient = {...Types.canvasGradient}
|
|
7
|
+
type canvasPattern = Types.canvasPattern = {...Types.canvasPattern}
|
|
8
|
+
|
|
9
|
+
external fromString: string => t = "%identity"
|
|
10
|
+
external fromCanvasGradient: canvasGradient => t = "%identity"
|
|
11
|
+
external fromCanvasPattern: canvasPattern => t = "%identity"
|
|
7
12
|
|
|
8
13
|
/**
|
|
9
14
|
Represents a decoded version of the abstract `fillStyle` type, used in Context2D.
|
|
@@ -13,12 +18,12 @@ type decoded =
|
|
|
13
18
|
| CanvasGradient(canvasGradient)
|
|
14
19
|
| CanvasPattern(canvasPattern)
|
|
15
20
|
|
|
16
|
-
let decode = (
|
|
17
|
-
if CanvasGradient.isInstanceOf(
|
|
18
|
-
CanvasGradient(unsafeConversation(
|
|
19
|
-
} else if CanvasPattern.isInstanceOf(
|
|
20
|
-
CanvasPattern(unsafeConversation(
|
|
21
|
+
let decode = (value: t): decoded => {
|
|
22
|
+
if CanvasGradient.isInstanceOf(value) {
|
|
23
|
+
CanvasGradient(unsafeConversation(value))
|
|
24
|
+
} else if CanvasPattern.isInstanceOf(value) {
|
|
25
|
+
CanvasPattern(unsafeConversation(value))
|
|
21
26
|
} else {
|
|
22
|
-
String(unsafeConversation(
|
|
27
|
+
String(unsafeConversation(value))
|
|
23
28
|
}
|
|
24
29
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = CanvasTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.imageBitmap = {...Types.imageBitmap}
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
Releases imageBitmap's underlying bitmap data.
|
|
5
7
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageBitmap/close)
|
|
6
8
|
*/
|
|
7
9
|
@send
|
|
8
|
-
external close:
|
|
10
|
+
external close: t => unit = "close"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = CanvasTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.imageBitmapRenderingContext = {...Types.imageBitmapRenderingContext}
|
|
4
|
+
type imageBitmap = Types.imageBitmap = {...Types.imageBitmap}
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.
|
|
5
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageBitmapRenderingContext/transferFromImageBitmap)
|
|
6
9
|
*/
|
|
7
10
|
@send
|
|
8
|
-
external transferFromImageBitmap: (
|
|
9
|
-
"transferFromImageBitmap"
|
|
11
|
+
external transferFromImageBitmap: (t, imageBitmap) => unit = "transferFromImageBitmap"
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
open FileTypes
|
|
1
|
+
module Types = CanvasTypes
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas)
|
|
6
5
|
*/
|
|
7
6
|
@new
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
type t = Types.offscreenCanvas = {...Types.offscreenCanvas}
|
|
8
|
+
type imageBitmap = Types.imageBitmap = {...Types.imageBitmap}
|
|
9
|
+
type offscreenCanvasRenderingContext2D = Types.offscreenCanvasRenderingContext2D = {
|
|
10
|
+
...Types.offscreenCanvasRenderingContext2D,
|
|
11
|
+
}
|
|
12
|
+
type webGLRenderingContext = Types.webGLRenderingContext = {...Types.webGLRenderingContext}
|
|
13
|
+
type webGL2RenderingContext = Types.webGL2RenderingContext = {...Types.webGL2RenderingContext}
|
|
14
|
+
type webGLContextAttributes = Types.webGLContextAttributes = {...Types.webGLContextAttributes}
|
|
15
|
+
type imageBitmapRenderingContext = Types.imageBitmapRenderingContext = {
|
|
16
|
+
...Types.imageBitmapRenderingContext,
|
|
17
|
+
}
|
|
18
|
+
type imageBitmapRenderingContextSettings = Types.imageBitmapRenderingContextSettings = {
|
|
19
|
+
...Types.imageBitmapRenderingContextSettings,
|
|
20
|
+
}
|
|
21
|
+
type imageEncodeOptions = Types.imageEncodeOptions = {...Types.imageEncodeOptions}
|
|
22
|
+
|
|
23
|
+
external make: (~width: int, ~height: int) => t = "OffscreenCanvas"
|
|
24
|
+
|
|
25
|
+
include EventTarget.Impl({type t = t})
|
|
11
26
|
|
|
12
27
|
/**
|
|
13
28
|
Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
|
|
@@ -18,11 +33,8 @@ Returns null if the canvas has already been initialized with another context typ
|
|
|
18
33
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/getContext)
|
|
19
34
|
*/
|
|
20
35
|
@send
|
|
21
|
-
external getContext2D: (
|
|
22
|
-
|
|
23
|
-
@as("2d") _,
|
|
24
|
-
~options: JSON.t=?,
|
|
25
|
-
) => offscreenCanvasRenderingContext2D = "getContext"
|
|
36
|
+
external getContext2D: (t, @as("2d") _, ~options: JSON.t=?) => offscreenCanvasRenderingContext2D =
|
|
37
|
+
"getContext"
|
|
26
38
|
|
|
27
39
|
/**
|
|
28
40
|
Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
|
|
@@ -34,7 +46,7 @@ Returns null if the canvas has already been initialized with another context typ
|
|
|
34
46
|
*/
|
|
35
47
|
@send
|
|
36
48
|
external getContextWebGL: (
|
|
37
|
-
|
|
49
|
+
t,
|
|
38
50
|
@as("webgl") _,
|
|
39
51
|
~options: webGLContextAttributes=?,
|
|
40
52
|
) => webGLRenderingContext = "getContext"
|
|
@@ -49,7 +61,7 @@ Returns null if the canvas has already been initialized with another context typ
|
|
|
49
61
|
*/
|
|
50
62
|
@send
|
|
51
63
|
external getContextWebGL2: (
|
|
52
|
-
|
|
64
|
+
t,
|
|
53
65
|
@as("webgl2") _,
|
|
54
66
|
~options: webGLContextAttributes=?,
|
|
55
67
|
) => webGL2RenderingContext = "getContext"
|
|
@@ -64,7 +76,7 @@ Returns null if the canvas has already been initialized with another context typ
|
|
|
64
76
|
*/
|
|
65
77
|
@send
|
|
66
78
|
external getContextBitmapRenderer: (
|
|
67
|
-
|
|
79
|
+
t,
|
|
68
80
|
@as("bitmaprenderer") _,
|
|
69
81
|
~options: imageBitmapRenderingContextSettings=?,
|
|
70
82
|
) => imageBitmapRenderingContext = "getContext"
|
|
@@ -74,7 +86,7 @@ Returns a newly created ImageBitmap object with the image in the OffscreenCanvas
|
|
|
74
86
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/transferToImageBitmap)
|
|
75
87
|
*/
|
|
76
88
|
@send
|
|
77
|
-
external transferToImageBitmap:
|
|
89
|
+
external transferToImageBitmap: t => imageBitmap = "transferToImageBitmap"
|
|
78
90
|
|
|
79
91
|
/**
|
|
80
92
|
Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.
|
|
@@ -83,5 +95,5 @@ The argument, if provided, is a dictionary that controls the encoding options of
|
|
|
83
95
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/convertToBlob)
|
|
84
96
|
*/
|
|
85
97
|
@send
|
|
86
|
-
external convertToBlob: (
|
|
98
|
+
external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<FileTypes.blob> =
|
|
87
99
|
"convertToBlob"
|
package/src/CanvasAPI/Path2D.res
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
module Types = CanvasTypes
|
|
2
|
+
|
|
3
|
+
type t = Types.path2D = {...Types.path2D}
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
|
|
6
7
|
*/
|
|
7
8
|
@new
|
|
8
|
-
external make: (~path:
|
|
9
|
+
external make: (~path: t=?) => t = "Path2D"
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D)
|
|
12
13
|
*/
|
|
13
14
|
@new
|
|
14
|
-
external fromString: (~path: string=?) =>
|
|
15
|
+
external fromString: (~path: string=?) => t = "Path2D"
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath)
|
|
18
19
|
*/
|
|
19
20
|
@send
|
|
20
|
-
external closePath:
|
|
21
|
+
external closePath: t => unit = "closePath"
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo)
|
|
24
25
|
*/
|
|
25
26
|
@send
|
|
26
|
-
external moveTo: (
|
|
27
|
+
external moveTo: (t, ~x: float, ~y: float) => unit = "moveTo"
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo)
|
|
30
31
|
*/
|
|
31
32
|
@send
|
|
32
|
-
external lineTo: (
|
|
33
|
+
external lineTo: (t, ~x: float, ~y: float) => unit = "lineTo"
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo)
|
|
36
37
|
*/
|
|
37
38
|
@send
|
|
38
|
-
external quadraticCurveTo: (
|
|
39
|
+
external quadraticCurveTo: (t, ~cpx: float, ~cpy: float, ~x: float, ~y: float) => unit =
|
|
39
40
|
"quadraticCurveTo"
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -43,7 +44,7 @@ external quadraticCurveTo: (path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: flo
|
|
|
43
44
|
*/
|
|
44
45
|
@send
|
|
45
46
|
external bezierCurveTo: (
|
|
46
|
-
|
|
47
|
+
t,
|
|
47
48
|
~cp1x: float,
|
|
48
49
|
~cp1y: float,
|
|
49
50
|
~cp2x: float,
|
|
@@ -56,21 +57,21 @@ external bezierCurveTo: (
|
|
|
56
57
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo)
|
|
57
58
|
*/
|
|
58
59
|
@send
|
|
59
|
-
external arcTo: (
|
|
60
|
+
external arcTo: (t, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float) => unit =
|
|
60
61
|
"arcTo"
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect)
|
|
64
65
|
*/
|
|
65
66
|
@send
|
|
66
|
-
external rect: (
|
|
67
|
+
external rect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect"
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect)
|
|
70
71
|
*/
|
|
71
72
|
@send
|
|
72
73
|
external roundRect: (
|
|
73
|
-
|
|
74
|
+
t,
|
|
74
75
|
~x: float,
|
|
75
76
|
~y: float,
|
|
76
77
|
~w: float,
|
|
@@ -83,7 +84,7 @@ external roundRect: (
|
|
|
83
84
|
*/
|
|
84
85
|
@send
|
|
85
86
|
external arc: (
|
|
86
|
-
|
|
87
|
+
t,
|
|
87
88
|
~x: float,
|
|
88
89
|
~y: float,
|
|
89
90
|
~radius: float,
|
|
@@ -97,7 +98,7 @@ external arc: (
|
|
|
97
98
|
*/
|
|
98
99
|
@send
|
|
99
100
|
external ellipse: (
|
|
100
|
-
|
|
101
|
+
t,
|
|
101
102
|
~x: float,
|
|
102
103
|
~y: float,
|
|
103
104
|
~radiusX: float,
|
|
@@ -113,4 +114,4 @@ Adds to the path the path given by the argument.
|
|
|
113
114
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D/addPath)
|
|
114
115
|
*/
|
|
115
116
|
@send
|
|
116
|
-
external addPath: (
|
|
117
|
+
external addPath: (t, ~path: t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "addPath"
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
module Types = ChannelMessagingTypes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type t = Types.messagePort = {...Types.messagePort}
|
|
4
|
+
type structuredSerializeOptions = Types.structuredSerializeOptions = {
|
|
5
|
+
...Types.structuredSerializeOptions,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
include EventTarget.Impl({type t = t})
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
|
|
@@ -9,7 +14,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
|
|
|
9
14
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
|
10
15
|
*/
|
|
11
16
|
@send
|
|
12
|
-
external postMessage: (
|
|
17
|
+
external postMessage: (t, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
|
|
13
18
|
"postMessage"
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -20,7 +25,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or
|
|
|
20
25
|
*/
|
|
21
26
|
@send
|
|
22
27
|
external postMessageWithOptions: (
|
|
23
|
-
|
|
28
|
+
t,
|
|
24
29
|
~message: JSON.t,
|
|
25
30
|
~options: structuredSerializeOptions=?,
|
|
26
31
|
) => unit = "postMessage"
|
|
@@ -30,11 +35,11 @@ Begins dispatching messages received on the port.
|
|
|
30
35
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
|
31
36
|
*/
|
|
32
37
|
@send
|
|
33
|
-
external start:
|
|
38
|
+
external start: t => unit = "start"
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
Disconnects the port, so that it is no longer active.
|
|
37
42
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
|
38
43
|
*/
|
|
39
44
|
@send
|
|
40
|
-
external close:
|
|
45
|
+
external close: t => unit = "close"
|
|
@@ -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"
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
open FetchTypes
|
|
3
|
-
open URLTypes
|
|
1
|
+
module Types = FetchTypes
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
7
5
|
*/
|
|
8
|
-
|
|
6
|
+
type t = Types.bodyInit
|
|
7
|
+
|
|
8
|
+
external fromString: string => t = "%identity"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
12
12
|
*/
|
|
13
|
-
external fromArrayBuffer: ArrayBuffer.t =>
|
|
13
|
+
external fromArrayBuffer: ArrayBuffer.t => t = "%identity"
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
17
17
|
*/
|
|
18
|
-
external fromTypedArray: TypedArray.t<'t> =>
|
|
18
|
+
external fromTypedArray: TypedArray.t<'t> => t = "%identity"
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
22
22
|
*/
|
|
23
|
-
external fromDataView: DataView.t =>
|
|
23
|
+
external fromDataView: DataView.t => t = "%identity"
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
27
27
|
*/
|
|
28
|
-
external fromBlob: blob =>
|
|
28
|
+
external fromBlob: FileTypes.blob => t = "%identity"
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
32
32
|
*/
|
|
33
|
-
external fromFile: file =>
|
|
33
|
+
external fromFile: FileTypes.file => t = "%identity"
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
37
37
|
*/
|
|
38
|
-
external fromURLSearchParams: urlSearchParams =>
|
|
38
|
+
external fromURLSearchParams: URLTypes.urlSearchParams => t = "%identity"
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
42
42
|
*/
|
|
43
|
-
external fromFormData: formData =>
|
|
43
|
+
external fromFormData: Types.formData => t = "%identity"
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body)
|
|
47
47
|
*/
|
|
48
|
-
external fromReadableStream: readableStream<'t> =>
|
|
48
|
+
external fromReadableStream: FileTypes.readableStream<'t> => t = "%identity"
|