@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.
Files changed (47) hide show
  1. package/package.json +1 -1
  2. package/src/CSSFontLoadingAPI/FontFace.res +10 -5
  3. package/src/CSSFontLoadingAPI/FontFaceSet.res +11 -7
  4. package/src/CanvasAPI/CanvasGradient.res +4 -2
  5. package/src/CanvasAPI/CanvasPattern.res +4 -3
  6. package/src/CanvasAPI/FillStyle.res +15 -10
  7. package/src/CanvasAPI/ImageBitmap.res +4 -2
  8. package/src/CanvasAPI/ImageBitmapRenderingContext.res +5 -3
  9. package/src/CanvasAPI/OffscreenCanvas.res +27 -15
  10. package/src/CanvasAPI/Path2D.res +16 -15
  11. package/src/ChannelMessagingAPI/MessagePort.res +11 -6
  12. package/src/ClipboardAPI/Clipboard.res +9 -5
  13. package/src/CredentialManagementAPI/CredentialsContainer.res +10 -8
  14. package/src/FetchAPI/BodyInit.res +12 -12
  15. package/src/FetchAPI/FormData.res +18 -15
  16. package/src/FetchAPI/FormDataEntryValue.res +11 -9
  17. package/src/FetchAPI/Headers.res +14 -12
  18. package/src/FetchAPI/HeadersInit.res +6 -4
  19. package/src/FetchAPI/Request.res +16 -12
  20. package/src/FetchAPI/Response.res +27 -24
  21. package/src/FileAPI/Blob.res +10 -5
  22. package/src/FileAPI/File.res +8 -7
  23. package/src/FileAPI/FileSystemDirectoryHandle.res +18 -13
  24. package/src/FileAPI/FileSystemFileHandle.res +15 -5
  25. package/src/FileAPI/FileSystemHandle.res +4 -2
  26. package/src/FileAPI/ReadableStream.res +20 -10
  27. package/src/FileAPI/WritableStream.res +11 -8
  28. package/src/FileAPI/WritableStreamDefaultController.res +4 -2
  29. package/src/Global.res +0 -10
  30. package/src/HistoryAPI/History.res +9 -6
  31. package/src/IndexedDBAPI/IDBFactory.res +8 -4
  32. package/src/PerformanceAPI/Performance.res +18 -17
  33. package/src/PermissionsAPI/Permissions.res +5 -1
  34. package/src/ScreenWakeLockAPI/WakeLock.res +5 -1
  35. package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +10 -9
  36. package/src/ServiceWorkerAPI/ServiceWorkerGlobalScope.res +6 -2
  37. package/src/StorageAPI/StorageManager.res +8 -4
  38. package/src/URLAPI/URL.res +6 -4
  39. package/src/URLAPI/URLSearchParams.res +18 -16
  40. package/src/WebCryptoAPI/Crypto.res +6 -2
  41. package/src/WebLocksAPI/LockManager.res +7 -4
  42. package/src/WebSocketsAPI/CloseEvent.res +6 -3
  43. package/src/WebSocketsAPI/MessageEvent.res +10 -9
  44. package/src/WebSocketsAPI/WebSocket.res +15 -10
  45. package/src/WebStorageAPI/Storage.res +11 -5
  46. package/src/WebWorkersAPI/SharedWorkerGlobalScope.res +3 -1
  47. package/src/WebWorkersAPI/WorkerGlobalScope.res +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescript/webapi",
3
- "version": "0.1.0-pre-alpha-02fb350",
3
+ "version": "0.1.0-pre-alpha-4542085",
4
4
  "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5
5
  "keywords": [
6
6
  "dom",
@@ -1,10 +1,15 @@
1
- open CSSFontLoadingTypes
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=?) => fontFace =
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
- ) => fontFace = "FontFace"
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
- ) => fontFace = "FontFace"
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: fontFace => promise<fontFace> = "load"
39
+ external load: t => promise<t> = "load"
@@ -1,33 +1,37 @@
1
- open CSSFontLoadingTypes
1
+ module Types = CSSFontLoadingTypes
2
2
 
3
- include EventTarget.Impl({type t = fontFaceSet})
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: (fontFaceSet, fontFace) => fontFaceSet = "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: (fontFaceSet, fontFace) => bool = "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: fontFaceSet => unit = "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: (fontFaceSet, ~font: string, ~text: string=?) => promise<array<fontFace>> = "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: (fontFaceSet, ~font: string, ~text: string=?) => bool = "check"
37
+ external check: (t, ~font: string, ~text: string=?) => bool = "check"
@@ -1,4 +1,6 @@
1
- open CanvasTypes
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: (canvasGradient, ~offset: float, ~color: string) => unit = "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
- open DOMTypes
2
- open CanvasTypes
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: (canvasPattern, ~transform: domMatrix2DInit=?) => unit = "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
- external fromString: string => fillStyle = "%identity"
5
- external fromCanvasGradient: canvasGradient => fillStyle = "%identity"
6
- external fromCanvasPattern: canvasGradient => fillStyle = "%identity"
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 = (t: fillStyle): decoded => {
17
- if CanvasGradient.isInstanceOf(t) {
18
- CanvasGradient(unsafeConversation(t))
19
- } else if CanvasPattern.isInstanceOf(t) {
20
- CanvasPattern(unsafeConversation(t))
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(t))
27
+ String(unsafeConversation(value))
23
28
  }
24
29
  }
@@ -1,8 +1,10 @@
1
- open CanvasTypes
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: imageBitmap => unit = "close"
10
+ external close: t => unit = "close"
@@ -1,9 +1,11 @@
1
- open CanvasTypes
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: (imageBitmapRenderingContext, imageBitmap) => unit =
9
- "transferFromImageBitmap"
11
+ external transferFromImageBitmap: (t, imageBitmap) => unit = "transferFromImageBitmap"
@@ -1,13 +1,28 @@
1
- open CanvasTypes
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
- external make: (~width: int, ~height: int) => offscreenCanvas = "OffscreenCanvas"
9
-
10
- include EventTarget.Impl({type t = offscreenCanvas})
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
- offscreenCanvas,
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
- offscreenCanvas,
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
- offscreenCanvas,
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
- offscreenCanvas,
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: offscreenCanvas => imageBitmap = "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: (offscreenCanvas, ~options: imageEncodeOptions=?) => promise<blob> =
98
+ external convertToBlob: (t, ~options: imageEncodeOptions=?) => promise<FileTypes.blob> =
87
99
  "convertToBlob"
@@ -1,41 +1,42 @@
1
- open CanvasTypes
2
- open DOMTypes
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: path2D=?) => path2D = "Path2D"
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=?) => path2D = "Path2D"
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: path2D => unit = "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: (path2D, ~x: float, ~y: float) => unit = "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: (path2D, ~x: float, ~y: float) => unit = "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: (path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: float) => unit =
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
- path2D,
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: (path2D, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float) => unit =
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: (path2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "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
- path2D,
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
- path2D,
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
- path2D,
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: (path2D, ~path: path2D, ~transform: domMatrix2DInit=?) => unit = "addPath"
117
+ external addPath: (t, ~path: t, ~transform: DOMTypes.domMatrix2DInit=?) => unit = "addPath"
@@ -1,6 +1,11 @@
1
- open ChannelMessagingTypes
1
+ module Types = ChannelMessagingTypes
2
2
 
3
- include EventTarget.Impl({type t = messagePort})
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: (messagePort, ~message: JSON.t, ~transfer: array<Dict.t<string>>) => unit =
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
- messagePort,
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: messagePort => unit = "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: messagePort => unit = "close"
45
+ external close: t => unit = "close"
@@ -1,27 +1,31 @@
1
1
  open ClipboardTypes
2
2
 
3
- include EventTarget.Impl({type t = clipboard})
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: clipboard => promise<array<clipboardItem>> = "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: clipboard => promise<string> = "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: (clipboard, array<clipboardItem>) => promise<unit> = "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: (clipboard, string) => promise<unit> = "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: (credentialsContainer, ~options: credentialRequestOptions=?) => promise<credential> =
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: (credentialsContainer, credential) => promise<unit> = "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: credentialsContainer => promise<unit> = "preventSilentAccess"
31
+ external preventSilentAccess: t => promise<unit> = "preventSilentAccess"
@@ -1,48 +1,48 @@
1
- open FileTypes
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
- external fromString: string => bodyInit = "%identity"
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 => bodyInit = "%identity"
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> => bodyInit = "%identity"
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 => bodyInit = "%identity"
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 => bodyInit = "%identity"
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 => bodyInit = "%identity"
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 => bodyInit = "%identity"
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 => bodyInit = "%identity"
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> => bodyInit = "%identity"
48
+ external fromReadableStream: FileTypes.readableStream<'t> => t = "%identity"