@rescript/webapi 0.1.0-pre-alpha-fd40382 → 0.1.0-pre-alpha-02fb350

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 (66) hide show
  1. package/package.json +1 -1
  2. package/src/CSSFontLoadingAPI/FontFace.res +2 -2
  3. package/src/CanvasAPI/Path2D.res +1 -27
  4. package/src/ChannelMessagingAPI/MessagePort.res +1 -1
  5. package/src/DOMAPI/CanvasRenderingContext2D.res +32 -46
  6. package/src/DOMAPI/CharacterData.res +3 -3
  7. package/src/DOMAPI/DOMMatrix.res +1 -1
  8. package/src/DOMAPI/DOMMatrixReadOnly.res +1 -1
  9. package/src/DOMAPI/Document.res +8 -6
  10. package/src/DOMAPI/DocumentFragment.res +3 -3
  11. package/src/DOMAPI/Element.res +16 -11
  12. package/src/DOMAPI/HTMLCanvasElement.res +2 -0
  13. package/src/DOMAPI/HTMLElement.res +2 -0
  14. package/src/DOMAPI/HTMLImageElement.res +2 -0
  15. package/src/DOMAPI/HTMLInputElement.res +3 -1
  16. package/src/DOMAPI/HTMLSelectElement.res +1 -1
  17. package/src/DOMAPI/HTMLSlotElement.res +1 -1
  18. package/src/DOMAPI/HTMLTextAreaElement.res +1 -1
  19. package/src/DOMAPI/Location.res +2 -0
  20. package/src/DOMAPI/Navigator.res +10 -7
  21. package/src/DOMAPI/Node.res +2 -0
  22. package/src/DOMAPI/StylePropertyMap.res +2 -2
  23. package/src/DOMAPI/VideoFrame.res +20 -11
  24. package/src/DOMAPI/Window.res +29 -25
  25. package/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +2 -2
  26. package/src/EncryptedMediaExtensionsAPI/MediaKeyStatusMap.res +1 -1
  27. package/src/EncryptedMediaExtensionsAPI/MediaKeys.res +2 -1
  28. package/src/EventAPI/AbortController.res +2 -0
  29. package/src/EventAPI/AbortSignal.res +2 -0
  30. package/src/EventAPI/Event.res +2 -0
  31. package/src/EventAPI/EventTarget.res +2 -0
  32. package/src/EventAPI/ExtendableEvent.res +2 -0
  33. package/src/FileAPI/FileSystemWritableFileStream.res +4 -4
  34. package/src/FileAPI/ReadableStream.res +0 -12
  35. package/src/Global.res +23 -23
  36. package/src/IndexedDBAPI/IDBDatabase.res +1 -1
  37. package/src/IndexedDBAPI/IDBObjectStore.res +1 -1
  38. package/src/IntersectionObserverAPI/IntersectionObserver.res +2 -0
  39. package/src/IntersectionObserverAPI/IntersectionObserverRoot.res +2 -0
  40. package/src/MediaCaptureAndStreamsAPI/MediaStream.res +2 -2
  41. package/src/MutationObserverAPI/MutationObserver.res +2 -0
  42. package/src/PerformanceAPI/Performance.res +1 -1
  43. package/src/ResizeObserverAPI/ResizeObserver.res +2 -0
  44. package/src/ServiceWorkerAPI/Cache.res +10 -7
  45. package/src/ServiceWorkerAPI/ServiceWorker.res +1 -1
  46. package/src/UIEventsAPI/CompositionEvent.res +2 -0
  47. package/src/UIEventsAPI/DataTransfer.res +2 -0
  48. package/src/UIEventsAPI/DataTransferItem.res +2 -0
  49. package/src/UIEventsAPI/DataTransferItemList.res +2 -0
  50. package/src/UIEventsAPI/FocusEvent.res +2 -0
  51. package/src/UIEventsAPI/InputEvent.res +2 -0
  52. package/src/UIEventsAPI/KeyboardEvent.res +2 -0
  53. package/src/UIEventsAPI/MouseEvent.res +2 -0
  54. package/src/UIEventsAPI/PointerEvent.res +2 -0
  55. package/src/UIEventsAPI/Touch.res +2 -0
  56. package/src/UIEventsAPI/TouchEvent.res +2 -0
  57. package/src/UIEventsAPI/TouchList.res +2 -0
  58. package/src/UIEventsAPI/UIEvent.res +2 -0
  59. package/src/UIEventsAPI/WheelEvent.res +2 -0
  60. package/src/ViewTransitionsAPI/ViewTransition.res +2 -0
  61. package/src/WebAudioAPI/AudioNode.res +14 -8
  62. package/src/WebAudioAPI/OfflineAudioContext.res +5 -2
  63. package/src/WebCryptoAPI/SubtleCrypto.res +3 -3
  64. package/src/WebLocksAPI/LockManager.res +1 -1
  65. package/src/WebSocketsAPI/WebSocket.res +4 -4
  66. package/src/WebWorkersAPI/CacheStorage.res +1 -1
@@ -150,7 +150,7 @@ Throws an "InvalidStateError" DOMException if not called within an upgrade trans
150
150
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/createIndex)
151
151
  */
152
152
  @send
153
- external createIndex2: (
153
+ external createIndexWithKeyPaths: (
154
154
  idbObjectStore,
155
155
  ~name: string,
156
156
  ~keyPath: array<string>,
@@ -1,6 +1,8 @@
1
1
  open DOMTypes
2
2
  open IntersectionObserverTypes
3
3
 
4
+ type t = intersectionObserver = {...intersectionObserver}
5
+
4
6
  /**
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserver)
6
8
  */
@@ -1,6 +1,8 @@
1
1
  open DOMTypes
2
2
  open IntersectionObserverTypes
3
3
 
4
+ type t = root
5
+
4
6
  external fromDocument: document => root = "%identity"
5
7
  external fromElement: element => root = "%identity"
6
8
  external fromNull: root = "null"
@@ -10,13 +10,13 @@ external make: unit => mediaStream = "MediaStream"
10
10
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStream)
11
11
  */
12
12
  @new
13
- external make2: mediaStream => mediaStream = "MediaStream"
13
+ external fromStream: mediaStream => mediaStream = "MediaStream"
14
14
 
15
15
  /**
16
16
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStream)
17
17
  */
18
18
  @new
19
- external make3: array<mediaStreamTrack> => mediaStream = "MediaStream"
19
+ external fromTracks: array<mediaStreamTrack> => mediaStream = "MediaStream"
20
20
 
21
21
  include EventTarget.Impl({type t = mediaStream})
22
22
 
@@ -1,6 +1,8 @@
1
1
  open DOMTypes
2
2
  open MutationObserverTypes
3
3
 
4
+ type t = mutationObserver
5
+
4
6
  /**
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MutationObserver)
6
8
  */
@@ -76,7 +76,7 @@ external measure: (
76
76
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/measure)
77
77
  */
78
78
  @send
79
- external measure2: (
79
+ external measureWithOptions: (
80
80
  performance,
81
81
  ~measureName: string,
82
82
  ~startOrMeasureOptions: performanceMeasureOptions=?,
@@ -1,6 +1,8 @@
1
1
  open DOMTypes
2
2
  open ResizeObserverTypes
3
3
 
4
+ type t = resizeObserver = {...resizeObserver}
5
+
4
6
  /**
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ResizeObserver)
6
8
  */
@@ -12,8 +12,11 @@ external match: (cache, ~request: request, ~options: cacheQueryOptions=?) => Nul
12
12
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/match)
13
13
  */
14
14
  @send
15
- external match2: (cache, ~request: string, ~options: cacheQueryOptions=?) => Nullable.t<response> =
16
- "match"
15
+ external matchByUrl: (
16
+ cache,
17
+ ~request: string,
18
+ ~options: cacheQueryOptions=?,
19
+ ) => Nullable.t<response> = "match"
17
20
 
18
21
  /**
19
22
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/matchAll)
@@ -29,7 +32,7 @@ external matchAll: (
29
32
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/matchAll)
30
33
  */
31
34
  @send
32
- external matchAll2: (
35
+ external matchAllByUrl: (
33
36
  cache,
34
37
  ~request: string=?,
35
38
  ~options: cacheQueryOptions=?,
@@ -45,7 +48,7 @@ external add: (cache, request) => promise<unit> = "add"
45
48
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/add)
46
49
  */
47
50
  @send
48
- external add2: (cache, string) => promise<unit> = "add"
51
+ external addByUrl: (cache, string) => promise<unit> = "add"
49
52
 
50
53
  /**
51
54
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/addAll)
@@ -63,7 +66,7 @@ external put: (cache, ~request: request, ~response: response) => promise<unit> =
63
66
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/put)
64
67
  */
65
68
  @send
66
- external put2: (cache, ~request: string, ~response: response) => promise<unit> = "put"
69
+ external putByUrl: (cache, ~request: string, ~response: response) => promise<unit> = "put"
67
70
 
68
71
  /**
69
72
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/delete)
@@ -76,7 +79,7 @@ external delete: (cache, ~request: request, ~options: cacheQueryOptions=?) => pr
76
79
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/delete)
77
80
  */
78
81
  @send
79
- external delete2: (cache, ~request: string, ~options: cacheQueryOptions=?) => promise<bool> =
82
+ external deleteByUrl: (cache, ~request: string, ~options: cacheQueryOptions=?) => promise<bool> =
80
83
  "delete"
81
84
 
82
85
  /**
@@ -93,7 +96,7 @@ external keys: (
93
96
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Cache/keys)
94
97
  */
95
98
  @send
96
- external keys2: (
99
+ external keysByUrl: (
97
100
  cache,
98
101
  ~request: string=?,
99
102
  ~options: cacheQueryOptions=?,
@@ -14,7 +14,7 @@ external postMessage: (serviceWorker, ~message: JSON.t, ~transfer: array<Dict.t<
14
14
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorker/postMessage)
15
15
  */
16
16
  @send
17
- external postMessage2: (
17
+ external postMessageWithOptions: (
18
18
  serviceWorker,
19
19
  ~message: JSON.t,
20
20
  ~options: structuredSerializeOptions=?,
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = compositionEvent = {...compositionEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CompositionEvent)
5
7
  */
@@ -1,6 +1,8 @@
1
1
  open UIEventsTypes
2
2
  open DOMTypes
3
3
 
4
+ type t = dataTransfer = {...dataTransfer}
5
+
4
6
  /**
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer)
6
8
  */
@@ -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,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = focusEvent = {...focusEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FocusEvent)
5
7
  */
@@ -1,6 +1,8 @@
1
1
  open UIEventsTypes
2
2
  open DOMTypes
3
3
 
4
+ type t = inputEvent = {...inputEvent}
5
+
4
6
  /**
5
7
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent)
6
8
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = keyboardEvent = {...keyboardEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = mouseEvent = {...mouseEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = pointerEvent = {...pointerEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = touch = {...touch}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = touchEvent = {...touchEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = touchList = {...touchList}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchList/item)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = uiEvent = {...uiEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open UIEventsTypes
2
2
 
3
+ type t = wheelEvent = {...wheelEvent}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent)
5
7
  */
@@ -1,5 +1,7 @@
1
1
  open ViewTransitionsTypes
2
2
 
3
+ type t = viewTransition = {...viewTransition}
4
+
3
5
  /**
4
6
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ViewTransition/skipTransition)
5
7
  */
@@ -20,7 +20,7 @@ module Impl = (
20
20
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect)
21
21
  */
22
22
  @send
23
- external connect2: (T.t, ~destinationParam: audioParam, ~output: int=?) => unit = "connect"
23
+ external connectParam: (T.t, ~destinationParam: audioParam, ~output: int=?) => unit = "connect"
24
24
 
25
25
  /**
26
26
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
@@ -32,36 +32,42 @@ module Impl = (
32
32
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
33
33
  */
34
34
  @send
35
- external disconnect2: (T.t, int) => unit = "disconnect"
35
+ external disconnectOutput: (T.t, int) => unit = "disconnect"
36
36
 
37
37
  /**
38
38
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
39
39
  */
40
40
  @send
41
- external disconnect3: (T.t, audioNode) => unit = "disconnect"
41
+ external disconnectNode: (T.t, audioNode) => unit = "disconnect"
42
42
 
43
43
  /**
44
44
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
45
45
  */
46
46
  @send
47
- external disconnect4: (T.t, ~destinationNode: audioNode, ~output: int) => unit = "disconnect"
47
+ external disconnectNodeOutput: (T.t, ~destinationNode: audioNode, ~output: int) => unit =
48
+ "disconnect"
48
49
 
49
50
  /**
50
51
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
51
52
  */
52
53
  @send
53
- external disconnect5: (T.t, ~destinationNode: audioNode, ~output: int, ~input: int) => unit =
54
- "disconnect"
54
+ external disconnectNodeOutputInput: (
55
+ T.t,
56
+ ~destinationNode: audioNode,
57
+ ~output: int,
58
+ ~input: int,
59
+ ) => unit = "disconnect"
55
60
 
56
61
  /**
57
62
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
58
63
  */
59
64
  @send
60
- external disconnect6: (T.t, audioParam) => unit = "disconnect"
65
+ external disconnectParam: (T.t, audioParam) => unit = "disconnect"
61
66
 
62
67
  /**
63
68
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
64
69
  */
65
70
  @send
66
- external disconnect7: (T.t, ~destinationParam: audioParam, ~output: int) => unit = "disconnect"
71
+ external disconnectParamOutput: (T.t, ~destinationParam: audioParam, ~output: int) => unit =
72
+ "disconnect"
67
73
  }
@@ -12,8 +12,11 @@ external make: offlineAudioContextOptions => offlineAudioContext = "OfflineAudio
12
12
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext)
13
13
  */
14
14
  @new
15
- external make2: (~numberOfChannels: int, ~length: int, ~sampleRate: float) => offlineAudioContext =
16
- "OfflineAudioContext"
15
+ external makeWithParams: (
16
+ ~numberOfChannels: int,
17
+ ~length: int,
18
+ ~sampleRate: float,
19
+ ) => offlineAudioContext = "OfflineAudioContext"
17
20
 
18
21
  /**
19
22
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/startRendering)
@@ -71,7 +71,7 @@ external generateKey: (
71
71
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey)
72
72
  */
73
73
  @send
74
- external generateKey2: (
74
+ external generateKeyWithAlgorithmName: (
75
75
  subtleCrypto,
76
76
  ~algorithm: string,
77
77
  ~extractable: bool,
@@ -106,7 +106,7 @@ external deriveBits: (
106
106
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits)
107
107
  */
108
108
  @send
109
- external deriveBits2: (
109
+ external deriveBitsWithAlgorithmName: (
110
110
  subtleCrypto,
111
111
  ~algorithm: string,
112
112
  ~baseKey: cryptoKey,
@@ -149,7 +149,7 @@ external wrapKey: (
149
149
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey)
150
150
  */
151
151
  @send
152
- external wrapKey2: (
152
+ external wrapKeyWithAlgorithmName: (
153
153
  subtleCrypto,
154
154
  ~format: keyFormat,
155
155
  ~key: cryptoKey,
@@ -11,7 +11,7 @@ external request: (lockManager, ~name: string, ~callback: lockGrantedCallback) =
11
11
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
12
12
  */
13
13
  @send
14
- external request2: (
14
+ external requestWithOptions: (
15
15
  lockManager,
16
16
  ~name: string,
17
17
  ~options: lockOptions,
@@ -11,7 +11,7 @@ external make: (~url: string, ~protocols: string=?) => webSocket = "WebSocket"
11
11
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket)
12
12
  */
13
13
  @new
14
- external make2: (~url: string, ~protocols: array<string>=?) => webSocket = "WebSocket"
14
+ external makeWithProtocols: (~url: string, ~protocols: array<string>=?) => webSocket = "WebSocket"
15
15
 
16
16
  include EventTarget.Impl({type t = webSocket})
17
17
 
@@ -34,18 +34,18 @@ Transmits data using the WebSocket connection. data can be a string, a Blob, an
34
34
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
35
35
  */
36
36
  @send
37
- external send2: (webSocket, ArrayBuffer.t) => unit = "send"
37
+ external sendArrayBuffer: (webSocket, ArrayBuffer.t) => unit = "send"
38
38
 
39
39
  /**
40
40
  Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
41
41
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
42
42
  */
43
43
  @send
44
- external send3: (webSocket, blob) => unit = "send"
44
+ external sendBlob: (webSocket, blob) => unit = "send"
45
45
 
46
46
  /**
47
47
  Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
48
48
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
49
49
  */
50
50
  @send
51
- external send4: (webSocket, string) => unit = "send"
51
+ external sendString: (webSocket, string) => unit = "send"
@@ -15,7 +15,7 @@ external match: (
15
15
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage/match)
16
16
  */
17
17
  @send
18
- external match2: (
18
+ external matchByUrl: (
19
19
  cacheStorage,
20
20
  ~request: string,
21
21
  ~options: multiCacheQueryOptions=?,