@rescript/webapi 0.1.0-experimental-d3d4b5f → 0.1.0-experimental-fb395c3
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.
- package/package.json +2 -2
- package/src/CSSFontLoadingAPI/FontFaceSet.res +3 -79
- package/src/CanvasAPI/OffscreenCanvas.res +3 -79
- package/src/ChannelMessagingAPI/MessagePort.res +3 -81
- package/src/ClipboardAPI/Clipboard.res +3 -80
- package/src/DOMAPI/Animation.res +3 -80
- package/src/DOMAPI/CharacterData.res +68 -231
- package/src/DOMAPI/Comment.res +4 -271
- package/src/DOMAPI/Document.res +4 -178
- package/src/DOMAPI/DocumentFragment.res +58 -220
- package/src/DOMAPI/Element.res +313 -477
- package/src/DOMAPI/HTMLAnchorElement.res +3 -691
- package/src/DOMAPI/HTMLAreaElement.res +3 -685
- package/src/DOMAPI/HTMLAudioElement.res +3 -748
- package/src/DOMAPI/HTMLBRElement.res +3 -684
- package/src/DOMAPI/HTMLBaseElement.res +3 -685
- package/src/DOMAPI/HTMLBodyElement.res +3 -685
- package/src/DOMAPI/HTMLButtonElement.res +3 -691
- package/src/DOMAPI/HTMLCanvasElement.res +3 -691
- package/src/DOMAPI/HTMLDListElement.res +3 -688
- package/src/DOMAPI/HTMLDataElement.res +3 -685
- package/src/DOMAPI/HTMLDataListElement.res +3 -695
- package/src/DOMAPI/HTMLDialogElement.res +3 -691
- package/src/DOMAPI/HTMLDivElement.res +3 -684
- package/src/DOMAPI/HTMLElement.res +40 -666
- package/src/DOMAPI/HTMLEmbedElement.res +3 -688
- package/src/DOMAPI/HTMLFieldSetElement.res +3 -695
- package/src/DOMAPI/HTMLFormElement.res +3 -685
- package/src/DOMAPI/HTMLFrameSetElement.res +3 -695
- package/src/DOMAPI/HTMLHRElement.res +3 -684
- package/src/DOMAPI/HTMLHeadElement.res +3 -685
- package/src/DOMAPI/HTMLHeadingElement.res +3 -691
- package/src/DOMAPI/HTMLHtmlElement.res +3 -685
- package/src/DOMAPI/HTMLIFrameElement.res +3 -691
- package/src/DOMAPI/HTMLImageElement.res +3 -688
- package/src/DOMAPI/HTMLInputElement.res +3 -688
- package/src/DOMAPI/HTMLLIElement.res +3 -684
- package/src/DOMAPI/HTMLLabelElement.res +3 -688
- package/src/DOMAPI/HTMLLegendElement.res +3 -691
- package/src/DOMAPI/HTMLLinkElement.res +3 -685
- package/src/DOMAPI/HTMLMapElement.res +3 -684
- package/src/DOMAPI/HTMLMediaElement.res +49 -722
- package/src/DOMAPI/HTMLMenuElement.res +3 -685
- package/src/DOMAPI/HTMLMetaElement.res +3 -685
- package/src/DOMAPI/HTMLMeterElement.res +3 -688
- package/src/DOMAPI/HTMLModElement.res +3 -684
- package/src/DOMAPI/HTMLOListElement.res +3 -688
- package/src/DOMAPI/HTMLObjectElement.res +3 -691
- package/src/DOMAPI/HTMLOptGroupElement.res +3 -695
- package/src/DOMAPI/HTMLOptionElement.res +3 -691
- package/src/DOMAPI/HTMLOutputElement.res +3 -691
- package/src/DOMAPI/HTMLParagraphElement.res +3 -699
- package/src/DOMAPI/HTMLPictureElement.res +3 -691
- package/src/DOMAPI/HTMLPreElement.res +3 -684
- package/src/DOMAPI/HTMLProgressElement.res +3 -695
- package/src/DOMAPI/HTMLQuoteElement.res +3 -688
- package/src/DOMAPI/HTMLScriptElement.res +3 -691
- package/src/DOMAPI/HTMLSelectElement.res +4 -692
- package/src/DOMAPI/HTMLSlotElement.res +3 -685
- package/src/DOMAPI/HTMLSourceElement.res +3 -691
- package/src/DOMAPI/HTMLSpanElement.res +3 -685
- package/src/DOMAPI/HTMLStyleElement.res +3 -688
- package/src/DOMAPI/HTMLTableCaptionElement.res +3 -712
- package/src/DOMAPI/HTMLTableCellElement.res +3 -699
- package/src/DOMAPI/HTMLTableElement.res +3 -688
- package/src/DOMAPI/HTMLTableRowElement.res +3 -695
- package/src/DOMAPI/HTMLTableSectionElement.res +3 -712
- package/src/DOMAPI/HTMLTemplateElement.res +3 -695
- package/src/DOMAPI/HTMLTextAreaElement.res +3 -695
- package/src/DOMAPI/HTMLTimeElement.res +3 -685
- package/src/DOMAPI/HTMLTitleElement.res +3 -688
- package/src/DOMAPI/HTMLTrackElement.res +3 -688
- package/src/DOMAPI/HTMLUListElement.res +3 -688
- package/src/DOMAPI/HTMLVideoElement.res +3 -748
- package/src/DOMAPI/MediaQueryList.res +3 -80
- package/src/DOMAPI/Node.res +59 -124
- package/src/DOMAPI/SVGGraphicsElement.res +4 -660
- package/src/DOMAPI/ScreenOrientation.res +3 -79
- package/src/DOMAPI/ShadowRoot.res +4 -255
- package/src/DOMAPI/Text.res +4 -271
- package/src/DOMAPI/TextTrackList.res +3 -79
- package/src/DOMAPI/Window.res +4 -80
- package/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +3 -80
- package/src/EventAPI/AbortSignal.res +3 -80
- package/src/EventAPI/Event.res +28 -16
- package/src/EventAPI/EventTarget.res +51 -39
- package/src/FileAPI/Blob.res +26 -15
- package/src/FileAPI/File.res +4 -31
- package/src/IndexedDBAPI/IDBDatabase.res +3 -79
- package/src/IndexedDBAPI/IDBTransaction.res +3 -80
- package/src/MediaCaptureAndStreamsAPI/MediaDevices.res +3 -79
- package/src/MediaCaptureAndStreamsAPI/MediaStream.res +3 -80
- package/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res +3 -81
- package/src/NotificationAPI/Notification.res +3 -80
- package/src/PerformanceAPI/Performance.res +3 -79
- package/src/RemotePlaybackAPI/RemotePlayback.res +3 -80
- package/src/ScreenWakeLockAPI/WakeLockSentinel.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorker.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorkerContainer.res +3 -79
- package/src/ServiceWorkerAPI/ServiceWorkerRegistration.res +3 -79
- package/src/WebAudioAPI/AnalyserNode.res +4 -148
- package/src/WebAudioAPI/AudioBufferSourceNode.res +4 -162
- package/src/WebAudioAPI/AudioContext.res +4 -212
- package/src/WebAudioAPI/AudioNode.res +39 -113
- package/src/WebAudioAPI/AudioProcessingEvent.res +4 -30
- package/src/WebAudioAPI/AudioScheduledSourceNode.res +20 -162
- package/src/WebAudioAPI/AudioWorkletNode.res +4 -149
- package/src/WebAudioAPI/BaseAudioContext.res +85 -155
- package/src/WebAudioAPI/BiquadFilterNode.res +4 -149
- package/src/WebAudioAPI/ChannelMergerNode.res +4 -149
- package/src/WebAudioAPI/ChannelSplitterNode.res +4 -149
- package/src/WebAudioAPI/ConstantSourceNode.res +4 -162
- package/src/WebAudioAPI/ConvolverNode.res +4 -149
- package/src/WebAudioAPI/DelayNode.res +4 -143
- package/src/WebAudioAPI/DynamicsCompressorNode.res +4 -152
- package/src/WebAudioAPI/GainNode.res +4 -142
- package/src/WebAudioAPI/IIRFilterNode.res +4 -149
- package/src/WebAudioAPI/MediaElementAudioSourceNode.res +4 -158
- package/src/WebAudioAPI/MediaStreamAudioDestinationNode.res +4 -158
- package/src/WebAudioAPI/MediaStreamAudioSourceNode.res +4 -158
- package/src/WebAudioAPI/OfflineAudioCompletionEvent.res +4 -30
- package/src/WebAudioAPI/OfflineAudioContext.res +4 -214
- package/src/WebAudioAPI/OscillatorNode.res +4 -162
- package/src/WebAudioAPI/PannerNode.res +4 -143
- package/src/WebAudioAPI/StereoPannerNode.res +4 -149
- package/src/WebAudioAPI/WaveShaperNode.res +4 -149
- package/src/WebSocketsAPI/CloseEvent.res +4 -30
- package/src/WebSocketsAPI/WebSocket.res +3 -79
- package/src/WebSpeechAPI/SpeechSynthesis.res +3 -79
- package/src/WebSpeechAPI/SpeechSynthesisUtterance.res +4 -81
- package/src/WebStorageAPI/StorageEvent.res +4 -30
- package/src/WebVTTAPI/TextTrack.res +3 -79
|
@@ -1,272 +1,109 @@
|
|
|
1
1
|
open DOMAPI
|
|
2
2
|
open EventAPI
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
external
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
17
|
-
|
|
18
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
19
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
|
|
20
|
-
*/
|
|
21
|
-
@send
|
|
22
|
-
external before2: (characterData, string) => unit = "before"
|
|
23
|
-
|
|
24
|
-
/**
|
|
4
|
+
module Impl = (
|
|
5
|
+
T: {
|
|
6
|
+
type t
|
|
7
|
+
},
|
|
8
|
+
) => {
|
|
9
|
+
include Node.Impl({
|
|
10
|
+
type t = T.t
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
external asCharacterData: T.t => characterData = "%identity"
|
|
14
|
+
|
|
15
|
+
/**
|
|
25
16
|
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
26
17
|
|
|
27
18
|
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
28
19
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
|
|
29
20
|
*/
|
|
30
|
-
@send
|
|
31
|
-
external after: (
|
|
21
|
+
@send
|
|
22
|
+
external after: (T.t, node) => unit = "after"
|
|
32
23
|
|
|
33
|
-
/**
|
|
24
|
+
/**
|
|
34
25
|
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
35
26
|
|
|
36
27
|
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
37
28
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
|
|
38
29
|
*/
|
|
39
|
-
@send
|
|
40
|
-
external after2: (
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
30
|
+
@send
|
|
31
|
+
external after2: (T.t, string) => unit = "after"
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData)
|
|
47
35
|
*/
|
|
48
|
-
@send
|
|
49
|
-
external
|
|
36
|
+
@send
|
|
37
|
+
external appendData: (T.t, string) => unit = "appendData"
|
|
50
38
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
39
|
+
/**
|
|
40
|
+
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
53
41
|
|
|
54
42
|
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
55
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/
|
|
56
|
-
*/
|
|
57
|
-
@send
|
|
58
|
-
external replaceWith2: (characterData, string) => unit = "replaceWith"
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
Removes node.
|
|
62
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
|
|
63
|
-
*/
|
|
64
|
-
@send
|
|
65
|
-
external remove: characterData => unit = "remove"
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
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.
|
|
69
|
-
|
|
70
|
-
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.
|
|
71
|
-
|
|
72
|
-
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.
|
|
73
|
-
|
|
74
|
-
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.
|
|
75
|
-
|
|
76
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
77
|
-
|
|
78
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
79
|
-
|
|
80
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
81
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
82
|
-
*/
|
|
83
|
-
@send
|
|
84
|
-
external addEventListener: (
|
|
85
|
-
characterData,
|
|
86
|
-
~type_: eventType,
|
|
87
|
-
~callback: eventListener<'event>,
|
|
88
|
-
~options: addEventListenerOptions=?,
|
|
89
|
-
) => unit = "addEventListener"
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
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.
|
|
93
|
-
|
|
94
|
-
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.
|
|
95
|
-
|
|
96
|
-
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.
|
|
97
|
-
|
|
98
|
-
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.
|
|
99
|
-
|
|
100
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
101
|
-
|
|
102
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
103
|
-
|
|
104
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
105
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
106
|
-
*/
|
|
107
|
-
@send
|
|
108
|
-
external addEventListener2: (
|
|
109
|
-
characterData,
|
|
110
|
-
~type_: eventType,
|
|
111
|
-
~callback: eventListener<'event>,
|
|
112
|
-
~options: bool=?,
|
|
113
|
-
) => unit = "addEventListener"
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
117
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
118
|
-
*/
|
|
119
|
-
@send
|
|
120
|
-
external removeEventListener: (
|
|
121
|
-
characterData,
|
|
122
|
-
~type_: eventType,
|
|
123
|
-
~callback: eventListener<'event>,
|
|
124
|
-
~options: eventListenerOptions=?,
|
|
125
|
-
) => unit = "removeEventListener"
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
129
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
130
|
-
*/
|
|
131
|
-
@send
|
|
132
|
-
external removeEventListener2: (
|
|
133
|
-
characterData,
|
|
134
|
-
~type_: eventType,
|
|
135
|
-
~callback: eventListener<'event>,
|
|
136
|
-
~options: bool=?,
|
|
137
|
-
) => unit = "removeEventListener"
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
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.
|
|
141
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
142
|
-
*/
|
|
143
|
-
@send
|
|
144
|
-
external dispatchEvent: (characterData, event) => bool = "dispatchEvent"
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
Returns node's root.
|
|
148
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
|
|
149
|
-
*/
|
|
150
|
-
@send
|
|
151
|
-
external getRootNode: (characterData, ~options: getRootNodeOptions=?) => node = "getRootNode"
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
Returns whether node has children.
|
|
155
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
|
|
156
|
-
*/
|
|
157
|
-
@send
|
|
158
|
-
external hasChildNodes: characterData => bool = "hasChildNodes"
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
|
|
162
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
|
|
163
|
-
*/
|
|
164
|
-
@send
|
|
165
|
-
external normalize: characterData => unit = "normalize"
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
|
|
169
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
|
|
170
|
-
*/
|
|
171
|
-
@send
|
|
172
|
-
external cloneNode: (characterData, ~deep: bool=?) => node = "cloneNode"
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
Returns whether node and otherNode have the same properties.
|
|
176
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
|
|
43
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
|
|
177
44
|
*/
|
|
178
|
-
@send
|
|
179
|
-
external
|
|
45
|
+
@send
|
|
46
|
+
external before: (T.t, node) => unit = "before"
|
|
180
47
|
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
*/
|
|
184
|
-
@send
|
|
185
|
-
external isSameNode: (characterData, node) => bool = "isSameNode"
|
|
48
|
+
/**
|
|
49
|
+
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
186
50
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
|
|
51
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
52
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
|
|
190
53
|
*/
|
|
191
|
-
@send
|
|
192
|
-
external
|
|
54
|
+
@send
|
|
55
|
+
external before2: (T.t, string) => unit = "before"
|
|
193
56
|
|
|
194
|
-
/**
|
|
195
|
-
|
|
196
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
|
|
57
|
+
/**
|
|
58
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData)
|
|
197
59
|
*/
|
|
198
|
-
@send
|
|
199
|
-
external
|
|
60
|
+
@send
|
|
61
|
+
external deleteData: (T.t, ~offset: int, ~count: int) => unit = "deleteData"
|
|
200
62
|
|
|
201
|
-
/**
|
|
202
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/
|
|
63
|
+
/**
|
|
64
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData)
|
|
203
65
|
*/
|
|
204
|
-
@send
|
|
205
|
-
external
|
|
66
|
+
@send
|
|
67
|
+
external insertData: (T.t, ~offset: int, ~data: string) => unit = "insertData"
|
|
206
68
|
|
|
207
|
-
/**
|
|
208
|
-
|
|
69
|
+
/**
|
|
70
|
+
Removes node.
|
|
71
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
|
|
209
72
|
*/
|
|
210
|
-
@send
|
|
211
|
-
external
|
|
73
|
+
@send
|
|
74
|
+
external remove: T.t => unit = "remove"
|
|
212
75
|
|
|
213
|
-
/**
|
|
214
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/
|
|
76
|
+
/**
|
|
77
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData)
|
|
215
78
|
*/
|
|
216
|
-
@send
|
|
217
|
-
external
|
|
79
|
+
@send
|
|
80
|
+
external replaceData: (T.t, ~offset: int, ~count: int, ~data: string) => unit = "replaceData"
|
|
218
81
|
|
|
219
|
-
/**
|
|
220
|
-
|
|
221
|
-
*/
|
|
222
|
-
@send
|
|
223
|
-
external insertBefore: (characterData, 't, ~child: node) => 't = "insertBefore"
|
|
82
|
+
/**
|
|
83
|
+
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
224
84
|
|
|
225
|
-
|
|
226
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/
|
|
85
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
86
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
|
|
227
87
|
*/
|
|
228
|
-
@send
|
|
229
|
-
external
|
|
88
|
+
@send
|
|
89
|
+
external replaceWith: (T.t, node) => unit = "replaceWith"
|
|
230
90
|
|
|
231
|
-
/**
|
|
232
|
-
|
|
233
|
-
*/
|
|
234
|
-
@send
|
|
235
|
-
external replaceChild: (characterData, ~node: node, 't) => 't = "replaceChild"
|
|
91
|
+
/**
|
|
92
|
+
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
236
93
|
|
|
237
|
-
|
|
238
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/
|
|
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/replaceWith)
|
|
239
96
|
*/
|
|
240
|
-
@send
|
|
241
|
-
external
|
|
97
|
+
@send
|
|
98
|
+
external replaceWith2: (T.t, string) => unit = "replaceWith"
|
|
242
99
|
|
|
243
|
-
/**
|
|
100
|
+
/**
|
|
244
101
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData)
|
|
245
102
|
*/
|
|
246
|
-
@send
|
|
247
|
-
external substringData: (
|
|
103
|
+
@send
|
|
104
|
+
external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData"
|
|
105
|
+
}
|
|
248
106
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
@send
|
|
253
|
-
external appendData: (characterData, string) => unit = "appendData"
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData)
|
|
257
|
-
*/
|
|
258
|
-
@send
|
|
259
|
-
external insertData: (characterData, ~offset: int, ~data: string) => unit = "insertData"
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData)
|
|
263
|
-
*/
|
|
264
|
-
@send
|
|
265
|
-
external deleteData: (characterData, ~offset: int, ~count: int) => unit = "deleteData"
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData)
|
|
269
|
-
*/
|
|
270
|
-
@send
|
|
271
|
-
external replaceData: (characterData, ~offset: int, ~count: int, ~data: string) => unit =
|
|
272
|
-
"replaceData"
|
|
107
|
+
include Impl({
|
|
108
|
+
type t = characterData
|
|
109
|
+
})
|
package/src/DOMAPI/Comment.res
CHANGED
|
@@ -1,278 +1,11 @@
|
|
|
1
1
|
open DOMAPI
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
include CharacterData.Impl({
|
|
4
|
+
type t = comment
|
|
5
|
+
})
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Comment)
|
|
6
9
|
*/
|
|
7
10
|
@new
|
|
8
11
|
external make: (~data: string=?) => comment = "Comment"
|
|
9
|
-
|
|
10
|
-
external asCharacterData: comment => characterData = "%identity"
|
|
11
|
-
external asNode: comment => node = "%identity"
|
|
12
|
-
external asEventTarget: comment => eventTarget = "%identity"
|
|
13
|
-
/**
|
|
14
|
-
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
15
|
-
|
|
16
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
17
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
|
|
18
|
-
*/
|
|
19
|
-
@send
|
|
20
|
-
external before: (comment, node) => unit = "before"
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
24
|
-
|
|
25
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
26
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
|
|
27
|
-
*/
|
|
28
|
-
@send
|
|
29
|
-
external before2: (comment, string) => unit = "before"
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
33
|
-
|
|
34
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
35
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
|
|
36
|
-
*/
|
|
37
|
-
@send
|
|
38
|
-
external after: (comment, node) => unit = "after"
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
42
|
-
|
|
43
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
44
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after)
|
|
45
|
-
*/
|
|
46
|
-
@send
|
|
47
|
-
external after2: (comment, string) => unit = "after"
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
51
|
-
|
|
52
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
53
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
|
|
54
|
-
*/
|
|
55
|
-
@send
|
|
56
|
-
external replaceWith: (comment, node) => unit = "replaceWith"
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
60
|
-
|
|
61
|
-
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
62
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
|
|
63
|
-
*/
|
|
64
|
-
@send
|
|
65
|
-
external replaceWith2: (comment, string) => unit = "replaceWith"
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
Removes node.
|
|
69
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
|
|
70
|
-
*/
|
|
71
|
-
@send
|
|
72
|
-
external remove: comment => unit = "remove"
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
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.
|
|
76
|
-
|
|
77
|
-
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.
|
|
78
|
-
|
|
79
|
-
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.
|
|
80
|
-
|
|
81
|
-
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.
|
|
82
|
-
|
|
83
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
84
|
-
|
|
85
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
86
|
-
|
|
87
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
88
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
89
|
-
*/
|
|
90
|
-
@send
|
|
91
|
-
external addEventListener: (
|
|
92
|
-
comment,
|
|
93
|
-
~type_: eventType,
|
|
94
|
-
~callback: eventListener<'event>,
|
|
95
|
-
~options: addEventListenerOptions=?,
|
|
96
|
-
) => unit = "addEventListener"
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
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.
|
|
100
|
-
|
|
101
|
-
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.
|
|
102
|
-
|
|
103
|
-
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.
|
|
104
|
-
|
|
105
|
-
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.
|
|
106
|
-
|
|
107
|
-
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
|
108
|
-
|
|
109
|
-
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
|
|
110
|
-
|
|
111
|
-
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
|
112
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
|
|
113
|
-
*/
|
|
114
|
-
@send
|
|
115
|
-
external addEventListener2: (
|
|
116
|
-
comment,
|
|
117
|
-
~type_: eventType,
|
|
118
|
-
~callback: eventListener<'event>,
|
|
119
|
-
~options: bool=?,
|
|
120
|
-
) => unit = "addEventListener"
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
124
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
125
|
-
*/
|
|
126
|
-
@send
|
|
127
|
-
external removeEventListener: (
|
|
128
|
-
comment,
|
|
129
|
-
~type_: eventType,
|
|
130
|
-
~callback: eventListener<'event>,
|
|
131
|
-
~options: eventListenerOptions=?,
|
|
132
|
-
) => unit = "removeEventListener"
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
Removes the event listener in target's event listener list with the same type, callback, and options.
|
|
136
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
|
|
137
|
-
*/
|
|
138
|
-
@send
|
|
139
|
-
external removeEventListener2: (
|
|
140
|
-
comment,
|
|
141
|
-
~type_: eventType,
|
|
142
|
-
~callback: eventListener<'event>,
|
|
143
|
-
~options: bool=?,
|
|
144
|
-
) => unit = "removeEventListener"
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
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.
|
|
148
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
|
|
149
|
-
*/
|
|
150
|
-
@send
|
|
151
|
-
external dispatchEvent: (comment, event) => bool = "dispatchEvent"
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
Returns node's root.
|
|
155
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)
|
|
156
|
-
*/
|
|
157
|
-
@send
|
|
158
|
-
external getRootNode: (comment, ~options: getRootNodeOptions=?) => node = "getRootNode"
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
Returns whether node has children.
|
|
162
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)
|
|
163
|
-
*/
|
|
164
|
-
@send
|
|
165
|
-
external hasChildNodes: comment => bool = "hasChildNodes"
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
|
|
169
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize)
|
|
170
|
-
*/
|
|
171
|
-
@send
|
|
172
|
-
external normalize: comment => unit = "normalize"
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
|
|
176
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)
|
|
177
|
-
*/
|
|
178
|
-
@send
|
|
179
|
-
external cloneNode: (comment, ~deep: bool=?) => node = "cloneNode"
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
Returns whether node and otherNode have the same properties.
|
|
183
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)
|
|
184
|
-
*/
|
|
185
|
-
@send
|
|
186
|
-
external isEqualNode: (comment, node) => bool = "isEqualNode"
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)
|
|
190
|
-
*/
|
|
191
|
-
@send
|
|
192
|
-
external isSameNode: (comment, node) => bool = "isSameNode"
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
Returns a bitmask indicating the position of other relative to node.
|
|
196
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)
|
|
197
|
-
*/
|
|
198
|
-
@send
|
|
199
|
-
external compareDocumentPosition: (comment, node) => int = "compareDocumentPosition"
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
Returns true if other is an inclusive descendant of node, and false otherwise.
|
|
203
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains)
|
|
204
|
-
*/
|
|
205
|
-
@send
|
|
206
|
-
external contains: (comment, node) => bool = "contains"
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)
|
|
210
|
-
*/
|
|
211
|
-
@send
|
|
212
|
-
external lookupPrefix: (comment, string) => string = "lookupPrefix"
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)
|
|
216
|
-
*/
|
|
217
|
-
@send
|
|
218
|
-
external lookupNamespaceURI: (comment, string) => string = "lookupNamespaceURI"
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)
|
|
222
|
-
*/
|
|
223
|
-
@send
|
|
224
|
-
external isDefaultNamespace: (comment, string) => bool = "isDefaultNamespace"
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)
|
|
228
|
-
*/
|
|
229
|
-
@send
|
|
230
|
-
external insertBefore: (comment, 't, ~child: node) => 't = "insertBefore"
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild)
|
|
234
|
-
*/
|
|
235
|
-
@send
|
|
236
|
-
external appendChild: (comment, 't) => 't = "appendChild"
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)
|
|
240
|
-
*/
|
|
241
|
-
@send
|
|
242
|
-
external replaceChild: (comment, ~node: node, 't) => 't = "replaceChild"
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild)
|
|
246
|
-
*/
|
|
247
|
-
@send
|
|
248
|
-
external removeChild: (comment, 't) => 't = "removeChild"
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData)
|
|
252
|
-
*/
|
|
253
|
-
@send
|
|
254
|
-
external substringData: (comment, ~offset: int, ~count: int) => string = "substringData"
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData)
|
|
258
|
-
*/
|
|
259
|
-
@send
|
|
260
|
-
external appendData: (comment, string) => unit = "appendData"
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData)
|
|
264
|
-
*/
|
|
265
|
-
@send
|
|
266
|
-
external insertData: (comment, ~offset: int, ~data: string) => unit = "insertData"
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData)
|
|
270
|
-
*/
|
|
271
|
-
@send
|
|
272
|
-
external deleteData: (comment, ~offset: int, ~count: int) => unit = "deleteData"
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData)
|
|
276
|
-
*/
|
|
277
|
-
@send
|
|
278
|
-
external replaceData: (comment, ~offset: int, ~count: int, ~data: string) => unit = "replaceData"
|