@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
@@ -8,8 +8,10 @@ open ViewTransitionsAPI
8
8
  @new
9
9
  external make: unit => document = "Document"
10
10
 
11
- external asNode: document => node = "%identity"
12
- external asEventTarget: document => eventTarget = "%identity"
11
+ include Node.Impl({
12
+ type t = document
13
+ })
14
+
13
15
  /**
14
16
  Returns the first element within node's descendants whose ID is elementId.
15
17
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById)
@@ -114,182 +116,6 @@ external evaluate: (
114
116
  ~result: xPathResult=?,
115
117
  ) => xPathResult = "evaluate"
116
118
 
117
- /**
118
- 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.
119
-
120
- 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.
121
-
122
- 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.
123
-
124
- 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.
125
-
126
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
127
-
128
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
129
-
130
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
131
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
132
- */
133
- @send
134
- external addEventListener: (
135
- document,
136
- ~type_: eventType,
137
- ~callback: eventListener<'event>,
138
- ~options: addEventListenerOptions=?,
139
- ) => unit = "addEventListener"
140
-
141
- /**
142
- 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.
143
-
144
- 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.
145
-
146
- 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.
147
-
148
- 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.
149
-
150
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
151
-
152
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
153
-
154
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
155
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
156
- */
157
- @send
158
- external addEventListener2: (
159
- document,
160
- ~type_: eventType,
161
- ~callback: eventListener<'event>,
162
- ~options: bool=?,
163
- ) => unit = "addEventListener"
164
-
165
- /**
166
- Removes the event listener in target's event listener list with the same type, callback, and options.
167
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
168
- */
169
- @send
170
- external removeEventListener: (
171
- document,
172
- ~type_: eventType,
173
- ~callback: eventListener<'event>,
174
- ~options: eventListenerOptions=?,
175
- ) => unit = "removeEventListener"
176
-
177
- /**
178
- Removes the event listener in target's event listener list with the same type, callback, and options.
179
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
180
- */
181
- @send
182
- external removeEventListener2: (
183
- document,
184
- ~type_: eventType,
185
- ~callback: eventListener<'event>,
186
- ~options: bool=?,
187
- ) => unit = "removeEventListener"
188
-
189
- /**
190
- 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.
191
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
192
- */
193
- @send
194
- external dispatchEvent: (document, event) => bool = "dispatchEvent"
195
-
196
- /**
197
- Returns node's root.
198
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
199
- */
200
- @send
201
- external getRootNode: (document, ~options: getRootNodeOptions=?) => node = "getRootNode"
202
-
203
- /**
204
- Returns whether node has children.
205
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
206
- */
207
- @send
208
- external hasChildNodes: document => bool = "hasChildNodes"
209
-
210
- /**
211
- Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
212
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
213
- */
214
- @send
215
- external normalize: document => unit = "normalize"
216
-
217
- /**
218
- Returns a copy of node. If deep is true, the copy also includes the node's descendants.
219
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
220
- */
221
- @send
222
- external cloneNode: (document, ~deep: bool=?) => node = "cloneNode"
223
-
224
- /**
225
- Returns whether node and otherNode have the same properties.
226
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
227
- */
228
- @send
229
- external isEqualNode: (document, node) => bool = "isEqualNode"
230
-
231
- /**
232
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)
233
- */
234
- @send
235
- external isSameNode: (document, node) => bool = "isSameNode"
236
-
237
- /**
238
- Returns a bitmask indicating the position of other relative to node.
239
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
240
- */
241
- @send
242
- external compareDocumentPosition: (document, node) => int = "compareDocumentPosition"
243
-
244
- /**
245
- Returns true if other is an inclusive descendant of node, and false otherwise.
246
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
247
- */
248
- @send
249
- external contains: (document, node) => bool = "contains"
250
-
251
- /**
252
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)
253
- */
254
- @send
255
- external lookupPrefix: (document, string) => string = "lookupPrefix"
256
-
257
- /**
258
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)
259
- */
260
- @send
261
- external lookupNamespaceURI: (document, string) => string = "lookupNamespaceURI"
262
-
263
- /**
264
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)
265
- */
266
- @send
267
- external isDefaultNamespace: (document, string) => bool = "isDefaultNamespace"
268
-
269
- /**
270
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)
271
- */
272
- @send
273
- external insertBefore: (document, 't, ~child: node) => 't = "insertBefore"
274
-
275
- /**
276
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild)
277
- */
278
- @send
279
- external appendChild: (document, 't) => 't = "appendChild"
280
-
281
- /**
282
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)
283
- */
284
- @send
285
- external replaceChild: (document, ~node: node, 't) => 't = "replaceChild"
286
-
287
- /**
288
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild)
289
- */
290
- @send
291
- external removeChild: (document, 't) => 't = "removeChild"
292
-
293
119
  /**
294
120
  Retrieves a collection of objects based on the specified element name.
295
121
  @param name Specifies the name of an element.
@@ -2,260 +2,98 @@ open DOMAPI
2
2
  open EventAPI
3
3
 
4
4
  /**
5
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment)
5
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragmentFragment)
6
6
  */
7
7
  @new
8
8
  external make: unit => documentFragment = "DocumentFragment"
9
9
 
10
- external asNode: documentFragment => node = "%identity"
11
- external asEventTarget: documentFragment => eventTarget = "%identity"
12
- /**
13
- Returns the first element within node's descendants whose ID is elementId.
14
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById)
15
- */
16
- @send
17
- external getElementById: (documentFragment, string) => element = "getElementById"
18
-
19
- /**
20
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
10
+ module Impl = (
11
+ T: {
12
+ type t
13
+ },
14
+ ) => {
15
+ include Node.Impl({
16
+ type t = T.t
17
+ })
21
18
 
22
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
23
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
24
- */
25
- @send
26
- external prepend: (documentFragment, node) => unit = "prepend"
19
+ external asDocumentFragment: T.t => documentFragment = "%identity"
27
20
 
28
- /**
29
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
21
+ /**
22
+ Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
30
23
 
31
24
  Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
32
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
25
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append)
33
26
  */
34
- @send
35
- external prepend2: (documentFragment, string) => unit = "prepend"
27
+ @send
28
+ external append: (T.t, node) => unit = "append"
36
29
 
37
- /**
30
+ /**
38
31
  Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
39
32
 
40
33
  Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
41
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
34
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append)
42
35
  */
43
- @send
44
- external append: (documentFragment, node) => unit = "append"
36
+ @send
37
+ external append2: (T.t, string) => unit = "append"
45
38
 
46
- /**
47
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
48
-
49
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
50
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
39
+ /**
40
+ Returns the first element within node's descendants whose ID is elementId.
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/getElementById)
51
42
  */
52
- @send
53
- external append2: (documentFragment, string) => unit = "append"
43
+ @send
44
+ external getElementById: (T.t, string) => element = "getElementById"
54
45
 
55
- /**
56
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
46
+ /**
47
+ Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
57
48
 
58
49
  Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
59
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
50
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend)
60
51
  */
61
- @send
62
- external replaceChildren: (documentFragment, node) => unit = "replaceChildren"
52
+ @send
53
+ external prepend: (T.t, node) => unit = "prepend"
63
54
 
64
- /**
65
- Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
55
+ /**
56
+ Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
66
57
 
67
58
  Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
68
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
59
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend)
69
60
  */
70
- @send
71
- external replaceChildren2: (documentFragment, string) => unit = "replaceChildren"
61
+ @send
62
+ external prepend2: (T.t, string) => unit = "prepend"
72
63
 
73
- /**
64
+ /**
74
65
  Returns the first element that is a descendant of node that matches selectors.
75
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
66
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector)
76
67
  */
77
- @send
78
- external querySelector: (documentFragment, string) => element = "querySelector"
68
+ @send
69
+ external querySelector: (T.t, string) => element = "querySelector"
79
70
 
80
- /**
71
+ /**
81
72
  Returns all element descendants of node that match selectors.
82
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
83
- */
84
- @send
85
- external querySelectorAll: (documentFragment, string) => nodeList = "querySelectorAll"
86
-
87
- /**
88
- 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.
89
-
90
- 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.
91
-
92
- 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.
93
-
94
- 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.
95
-
96
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
97
-
98
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
99
-
100
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
101
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
102
- */
103
- @send
104
- external addEventListener: (
105
- documentFragment,
106
- ~type_: eventType,
107
- ~callback: eventListener<'event>,
108
- ~options: addEventListenerOptions=?,
109
- ) => unit = "addEventListener"
110
-
111
- /**
112
- 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.
113
-
114
- 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.
115
-
116
- 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.
117
-
118
- 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.
119
-
120
- When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
121
-
122
- If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
123
-
124
- The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
125
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
126
- */
127
- @send
128
- external addEventListener2: (
129
- documentFragment,
130
- ~type_: eventType,
131
- ~callback: eventListener<'event>,
132
- ~options: bool=?,
133
- ) => unit = "addEventListener"
134
-
135
- /**
136
- Removes the event listener in target's event listener list with the same type, callback, and options.
137
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
138
- */
139
- @send
140
- external removeEventListener: (
141
- documentFragment,
142
- ~type_: eventType,
143
- ~callback: eventListener<'event>,
144
- ~options: eventListenerOptions=?,
145
- ) => unit = "removeEventListener"
146
-
147
- /**
148
- Removes the event listener in target's event listener list with the same type, callback, and options.
149
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
150
- */
151
- @send
152
- external removeEventListener2: (
153
- documentFragment,
154
- ~type_: eventType,
155
- ~callback: eventListener<'event>,
156
- ~options: bool=?,
157
- ) => unit = "removeEventListener"
158
-
159
- /**
160
- 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.
161
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
162
- */
163
- @send
164
- external dispatchEvent: (documentFragment, event) => bool = "dispatchEvent"
165
-
166
- /**
167
- Returns node's root.
168
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
169
- */
170
- @send
171
- external getRootNode: (documentFragment, ~options: getRootNodeOptions=?) => node = "getRootNode"
172
-
173
- /**
174
- Returns whether node has children.
175
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
176
- */
177
- @send
178
- external hasChildNodes: documentFragment => bool = "hasChildNodes"
179
-
180
- /**
181
- Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
182
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
183
- */
184
- @send
185
- external normalize: documentFragment => unit = "normalize"
186
-
187
- /**
188
- Returns a copy of node. If deep is true, the copy also includes the node's descendants.
189
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
190
- */
191
- @send
192
- external cloneNode: (documentFragment, ~deep: bool=?) => node = "cloneNode"
193
-
194
- /**
195
- Returns whether node and otherNode have the same properties.
196
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
197
- */
198
- @send
199
- external isEqualNode: (documentFragment, node) => bool = "isEqualNode"
200
-
201
- /**
202
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)
73
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll)
203
74
  */
204
- @send
205
- external isSameNode: (documentFragment, node) => bool = "isSameNode"
75
+ @send
76
+ external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll"
206
77
 
207
- /**
208
- Returns a bitmask indicating the position of other relative to node.
209
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
210
- */
211
- @send
212
- external compareDocumentPosition: (documentFragment, node) => int = "compareDocumentPosition"
213
-
214
- /**
215
- Returns true if other is an inclusive descendant of node, and false otherwise.
216
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
217
- */
218
- @send
219
- external contains: (documentFragment, node) => bool = "contains"
220
-
221
- /**
222
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)
223
- */
224
- @send
225
- external lookupPrefix: (documentFragment, string) => string = "lookupPrefix"
226
-
227
- /**
228
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)
229
- */
230
- @send
231
- external lookupNamespaceURI: (documentFragment, string) => string = "lookupNamespaceURI"
232
-
233
- /**
234
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)
235
- */
236
- @send
237
- external isDefaultNamespace: (documentFragment, string) => bool = "isDefaultNamespace"
78
+ /**
79
+ Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
238
80
 
239
- /**
240
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)
81
+ Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
82
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren)
241
83
  */
242
- @send
243
- external insertBefore: (documentFragment, 't, ~child: node) => 't = "insertBefore"
84
+ @send
85
+ external replaceChildren: (T.t, node) => unit = "replaceChildren"
244
86
 
245
- /**
246
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild)
247
- */
248
- @send
249
- external appendChild: (documentFragment, 't) => 't = "appendChild"
87
+ /**
88
+ Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
250
89
 
251
- /**
252
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)
90
+ Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
91
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren)
253
92
  */
254
- @send
255
- external replaceChild: (documentFragment, ~node: node, 't) => 't = "replaceChild"
93
+ @send
94
+ external replaceChildren2: (T.t, string) => unit = "replaceChildren"
95
+ }
256
96
 
257
- /**
258
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild)
259
- */
260
- @send
261
- external removeChild: (documentFragment, 't) => 't = "removeChild"
97
+ include Impl({
98
+ type t = documentFragment
99
+ })