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