@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,685 +1,59 @@
1
1
  open DOMAPI
2
- open Prelude
3
- open EventAPI
4
2
 
5
- external asElement: htmlElement => element = "%identity"
6
- external asNode: htmlElement => node = "%identity"
7
- external asEventTarget: htmlElement => eventTarget = "%identity"
8
- /**
9
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus)
10
- */
11
- @send
12
- external focus: (htmlElement, ~options: focusOptions=?) => unit = "focus"
13
-
14
- /**
15
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur)
16
- */
17
- @send
18
- external blur: htmlElement => unit = "blur"
19
-
20
- /**
21
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
22
-
23
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
24
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
25
- */
26
- @send
27
- external prepend: (htmlElement, node) => unit = "prepend"
28
-
29
- /**
30
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
31
-
32
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
33
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
34
- */
35
- @send
36
- external prepend2: (htmlElement, string) => unit = "prepend"
37
-
38
- /**
39
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
40
-
41
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
42
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
43
- */
44
- @send
45
- external append: (htmlElement, node) => unit = "append"
46
-
47
- /**
48
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
49
-
50
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
51
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
52
- */
53
- @send
54
- external append2: (htmlElement, string) => unit = "append"
55
-
56
- /**
57
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
58
-
59
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
60
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
61
- */
62
- @send
63
- external replaceChildren: (htmlElement, node) => unit = "replaceChildren"
64
-
65
- /**
66
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
67
-
68
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
69
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
70
- */
71
- @send
72
- external replaceChildren2: (htmlElement, string) => unit = "replaceChildren"
73
-
74
- /**
75
- Returns the first element that is a descendant of node that matches selectors.
76
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
77
- */
78
- @send
79
- external querySelector: (htmlElement, string) => element = "querySelector"
80
-
81
- /**
82
- Returns all element descendants of node that match selectors.
83
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
84
- */
85
- @send
86
- external querySelectorAll: (htmlElement, string) => nodeList = "querySelectorAll"
87
-
88
- /**
89
- Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
90
-
91
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
92
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
93
- */
94
- @send
95
- external before: (htmlElement, node) => unit = "before"
96
-
97
- /**
98
- Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
99
-
100
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
101
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
102
- */
103
- @send
104
- external before2: (htmlElement, string) => unit = "before"
105
-
106
- /**
107
- Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
108
-
109
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
110
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
111
- */
112
- @send
113
- external after: (htmlElement, node) => unit = "after"
114
-
115
- /**
116
- Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
117
-
118
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
119
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
120
- */
121
- @send
122
- external after2: (htmlElement, string) => unit = "after"
123
-
124
- /**
125
- Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
126
-
127
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
128
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
129
- */
130
- @send
131
- external replaceWith: (htmlElement, node) => unit = "replaceWith"
132
-
133
- /**
134
- Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
135
-
136
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
137
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
138
- */
139
- @send
140
- external replaceWith2: (htmlElement, string) => unit = "replaceWith"
141
-
142
- /**
143
- Removes node.
144
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
145
- */
146
- @send
147
- external remove: htmlElement => unit = "remove"
148
-
149
- /**
150
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
151
- */
152
- @send
153
- external animate: (htmlElement, ~keyframes: any, ~options: float=?) => animation = "animate"
154
-
155
- /**
156
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
157
- */
158
- @send
159
- external animate2: (
160
- htmlElement,
161
- ~keyframes: any,
162
- ~options: keyframeAnimationOptions=?,
163
- ) => animation = "animate"
164
-
165
- /**
166
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)
167
- */
168
- @send
169
- external getAnimations: (htmlElement, ~options: getAnimationsOptions=?) => array<animation> =
170
- "getAnimations"
171
-
172
- /**
173
- 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.
174
-
175
- 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.
176
-
177
- 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.
178
-
179
- 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.
180
-
181
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
182
-
183
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
184
-
185
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
186
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
187
- */
188
- @send
189
- external addEventListener: (
190
- htmlElement,
191
- ~type_: eventType,
192
- ~callback: eventListener<'event>,
193
- ~options: addEventListenerOptions=?,
194
- ) => unit = "addEventListener"
195
-
196
- /**
197
- 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.
198
-
199
- 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.
200
-
201
- 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.
202
-
203
- 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.
204
-
205
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
206
-
207
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
208
-
209
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
210
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
211
- */
212
- @send
213
- external addEventListener2: (
214
- htmlElement,
215
- ~type_: eventType,
216
- ~callback: eventListener<'event>,
217
- ~options: bool=?,
218
- ) => unit = "addEventListener"
219
-
220
- /**
221
- Removes the event listener in target's event listener list with the same type, callback, and options.
222
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
223
- */
224
- @send
225
- external removeEventListener: (
226
- htmlElement,
227
- ~type_: eventType,
228
- ~callback: eventListener<'event>,
229
- ~options: eventListenerOptions=?,
230
- ) => unit = "removeEventListener"
231
-
232
- /**
233
- Removes the event listener in target's event listener list with the same type, callback, and options.
234
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
235
- */
236
- @send
237
- external removeEventListener2: (
238
- htmlElement,
239
- ~type_: eventType,
240
- ~callback: eventListener<'event>,
241
- ~options: bool=?,
242
- ) => unit = "removeEventListener"
243
-
244
- /**
245
- 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.
246
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
247
- */
248
- @send
249
- external dispatchEvent: (htmlElement, event) => bool = "dispatchEvent"
3
+ module Impl = (
4
+ T: {
5
+ type t
6
+ },
7
+ ) => {
8
+ include Element.Impl({
9
+ type t = T.t
10
+ })
250
11
 
251
- /**
252
- Returns node's root.
253
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
254
- */
255
- @send
256
- external getRootNode: (htmlElement, ~options: getRootNodeOptions=?) => node = "getRootNode"
257
-
258
- /**
259
- Returns whether node has children.
260
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
261
- */
262
- @send
263
- external hasChildNodes: htmlElement => bool = "hasChildNodes"
264
-
265
- /**
266
- Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
267
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
268
- */
269
- @send
270
- external normalize: htmlElement => unit = "normalize"
271
-
272
- /**
273
- Returns a copy of node. If deep is true, the copy also includes the node's descendants.
274
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
275
- */
276
- @send
277
- external cloneNode: (htmlElement, ~deep: bool=?) => node = "cloneNode"
278
-
279
- /**
280
- Returns whether node and otherNode have the same properties.
281
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
282
- */
283
- @send
284
- external isEqualNode: (htmlElement, node) => bool = "isEqualNode"
285
-
286
- /**
287
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)
288
- */
289
- @send
290
- external isSameNode: (htmlElement, node) => bool = "isSameNode"
291
-
292
- /**
293
- Returns a bitmask indicating the position of other relative to node.
294
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
295
- */
296
- @send
297
- external compareDocumentPosition: (htmlElement, node) => int = "compareDocumentPosition"
298
-
299
- /**
300
- Returns true if other is an inclusive descendant of node, and false otherwise.
301
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
302
- */
303
- @send
304
- external contains: (htmlElement, node) => bool = "contains"
305
-
306
- /**
307
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)
308
- */
309
- @send
310
- external lookupPrefix: (htmlElement, string) => string = "lookupPrefix"
311
-
312
- /**
313
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)
314
- */
315
- @send
316
- external lookupNamespaceURI: (htmlElement, string) => string = "lookupNamespaceURI"
317
-
318
- /**
319
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)
320
- */
321
- @send
322
- external isDefaultNamespace: (htmlElement, string) => bool = "isDefaultNamespace"
323
-
324
- /**
325
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)
326
- */
327
- @send
328
- external insertBefore: (htmlElement, 't, ~child: node) => 't = "insertBefore"
329
-
330
- /**
331
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild)
332
- */
333
- @send
334
- external appendChild: (htmlElement, 't) => 't = "appendChild"
12
+ external asHTMLElement: T.t => htmlElement = "%identity"
335
13
 
336
- /**
337
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)
338
- */
339
- @send
340
- external replaceChild: (htmlElement, ~node: node, 't) => 't = "replaceChild"
341
-
342
- /**
343
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild)
344
- */
345
- @send
346
- external removeChild: (htmlElement, 't) => 't = "removeChild"
347
-
348
- /**
349
- Returns true if element has attributes, and false otherwise.
350
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes)
351
- */
352
- @send
353
- external hasAttributes: htmlElement => bool = "hasAttributes"
354
-
355
- /**
356
- Returns the qualified names of all element's attributes. Can contain duplicates.
357
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames)
358
- */
359
- @send
360
- external getAttributeNames: htmlElement => array<string> = "getAttributeNames"
361
-
362
- /**
363
- Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
364
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute)
365
- */
366
- @send
367
- external getAttribute: (htmlElement, string) => string = "getAttribute"
368
-
369
- /**
370
- Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
371
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS)
372
- */
373
- @send
374
- external getAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => string =
375
- "getAttributeNS"
376
-
377
- /**
378
- Sets the value of element's first attribute whose qualified name is qualifiedName to value.
379
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute)
380
- */
381
- @send
382
- external setAttribute: (htmlElement, ~qualifiedName: string, ~value: string) => unit =
383
- "setAttribute"
384
-
385
- /**
386
- Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
387
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS)
388
- */
389
- @send
390
- external setAttributeNS: (
391
- htmlElement,
392
- ~namespace: string,
393
- ~qualifiedName: string,
394
- ~value: string,
395
- ) => unit = "setAttributeNS"
396
-
397
- /**
398
- Removes element's first attribute whose qualified name is qualifiedName.
399
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute)
400
- */
401
- @send
402
- external removeAttribute: (htmlElement, string) => unit = "removeAttribute"
403
-
404
- /**
405
- Removes element's attribute whose namespace is namespace and local name is localName.
406
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS)
407
- */
408
- @send
409
- external removeAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => unit =
410
- "removeAttributeNS"
411
-
412
- /**
413
- 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.
414
-
415
- Returns true if qualifiedName is now present, and false otherwise.
416
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute)
417
- */
418
- @send
419
- external toggleAttribute: (htmlElement, ~qualifiedName: string, ~force: bool=?) => bool =
420
- "toggleAttribute"
421
-
422
- /**
423
- Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
424
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute)
425
- */
426
- @send
427
- external hasAttribute: (htmlElement, string) => bool = "hasAttribute"
428
-
429
- /**
430
- Returns true if element has an attribute whose namespace is namespace and local name is localName.
431
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS)
432
- */
433
- @send
434
- external hasAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => bool =
435
- "hasAttributeNS"
436
-
437
- /**
438
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode)
439
- */
440
- @send
441
- external getAttributeNode: (htmlElement, string) => attr = "getAttributeNode"
442
-
443
- /**
444
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS)
445
- */
446
- @send
447
- external getAttributeNodeNS: (htmlElement, ~namespace: string, ~localName: string) => attr =
448
- "getAttributeNodeNS"
449
-
450
- /**
451
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode)
452
- */
453
- @send
454
- external setAttributeNode: (htmlElement, attr) => attr = "setAttributeNode"
455
-
456
- /**
457
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
458
- */
459
- @send
460
- external setAttributeNodeNS: (htmlElement, attr) => attr = "setAttributeNodeNS"
461
-
462
- /**
463
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode)
464
- */
465
- @send
466
- external removeAttributeNode: (htmlElement, attr) => attr = "removeAttributeNode"
467
-
468
- /**
469
- Creates a shadow root for element and returns it.
470
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow)
471
- */
472
- @send
473
- external attachShadow: (htmlElement, shadowRootInit) => shadowRoot = "attachShadow"
474
-
475
- /**
476
- Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
477
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest)
478
- */
479
- @send
480
- external closest: (htmlElement, string) => 'e = "closest"
481
-
482
- /**
483
- Returns true if matching selectors against element's root yields element, and false otherwise.
484
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches)
485
- */
486
- @send
487
- external matches: (htmlElement, string) => bool = "matches"
488
-
489
- /**
490
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName)
491
- */
492
- @send
493
- external getElementsByTagName: (htmlElement, string) => htmlCollection = "getElementsByTagName"
494
-
495
- /**
496
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
497
- */
498
- @send
499
- external getElementsByTagNameNS: (
500
- htmlElement,
501
- ~namespace: string,
502
- ~localName: string,
503
- ) => htmlCollectionOf<element> = "getElementsByTagNameNS"
504
-
505
- /**
506
- 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.
507
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName)
508
- */
509
- @send
510
- external getElementsByClassName: (htmlElement, string) => htmlCollectionOf<element> =
511
- "getElementsByClassName"
512
-
513
- /**
514
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement)
515
- */
516
- @send
517
- external insertAdjacentElement: (
518
- htmlElement,
519
- ~where: insertPosition,
520
- ~element: element,
521
- ) => element = "insertAdjacentElement"
522
-
523
- /**
524
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText)
525
- */
526
- @send
527
- external insertAdjacentText: (htmlElement, ~where: insertPosition, ~data: string) => unit =
528
- "insertAdjacentText"
529
-
530
- /**
531
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap)
532
- */
533
- @send
534
- external computedStyleMap: htmlElement => stylePropertyMapReadOnly = "computedStyleMap"
535
-
536
- /**
537
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects)
538
- */
539
- @send
540
- external getClientRects: htmlElement => domRectList = "getClientRects"
541
-
542
- /**
543
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect)
544
- */
545
- @send
546
- external getBoundingClientRect: htmlElement => domRect = "getBoundingClientRect"
547
-
548
- /**
549
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility)
550
- */
551
- @send
552
- external checkVisibility: (htmlElement, ~options: checkVisibilityOptions=?) => bool =
553
- "checkVisibility"
554
-
555
- /**
556
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
557
- */
558
- @send
559
- external scrollIntoView: (htmlElement, ~arg: bool=?) => unit = "scrollIntoView"
560
-
561
- /**
562
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
563
- */
564
- @send
565
- external scrollIntoView2: (htmlElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView"
566
-
567
- /**
568
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
569
- */
570
- @send
571
- external scroll: (htmlElement, ~options: scrollToOptions=?) => unit = "scroll"
572
-
573
- /**
574
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
575
- */
576
- @send
577
- external scroll2: (htmlElement, ~x: float, ~y: float) => unit = "scroll"
578
-
579
- /**
580
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
581
- */
582
- @send
583
- external scrollTo: (htmlElement, ~options: scrollToOptions=?) => unit = "scrollTo"
584
-
585
- /**
586
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
587
- */
588
- @send
589
- external scrollTo2: (htmlElement, ~x: float, ~y: float) => unit = "scrollTo"
590
-
591
- /**
592
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
593
- */
594
- @send
595
- external scrollBy: (htmlElement, ~options: scrollToOptions=?) => unit = "scrollBy"
596
-
597
- /**
598
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
599
- */
600
- @send
601
- external scrollBy2: (htmlElement, ~x: float, ~y: float) => unit = "scrollBy"
602
-
603
- /**
604
- Displays element fullscreen and resolves promise when done.
605
-
606
- 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.
607
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen)
608
- */
609
- @send
610
- external requestFullscreen: (htmlElement, ~options: fullscreenOptions=?) => Promise.t<unit> =
611
- "requestFullscreen"
612
-
613
- /**
614
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe)
615
- */
616
- @send
617
- external setHTMLUnsafe: (htmlElement, string) => unit = "setHTMLUnsafe"
618
-
619
- /**
620
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML)
621
- */
622
- @send
623
- external getHTML: (htmlElement, ~options: getHTMLOptions=?) => string = "getHTML"
624
-
625
- /**
626
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML)
627
- */
628
- @send
629
- external insertAdjacentHTML: (htmlElement, ~position: insertPosition, ~string: string) => unit =
630
- "insertAdjacentHTML"
631
-
632
- /**
633
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture)
634
- */
635
- @send
636
- external setPointerCapture: (htmlElement, int) => unit = "setPointerCapture"
637
-
638
- /**
639
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture)
640
- */
641
- @send
642
- external releasePointerCapture: (htmlElement, int) => unit = "releasePointerCapture"
643
-
644
- /**
645
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture)
14
+ /**
15
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals)
646
16
  */
647
- @send
648
- external hasPointerCapture: (htmlElement, int) => bool = "hasPointerCapture"
17
+ @send
18
+ external attachInternals: T.t => elementInternals = "attachInternals"
649
19
 
650
- /**
651
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock)
20
+ /**
21
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur)
652
22
  */
653
- @send
654
- external requestPointerLock: (htmlElement, ~options: pointerLockOptions=?) => Promise.t<unit> =
655
- "requestPointerLock"
23
+ @send
24
+ external blur: T.t => unit = "blur"
656
25
 
657
- /**
26
+ /**
658
27
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click)
659
28
  */
660
- @send
661
- external click: htmlElement => unit = "click"
29
+ @send
30
+ external click: T.t => unit = "click"
662
31
 
663
- /**
664
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals)
32
+ /**
33
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus)
665
34
  */
666
- @send
667
- external attachInternals: htmlElement => elementInternals = "attachInternals"
35
+ @send
36
+ external focus: (T.t, ~options: focusOptions=?) => unit = "focus"
668
37
 
669
- /**
670
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover)
38
+ /**
39
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover)
671
40
  */
672
- @send
673
- external showPopover: htmlElement => unit = "showPopover"
41
+ @send
42
+ external hidePopover: T.t => unit = "hidePopover"
674
43
 
675
- /**
676
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover)
44
+ /**
45
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover)
677
46
  */
678
- @send
679
- external hidePopover: htmlElement => unit = "hidePopover"
47
+ @send
48
+ external showPopover: T.t => unit = "showPopover"
680
49
 
681
- /**
50
+ /**
682
51
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover)
683
52
  */
684
- @send
685
- external togglePopover: (htmlElement, ~force: bool=?) => bool = "togglePopover"
53
+ @send
54
+ external togglePopover: (T.t, ~force: bool=?) => bool = "togglePopover"
55
+ }
56
+
57
+ include Impl({
58
+ type t = htmlElement
59
+ })