@rescript/webapi 0.1.0-experimental-a0d5168 → 0.1.0-experimental-47c6b2c

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 (133) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/CSSFontLoadingAPI/FontFaceSet.res +3 -79
  4. package/src/CanvasAPI/OffscreenCanvas.res +3 -79
  5. package/src/ChannelMessagingAPI/MessagePort.res +3 -81
  6. package/src/ClipboardAPI/Clipboard.res +3 -80
  7. package/src/DOMAPI/Animation.res +3 -80
  8. package/src/DOMAPI/CharacterData.res +68 -231
  9. package/src/DOMAPI/Comment.res +4 -271
  10. package/src/DOMAPI/Document.res +4 -178
  11. package/src/DOMAPI/DocumentFragment.res +58 -220
  12. package/src/DOMAPI/Element.res +313 -477
  13. package/src/DOMAPI/HTMLAnchorElement.res +3 -691
  14. package/src/DOMAPI/HTMLAreaElement.res +3 -685
  15. package/src/DOMAPI/HTMLAudioElement.res +3 -748
  16. package/src/DOMAPI/HTMLBRElement.res +3 -684
  17. package/src/DOMAPI/HTMLBaseElement.res +3 -685
  18. package/src/DOMAPI/HTMLBodyElement.res +3 -685
  19. package/src/DOMAPI/HTMLButtonElement.res +3 -691
  20. package/src/DOMAPI/HTMLCanvasElement.res +3 -691
  21. package/src/DOMAPI/HTMLDListElement.res +3 -688
  22. package/src/DOMAPI/HTMLDataElement.res +3 -685
  23. package/src/DOMAPI/HTMLDataListElement.res +3 -695
  24. package/src/DOMAPI/HTMLDialogElement.res +3 -691
  25. package/src/DOMAPI/HTMLDivElement.res +3 -684
  26. package/src/DOMAPI/HTMLElement.res +40 -666
  27. package/src/DOMAPI/HTMLEmbedElement.res +3 -688
  28. package/src/DOMAPI/HTMLFieldSetElement.res +3 -695
  29. package/src/DOMAPI/HTMLFormElement.res +3 -685
  30. package/src/DOMAPI/HTMLFrameSetElement.res +3 -695
  31. package/src/DOMAPI/HTMLHRElement.res +3 -684
  32. package/src/DOMAPI/HTMLHeadElement.res +3 -685
  33. package/src/DOMAPI/HTMLHeadingElement.res +3 -691
  34. package/src/DOMAPI/HTMLHtmlElement.res +3 -685
  35. package/src/DOMAPI/HTMLIFrameElement.res +3 -691
  36. package/src/DOMAPI/HTMLImageElement.res +3 -688
  37. package/src/DOMAPI/HTMLInputElement.res +3 -688
  38. package/src/DOMAPI/HTMLLIElement.res +3 -684
  39. package/src/DOMAPI/HTMLLabelElement.res +3 -688
  40. package/src/DOMAPI/HTMLLegendElement.res +3 -691
  41. package/src/DOMAPI/HTMLLinkElement.res +3 -685
  42. package/src/DOMAPI/HTMLMapElement.res +3 -684
  43. package/src/DOMAPI/HTMLMediaElement.res +49 -722
  44. package/src/DOMAPI/HTMLMenuElement.res +3 -685
  45. package/src/DOMAPI/HTMLMetaElement.res +3 -685
  46. package/src/DOMAPI/HTMLMeterElement.res +3 -688
  47. package/src/DOMAPI/HTMLModElement.res +3 -684
  48. package/src/DOMAPI/HTMLOListElement.res +3 -688
  49. package/src/DOMAPI/HTMLObjectElement.res +3 -691
  50. package/src/DOMAPI/HTMLOptGroupElement.res +3 -695
  51. package/src/DOMAPI/HTMLOptionElement.res +3 -691
  52. package/src/DOMAPI/HTMLOutputElement.res +3 -691
  53. package/src/DOMAPI/HTMLParagraphElement.res +3 -699
  54. package/src/DOMAPI/HTMLPictureElement.res +3 -691
  55. package/src/DOMAPI/HTMLPreElement.res +3 -684
  56. package/src/DOMAPI/HTMLProgressElement.res +3 -695
  57. package/src/DOMAPI/HTMLQuoteElement.res +3 -688
  58. package/src/DOMAPI/HTMLScriptElement.res +3 -691
  59. package/src/DOMAPI/HTMLSelectElement.res +4 -692
  60. package/src/DOMAPI/HTMLSlotElement.res +3 -685
  61. package/src/DOMAPI/HTMLSourceElement.res +3 -691
  62. package/src/DOMAPI/HTMLSpanElement.res +3 -685
  63. package/src/DOMAPI/HTMLStyleElement.res +3 -688
  64. package/src/DOMAPI/HTMLTableCaptionElement.res +3 -712
  65. package/src/DOMAPI/HTMLTableCellElement.res +3 -699
  66. package/src/DOMAPI/HTMLTableElement.res +3 -688
  67. package/src/DOMAPI/HTMLTableRowElement.res +3 -695
  68. package/src/DOMAPI/HTMLTableSectionElement.res +3 -712
  69. package/src/DOMAPI/HTMLTemplateElement.res +3 -695
  70. package/src/DOMAPI/HTMLTextAreaElement.res +3 -695
  71. package/src/DOMAPI/HTMLTimeElement.res +3 -685
  72. package/src/DOMAPI/HTMLTitleElement.res +3 -688
  73. package/src/DOMAPI/HTMLTrackElement.res +3 -688
  74. package/src/DOMAPI/HTMLUListElement.res +3 -688
  75. package/src/DOMAPI/HTMLVideoElement.res +3 -748
  76. package/src/DOMAPI/MediaQueryList.res +3 -80
  77. package/src/DOMAPI/Node.res +59 -124
  78. package/src/DOMAPI/SVGGraphicsElement.res +4 -660
  79. package/src/DOMAPI/ScreenOrientation.res +3 -79
  80. package/src/DOMAPI/ShadowRoot.res +4 -255
  81. package/src/DOMAPI/Text.res +4 -271
  82. package/src/DOMAPI/TextTrackList.res +3 -79
  83. package/src/DOMAPI/Window.res +4 -80
  84. package/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +3 -80
  85. package/src/EventAPI/AbortSignal.res +3 -80
  86. package/src/EventAPI/Event.res +28 -16
  87. package/src/EventAPI/EventTarget.res +51 -39
  88. package/src/FileAPI/Blob.res +26 -15
  89. package/src/FileAPI/File.res +4 -31
  90. package/src/IndexedDBAPI/IDBDatabase.res +3 -79
  91. package/src/IndexedDBAPI/IDBTransaction.res +3 -80
  92. package/src/MediaCaptureAndStreamsAPI/MediaDevices.res +3 -79
  93. package/src/MediaCaptureAndStreamsAPI/MediaStream.res +3 -80
  94. package/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res +3 -81
  95. package/src/NotificationAPI/Notification.res +3 -80
  96. package/src/PerformanceAPI/Performance.res +3 -79
  97. package/src/RemotePlaybackAPI/RemotePlayback.res +3 -80
  98. package/src/ScreenWakeLockAPI/WakeLockSentinel.res +3 -79
  99. package/src/ServiceWorkerAPI/ServiceWorker.res +3 -79
  100. package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +3 -79
  101. package/src/ServiceWorkerAPI/ServiceWorkerRegistration.res +3 -79
  102. package/src/WebAudioAPI/AnalyserNode.res +4 -148
  103. package/src/WebAudioAPI/AudioBufferSourceNode.res +4 -162
  104. package/src/WebAudioAPI/AudioContext.res +4 -212
  105. package/src/WebAudioAPI/AudioNode.res +39 -113
  106. package/src/WebAudioAPI/AudioProcessingEvent.res +4 -30
  107. package/src/WebAudioAPI/AudioScheduledSourceNode.res +20 -162
  108. package/src/WebAudioAPI/AudioWorkletNode.res +4 -149
  109. package/src/WebAudioAPI/BaseAudioContext.res +85 -155
  110. package/src/WebAudioAPI/BiquadFilterNode.res +4 -149
  111. package/src/WebAudioAPI/ChannelMergerNode.res +4 -149
  112. package/src/WebAudioAPI/ChannelSplitterNode.res +4 -149
  113. package/src/WebAudioAPI/ConstantSourceNode.res +4 -162
  114. package/src/WebAudioAPI/ConvolverNode.res +4 -149
  115. package/src/WebAudioAPI/DelayNode.res +4 -143
  116. package/src/WebAudioAPI/DynamicsCompressorNode.res +4 -152
  117. package/src/WebAudioAPI/GainNode.res +4 -142
  118. package/src/WebAudioAPI/IIRFilterNode.res +4 -149
  119. package/src/WebAudioAPI/MediaElementAudioSourceNode.res +4 -158
  120. package/src/WebAudioAPI/MediaStreamAudioDestinationNode.res +4 -158
  121. package/src/WebAudioAPI/MediaStreamAudioSourceNode.res +4 -158
  122. package/src/WebAudioAPI/OfflineAudioCompletionEvent.res +4 -30
  123. package/src/WebAudioAPI/OfflineAudioContext.res +4 -214
  124. package/src/WebAudioAPI/OscillatorNode.res +4 -162
  125. package/src/WebAudioAPI/PannerNode.res +4 -143
  126. package/src/WebAudioAPI/StereoPannerNode.res +4 -149
  127. package/src/WebAudioAPI/WaveShaperNode.res +4 -149
  128. package/src/WebSocketsAPI/CloseEvent.res +4 -30
  129. package/src/WebSocketsAPI/WebSocket.res +3 -79
  130. package/src/WebSpeechAPI/SpeechSynthesis.res +3 -79
  131. package/src/WebSpeechAPI/SpeechSynthesisUtterance.res +4 -81
  132. package/src/WebStorageAPI/StorageEvent.res +4 -30
  133. package/src/WebVTTAPI/TextTrack.res +3 -79
@@ -1,749 +1,76 @@
1
1
  open DOMAPI
2
- open Prelude
3
- open EventAPI
4
2
  open WebVTTAPI
5
3
  open EncryptedMediaExtensionsAPI
6
4
 
7
- external asHTMLElement: htmlMediaElement => htmlElement = "%identity"
8
- external asElement: htmlMediaElement => element = "%identity"
9
- external asNode: htmlMediaElement => node = "%identity"
10
- external asEventTarget: htmlMediaElement => eventTarget = "%identity"
11
- /**
12
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus)
13
- */
14
- @send
15
- external focus: (htmlMediaElement, ~options: focusOptions=?) => unit = "focus"
16
-
17
- /**
18
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur)
19
- */
20
- @send
21
- external blur: htmlMediaElement => unit = "blur"
22
-
23
- /**
24
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
25
-
26
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
27
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
28
- */
29
- @send
30
- external prepend: (htmlMediaElement, node) => unit = "prepend"
31
-
32
- /**
33
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
34
-
35
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
36
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
37
- */
38
- @send
39
- external prepend2: (htmlMediaElement, string) => unit = "prepend"
40
-
41
- /**
42
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
43
-
44
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
45
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
46
- */
47
- @send
48
- external append: (htmlMediaElement, node) => unit = "append"
49
-
50
- /**
51
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
52
-
53
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
54
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
55
- */
56
- @send
57
- external append2: (htmlMediaElement, string) => unit = "append"
58
-
59
- /**
60
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
61
-
62
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
63
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
64
- */
65
- @send
66
- external replaceChildren: (htmlMediaElement, node) => unit = "replaceChildren"
67
-
68
- /**
69
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
70
-
71
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
72
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
73
- */
74
- @send
75
- external replaceChildren2: (htmlMediaElement, string) => unit = "replaceChildren"
76
-
77
- /**
78
- Returns the first element that is a descendant of node that matches selectors.
79
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
80
- */
81
- @send
82
- external querySelector: (htmlMediaElement, string) => element = "querySelector"
83
-
84
- /**
85
- Returns all element descendants of node that match selectors.
86
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
87
- */
88
- @send
89
- external querySelectorAll: (htmlMediaElement, string) => nodeList = "querySelectorAll"
90
-
91
- /**
92
- Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
93
-
94
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
95
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
96
- */
97
- @send
98
- external before: (htmlMediaElement, node) => unit = "before"
99
-
100
- /**
101
- Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
102
-
103
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
104
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
105
- */
106
- @send
107
- external before2: (htmlMediaElement, string) => unit = "before"
108
-
109
- /**
110
- Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
111
-
112
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
113
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
114
- */
115
- @send
116
- external after: (htmlMediaElement, node) => unit = "after"
117
-
118
- /**
119
- Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
120
-
121
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
122
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
123
- */
124
- @send
125
- external after2: (htmlMediaElement, string) => unit = "after"
126
-
127
- /**
128
- Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
129
-
130
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
131
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
132
- */
133
- @send
134
- external replaceWith: (htmlMediaElement, node) => unit = "replaceWith"
135
-
136
- /**
137
- Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
138
-
139
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
140
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
141
- */
142
- @send
143
- external replaceWith2: (htmlMediaElement, string) => unit = "replaceWith"
144
-
145
- /**
146
- Removes node.
147
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
148
- */
149
- @send
150
- external remove: htmlMediaElement => unit = "remove"
151
-
152
- /**
153
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
154
- */
155
- @send
156
- external animate: (htmlMediaElement, ~keyframes: any, ~options: float=?) => animation = "animate"
157
-
158
- /**
159
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
160
- */
161
- @send
162
- external animate2: (
163
- htmlMediaElement,
164
- ~keyframes: any,
165
- ~options: keyframeAnimationOptions=?,
166
- ) => animation = "animate"
167
-
168
- /**
169
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)
170
- */
171
- @send
172
- external getAnimations: (htmlMediaElement, ~options: getAnimationsOptions=?) => array<animation> =
173
- "getAnimations"
174
-
175
- /**
176
- Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
177
-
178
- The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
179
-
180
- When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
5
+ module Impl = (
6
+ T: {
7
+ type t
8
+ },
9
+ ) => {
10
+ include HTMLElement.Impl({
11
+ type t = htmlMediaElement
12
+ })
181
13
 
182
- When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
183
-
184
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
185
-
186
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
187
-
188
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
189
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
190
- */
191
- @send
192
- external addEventListener: (
193
- htmlMediaElement,
194
- ~type_: eventType,
195
- ~callback: eventListener<'event>,
196
- ~options: addEventListenerOptions=?,
197
- ) => unit = "addEventListener"
198
-
199
- /**
200
- Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
201
-
202
- The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
203
-
204
- When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
205
-
206
- When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
207
-
208
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
209
-
210
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
211
-
212
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
213
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
214
- */
215
- @send
216
- external addEventListener2: (
217
- htmlMediaElement,
218
- ~type_: eventType,
219
- ~callback: eventListener<'event>,
220
- ~options: bool=?,
221
- ) => unit = "addEventListener"
222
-
223
- /**
224
- Removes the event listener in target's event listener list with the same type, callback, and options.
225
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
226
- */
227
- @send
228
- external removeEventListener: (
229
- htmlMediaElement,
230
- ~type_: eventType,
231
- ~callback: eventListener<'event>,
232
- ~options: eventListenerOptions=?,
233
- ) => unit = "removeEventListener"
234
-
235
- /**
236
- Removes the event listener in target's event listener list with the same type, callback, and options.
237
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
238
- */
239
- @send
240
- external removeEventListener2: (
241
- htmlMediaElement,
242
- ~type_: eventType,
243
- ~callback: eventListener<'event>,
244
- ~options: bool=?,
245
- ) => unit = "removeEventListener"
246
-
247
- /**
248
- Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
249
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
250
- */
251
- @send
252
- external dispatchEvent: (htmlMediaElement, event) => bool = "dispatchEvent"
253
-
254
- /**
255
- Returns node's root.
256
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
257
- */
258
- @send
259
- external getRootNode: (htmlMediaElement, ~options: getRootNodeOptions=?) => node = "getRootNode"
260
-
261
- /**
262
- Returns whether node has children.
263
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
264
- */
265
- @send
266
- external hasChildNodes: htmlMediaElement => bool = "hasChildNodes"
267
-
268
- /**
269
- Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
270
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
271
- */
272
- @send
273
- external normalize: htmlMediaElement => unit = "normalize"
274
-
275
- /**
276
- Returns a copy of node. If deep is true, the copy also includes the node's descendants.
277
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
278
- */
279
- @send
280
- external cloneNode: (htmlMediaElement, ~deep: bool=?) => node = "cloneNode"
281
-
282
- /**
283
- Returns whether node and otherNode have the same properties.
284
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
285
- */
286
- @send
287
- external isEqualNode: (htmlMediaElement, node) => bool = "isEqualNode"
288
-
289
- /**
290
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)
291
- */
292
- @send
293
- external isSameNode: (htmlMediaElement, node) => bool = "isSameNode"
294
-
295
- /**
296
- Returns a bitmask indicating the position of other relative to node.
297
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
298
- */
299
- @send
300
- external compareDocumentPosition: (htmlMediaElement, node) => int = "compareDocumentPosition"
301
-
302
- /**
303
- Returns true if other is an inclusive descendant of node, and false otherwise.
304
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
305
- */
306
- @send
307
- external contains: (htmlMediaElement, node) => bool = "contains"
308
-
309
- /**
310
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)
311
- */
312
- @send
313
- external lookupPrefix: (htmlMediaElement, string) => string = "lookupPrefix"
314
-
315
- /**
316
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)
317
- */
318
- @send
319
- external lookupNamespaceURI: (htmlMediaElement, string) => string = "lookupNamespaceURI"
320
-
321
- /**
322
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)
323
- */
324
- @send
325
- external isDefaultNamespace: (htmlMediaElement, string) => bool = "isDefaultNamespace"
326
-
327
- /**
328
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)
329
- */
330
- @send
331
- external insertBefore: (htmlMediaElement, 't, ~child: node) => 't = "insertBefore"
332
-
333
- /**
334
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild)
335
- */
336
- @send
337
- external appendChild: (htmlMediaElement, 't) => 't = "appendChild"
338
-
339
- /**
340
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)
341
- */
342
- @send
343
- external replaceChild: (htmlMediaElement, ~node: node, 't) => 't = "replaceChild"
344
-
345
- /**
346
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild)
347
- */
348
- @send
349
- external removeChild: (htmlMediaElement, 't) => 't = "removeChild"
350
-
351
- /**
352
- Returns true if element has attributes, and false otherwise.
353
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes)
354
- */
355
- @send
356
- external hasAttributes: htmlMediaElement => bool = "hasAttributes"
357
-
358
- /**
359
- Returns the qualified names of all element's attributes. Can contain duplicates.
360
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames)
361
- */
362
- @send
363
- external getAttributeNames: htmlMediaElement => array<string> = "getAttributeNames"
364
-
365
- /**
366
- Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
367
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute)
368
- */
369
- @send
370
- external getAttribute: (htmlMediaElement, string) => string = "getAttribute"
14
+ external asHTMLMediaElement: T.t => htmlMediaElement = "%identity"
371
15
 
372
- /**
373
- Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
374
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS)
375
- */
376
- @send
377
- external getAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => string =
378
- "getAttributeNS"
379
-
380
- /**
381
- Sets the value of element's first attribute whose qualified name is qualifiedName to value.
382
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute)
383
- */
384
- @send
385
- external setAttribute: (htmlMediaElement, ~qualifiedName: string, ~value: string) => unit =
386
- "setAttribute"
387
-
388
- /**
389
- Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
390
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS)
391
- */
392
- @send
393
- external setAttributeNS: (
394
- htmlMediaElement,
395
- ~namespace: string,
396
- ~qualifiedName: string,
397
- ~value: string,
398
- ) => unit = "setAttributeNS"
399
-
400
- /**
401
- Removes element's first attribute whose qualified name is qualifiedName.
402
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute)
403
- */
404
- @send
405
- external removeAttribute: (htmlMediaElement, string) => unit = "removeAttribute"
406
-
407
- /**
408
- Removes element's attribute whose namespace is namespace and local name is localName.
409
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS)
410
- */
411
- @send
412
- external removeAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => unit =
413
- "removeAttributeNS"
414
-
415
- /**
416
- If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
417
-
418
- Returns true if qualifiedName is now present, and false otherwise.
419
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute)
420
- */
421
- @send
422
- external toggleAttribute: (htmlMediaElement, ~qualifiedName: string, ~force: bool=?) => bool =
423
- "toggleAttribute"
424
-
425
- /**
426
- Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
427
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute)
428
- */
429
- @send
430
- external hasAttribute: (htmlMediaElement, string) => bool = "hasAttribute"
431
-
432
- /**
433
- Returns true if element has an attribute whose namespace is namespace and local name is localName.
434
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS)
435
- */
436
- @send
437
- external hasAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => bool =
438
- "hasAttributeNS"
439
-
440
- /**
441
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode)
442
- */
443
- @send
444
- external getAttributeNode: (htmlMediaElement, string) => attr = "getAttributeNode"
445
-
446
- /**
447
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS)
448
- */
449
- @send
450
- external getAttributeNodeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => attr =
451
- "getAttributeNodeNS"
452
-
453
- /**
454
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode)
455
- */
456
- @send
457
- external setAttributeNode: (htmlMediaElement, attr) => attr = "setAttributeNode"
458
-
459
- /**
460
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
461
- */
462
- @send
463
- external setAttributeNodeNS: (htmlMediaElement, attr) => attr = "setAttributeNodeNS"
464
-
465
- /**
466
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode)
467
- */
468
- @send
469
- external removeAttributeNode: (htmlMediaElement, attr) => attr = "removeAttributeNode"
470
-
471
- /**
472
- Creates a shadow root for element and returns it.
473
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow)
474
- */
475
- @send
476
- external attachShadow: (htmlMediaElement, shadowRootInit) => shadowRoot = "attachShadow"
477
-
478
- /**
479
- Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
480
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest)
481
- */
482
- @send
483
- external closest: (htmlMediaElement, string) => 'e = "closest"
484
-
485
- /**
486
- Returns true if matching selectors against element's root yields element, and false otherwise.
487
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches)
488
- */
489
- @send
490
- external matches: (htmlMediaElement, string) => bool = "matches"
491
-
492
- /**
493
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName)
494
- */
495
- @send
496
- external getElementsByTagName: (htmlMediaElement, string) => htmlCollection = "getElementsByTagName"
497
-
498
- /**
499
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
500
- */
501
- @send
502
- external getElementsByTagNameNS: (
503
- htmlMediaElement,
504
- ~namespace: string,
505
- ~localName: string,
506
- ) => htmlCollectionOf<element> = "getElementsByTagNameNS"
507
-
508
- /**
509
- Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
510
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName)
511
- */
512
- @send
513
- external getElementsByClassName: (htmlMediaElement, string) => htmlCollectionOf<element> =
514
- "getElementsByClassName"
515
-
516
- /**
517
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement)
518
- */
519
- @send
520
- external insertAdjacentElement: (
521
- htmlMediaElement,
522
- ~where: insertPosition,
523
- ~element: element,
524
- ) => element = "insertAdjacentElement"
525
-
526
- /**
527
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText)
528
- */
529
- @send
530
- external insertAdjacentText: (htmlMediaElement, ~where: insertPosition, ~data: string) => unit =
531
- "insertAdjacentText"
532
-
533
- /**
534
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap)
535
- */
536
- @send
537
- external computedStyleMap: htmlMediaElement => stylePropertyMapReadOnly = "computedStyleMap"
538
-
539
- /**
540
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects)
541
- */
542
- @send
543
- external getClientRects: htmlMediaElement => domRectList = "getClientRects"
544
-
545
- /**
546
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect)
547
- */
548
- @send
549
- external getBoundingClientRect: htmlMediaElement => domRect = "getBoundingClientRect"
550
-
551
- /**
552
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility)
553
- */
554
- @send
555
- external checkVisibility: (htmlMediaElement, ~options: checkVisibilityOptions=?) => bool =
556
- "checkVisibility"
557
-
558
- /**
559
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
560
- */
561
- @send
562
- external scrollIntoView: (htmlMediaElement, ~arg: bool=?) => unit = "scrollIntoView"
563
-
564
- /**
565
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
566
- */
567
- @send
568
- external scrollIntoView2: (htmlMediaElement, ~arg: scrollIntoViewOptions=?) => unit =
569
- "scrollIntoView"
570
-
571
- /**
572
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
573
- */
574
- @send
575
- external scroll: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scroll"
576
-
577
- /**
578
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
579
- */
580
- @send
581
- external scroll2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scroll"
582
-
583
- /**
584
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
585
- */
586
- @send
587
- external scrollTo: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scrollTo"
588
-
589
- /**
590
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
591
- */
592
- @send
593
- external scrollTo2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scrollTo"
594
-
595
- /**
596
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
597
- */
598
- @send
599
- external scrollBy: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scrollBy"
600
-
601
- /**
602
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
603
- */
604
- @send
605
- external scrollBy2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scrollBy"
606
-
607
- /**
608
- Displays element fullscreen and resolves promise when done.
609
-
610
- When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
611
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen)
612
- */
613
- @send
614
- external requestFullscreen: (htmlMediaElement, ~options: fullscreenOptions=?) => Promise.t<unit> =
615
- "requestFullscreen"
616
-
617
- /**
618
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe)
619
- */
620
- @send
621
- external setHTMLUnsafe: (htmlMediaElement, string) => unit = "setHTMLUnsafe"
622
-
623
- /**
624
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML)
625
- */
626
- @send
627
- external getHTML: (htmlMediaElement, ~options: getHTMLOptions=?) => string = "getHTML"
628
-
629
- /**
630
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML)
631
- */
632
- @send
633
- external insertAdjacentHTML: (
634
- htmlMediaElement,
635
- ~position: insertPosition,
636
- ~string: string,
637
- ) => unit = "insertAdjacentHTML"
638
-
639
- /**
640
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture)
641
- */
642
- @send
643
- external setPointerCapture: (htmlMediaElement, int) => unit = "setPointerCapture"
644
-
645
- /**
646
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture)
647
- */
648
- @send
649
- external releasePointerCapture: (htmlMediaElement, int) => unit = "releasePointerCapture"
650
-
651
- /**
652
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture)
653
- */
654
- @send
655
- external hasPointerCapture: (htmlMediaElement, int) => bool = "hasPointerCapture"
656
-
657
- /**
658
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock)
659
- */
660
- @send
661
- external requestPointerLock: (htmlMediaElement, ~options: pointerLockOptions=?) => Promise.t<unit> =
662
- "requestPointerLock"
663
-
664
- /**
665
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click)
666
- */
667
- @send
668
- external click: htmlMediaElement => unit = "click"
669
-
670
- /**
671
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals)
672
- */
673
- @send
674
- external attachInternals: htmlMediaElement => elementInternals = "attachInternals"
675
-
676
- /**
677
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover)
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack)
678
18
  */
679
- @send
680
- external showPopover: htmlMediaElement => unit = "showPopover"
19
+ @send
20
+ external addTextTrack: (
21
+ T.t,
22
+ ~kind: textTrackKind,
23
+ ~label: string=?,
24
+ ~language: string=?,
25
+ ) => textTrack = "addTextTrack"
681
26
 
682
- /**
683
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover)
27
+ /**
28
+ Returns a string that specifies whether the client can play a given media resource type.
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType)
684
30
  */
685
- @send
686
- external hidePopover: htmlMediaElement => unit = "hidePopover"
31
+ @send
32
+ external canPlayType: (T.t, string) => canPlayTypeResult = "canPlayType"
687
33
 
688
- /**
689
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover)
34
+ /**
35
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek)
690
36
  */
691
- @send
692
- external togglePopover: (htmlMediaElement, ~force: bool=?) => bool = "togglePopover"
37
+ @send
38
+ external fastSeek: (T.t, float) => unit = "fastSeek"
693
39
 
694
- /**
40
+ /**
695
41
  Resets the audio or video object and loads a new media resource.
696
42
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/load)
697
43
  */
698
- @send
699
- external load: htmlMediaElement => unit = "load"
700
-
701
- /**
702
- Returns a string that specifies whether the client can play a given media resource type.
703
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType)
704
- */
705
- @send
706
- external canPlayType: (htmlMediaElement, string) => canPlayTypeResult = "canPlayType"
44
+ @send
45
+ external load: T.t => unit = "load"
707
46
 
708
- /**
709
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek)
47
+ /**
48
+ Pauses the current playback and sets paused to TRUE.
49
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause)
710
50
  */
711
- @send
712
- external fastSeek: (htmlMediaElement, float) => unit = "fastSeek"
51
+ @send
52
+ external pause: T.t => unit = "pause"
713
53
 
714
- /**
54
+ /**
715
55
  Loads and starts playback of a media resource.
716
56
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play)
717
57
  */
718
- @send
719
- external play: htmlMediaElement => Promise.t<unit> = "play"
58
+ @send
59
+ external play: T.t => Promise.t<unit> = "play"
720
60
 
721
- /**
722
- Pauses the current playback and sets paused to TRUE.
723
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause)
724
- */
725
- @send
726
- external pause: htmlMediaElement => unit = "pause"
727
-
728
- /**
729
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack)
61
+ /**
62
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys)
730
63
  */
731
- @send
732
- external addTextTrack: (
733
- htmlMediaElement,
734
- ~kind: textTrackKind,
735
- ~label: string=?,
736
- ~language: string=?,
737
- ) => textTrack = "addTextTrack"
64
+ @send
65
+ external setMediaKeys: (T.t, mediaKeys) => Promise.t<unit> = "setMediaKeys"
738
66
 
739
- /**
67
+ /**
740
68
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId)
741
69
  */
742
- @send
743
- external setSinkId: (htmlMediaElement, string) => Promise.t<unit> = "setSinkId"
70
+ @send
71
+ external setSinkId: (T.t, string) => Promise.t<unit> = "setSinkId"
72
+ }
744
73
 
745
- /**
746
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys)
747
- */
748
- @send
749
- external setMediaKeys: (htmlMediaElement, mediaKeys) => Promise.t<unit> = "setMediaKeys"
74
+ include Impl({
75
+ type t = htmlMediaElement
76
+ })