@rescript/webapi 0.1.0-alpha-b1d58f9
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/LICENSE +21 -0
- package/README.md +35 -0
- package/package.json +61 -0
- package/rescript.json +557 -0
- package/src/animation/Animation.res +149 -0
- package/src/animation/AnimationEffect.res +71 -0
- package/src/animation/DocumentTimeline.res +8 -0
- package/src/canvas/Canvas.res +179 -0
- package/src/canvas/CanvasGradient.res +11 -0
- package/src/canvas/CanvasPattern.res +11 -0
- package/src/canvas/CanvasRenderingContext2D.res +868 -0
- package/src/canvas/CanvasTypes.res +452 -0
- package/src/canvas/FillStyle.res +25 -0
- package/src/canvas/HTMLCanvasElement.res +101 -0
- package/src/canvas/ImageBitmap.res +6 -0
- package/src/canvas/ImageBitmapRenderingContext.res +9 -0
- package/src/canvas/ImageData.res +17 -0
- package/src/canvas/OffscreenCanvas.res +87 -0
- package/src/canvas/Path2D.res +186 -0
- package/src/canvas/VideoColorSpace.res +11 -0
- package/src/canvas/VideoFrame.res +217 -0
- package/src/core/ArrayBufferTypedArrayOrDataView.res +4 -0
- package/src/core/DOM.res +1026 -0
- package/src/core/EventType.res +108 -0
- package/src/crypto/Crypto.res +11 -0
- package/src/crypto/SubtleCrypto.res +173 -0
- package/src/crypto/WebCryptoTypes.res +71 -0
- package/src/css-font-loading/BaseCSSFontLoading.res +24 -0
- package/src/css-font-loading/CssFontLoadingTypes.res +92 -0
- package/src/css-font-loading/FontFace.res +62 -0
- package/src/css-font-loading/FontFaceSet.res +38 -0
- package/src/cssom/CSSRuleList.res +5 -0
- package/src/cssom/CSSStyleDeclaration.res +1734 -0
- package/src/cssom/CSSStyleValue.res +17 -0
- package/src/cssom/MediaList.res +29 -0
- package/src/cssom/MediaQueryList.res +18 -0
- package/src/cssom/StylePropertyMap.res +56 -0
- package/src/cssom/StylePropertyMapReadOnly.res +22 -0
- package/src/cssom/StyleSheet.res +152 -0
- package/src/cssom/StyleSheetList.res +17 -0
- package/src/device/GamepadHapticActuator.res +16 -0
- package/src/device/GamepadTypes.res +86 -0
- package/src/device/Geolocation.res +31 -0
- package/src/device/GeolocationCoordinates.res +5 -0
- package/src/device/GeolocationPosition.res +5 -0
- package/src/device/GeolocationTypes.res +81 -0
- package/src/device/LockManager.res +26 -0
- package/src/device/ScreenOrientation.res +7 -0
- package/src/device/ScreenWakeLockTypes.res +26 -0
- package/src/device/WakeLock.res +8 -0
- package/src/device/WakeLockSentinel.res +7 -0
- package/src/device/WebLocksTypes.res +45 -0
- package/src/device/WebMIDI.res +7 -0
- package/src/device/WebMidiTypes.res +36 -0
- package/src/dom-nodes/AbstractRange.res +30 -0
- package/src/dom-nodes/Attr.res +101 -0
- package/src/dom-nodes/CDATASection.res +7 -0
- package/src/dom-nodes/CaretPosition.res +2 -0
- package/src/dom-nodes/CharacterData.res +199 -0
- package/src/dom-nodes/Comment.res +15 -0
- package/src/dom-nodes/DOMImplementation.res +131 -0
- package/src/dom-nodes/DOMTree.res +1653 -0
- package/src/dom-nodes/DocumentFragment.res +96 -0
- package/src/dom-nodes/Element.res +509 -0
- package/src/dom-nodes/ElementInternals.res +39 -0
- package/src/dom-nodes/HTML.res +11 -0
- package/src/dom-nodes/HTMLCollection.res +25 -0
- package/src/dom-nodes/NamedNodeMap.res +46 -0
- package/src/dom-nodes/Node.res +114 -0
- package/src/dom-nodes/NodeFilter.res +4 -0
- package/src/dom-nodes/NodeIterator.res +38 -0
- package/src/dom-nodes/NodeList.res +6 -0
- package/src/dom-nodes/ProcessingInstruction.res +15 -0
- package/src/dom-nodes/Range.res +156 -0
- package/src/dom-nodes/Selection.res +137 -0
- package/src/dom-nodes/ShadowRoot.res +23 -0
- package/src/dom-nodes/StaticRange.res +6 -0
- package/src/dom-nodes/Text.res +31 -0
- package/src/dom-nodes/TreeWalker.res +65 -0
- package/src/dom-platform/DOMException.res +7 -0
- package/src/dom-platform/DOMStringList.res +15 -0
- package/src/dom-platform/DOMStringMap.res +5 -0
- package/src/dom-platform/DOMTokenList.res +70 -0
- package/src/event/AbortController.res +9 -0
- package/src/event/AbortSignal.res +25 -0
- package/src/event/Event.res +76 -0
- package/src/event/EventTarget.res +91 -0
- package/src/event/ExtendableEvent.res +14 -0
- package/src/fetch/BodyInit.res +46 -0
- package/src/fetch/Fetch.res +12 -0
- package/src/fetch/FetchTypes.res +282 -0
- package/src/fetch/FormData.res +71 -0
- package/src/fetch/FormDataEntryValue.res +2 -0
- package/src/fetch/Headers.res +59 -0
- package/src/fetch/HeadersInit.res +16 -0
- package/src/fetch/Request.res +61 -0
- package/src/fetch/Response.res +127 -0
- package/src/file/BaseFileAndDirectoryEntries.res +72 -0
- package/src/file/Blob.res +48 -0
- package/src/file/File.res +15 -0
- package/src/file/FileAndDirectoryEntriesTypes.res +35 -0
- package/src/file/FileList.res +16 -0
- package/src/file/FileSystemDirectoryEntry.res +42 -0
- package/src/file/FileSystemDirectoryHandle.res +49 -0
- package/src/file/FileSystemDirectoryReader.res +9 -0
- package/src/file/FileSystemEntry.res +9 -0
- package/src/file/FileSystemFileHandle.res +25 -0
- package/src/file/FileSystemHandle.res +6 -0
- package/src/file/FileSystemWritableFileStream.res +65 -0
- package/src/file/FileTypes.res +225 -0
- package/src/file/ReadableStream.res +79 -0
- package/src/file/WritableStream.res +27 -0
- package/src/file/WritableStreamDefaultController.res +5 -0
- package/src/geometry/DOMMatrix.res +206 -0
- package/src/geometry/DOMMatrixReadOnly.res +140 -0
- package/src/geometry/DOMPoint.res +28 -0
- package/src/geometry/DOMPointReadOnly.res +22 -0
- package/src/geometry/DOMRect.res +22 -0
- package/src/geometry/DOMRectList.res +2 -0
- package/src/geometry/DOMRectReadOnly.res +19 -0
- package/src/html/HTMLAnchorElement.res +373 -0
- package/src/html/HTMLAreaElement.res +353 -0
- package/src/html/HTMLBRElement.res +9 -0
- package/src/html/HTMLBaseElement.res +20 -0
- package/src/html/HTMLBodyElement.res +9 -0
- package/src/html/HTMLButtonElement.res +98 -0
- package/src/html/HTMLDListElement.res +9 -0
- package/src/html/HTMLDataElement.res +14 -0
- package/src/html/HTMLDataListElement.res +14 -0
- package/src/html/HTMLDialogElement.res +40 -0
- package/src/html/HTMLDivElement.res +9 -0
- package/src/html/HTMLElement.res +108 -0
- package/src/html/HTMLEmbedElement.res +275 -0
- package/src/html/HTMLFieldSetElement.res +70 -0
- package/src/html/HTMLFormControlsCollection.res +21 -0
- package/src/html/HTMLFormElement.res +39 -0
- package/src/html/HTMLFrameSetElement.res +9 -0
- package/src/html/HTMLHRElement.res +9 -0
- package/src/html/HTMLHeadElement.res +256 -0
- package/src/html/HTMLHeadingElement.res +9 -0
- package/src/html/HTMLHtmlElement.res +9 -0
- package/src/html/HTMLIFrameElement.res +69 -0
- package/src/html/HTMLImageElement.res +349 -0
- package/src/html/HTMLInputElement.res +310 -0
- package/src/html/HTMLLIElement.res +9 -0
- package/src/html/HTMLLabelElement.res +25 -0
- package/src/html/HTMLLegendElement.res +14 -0
- package/src/html/HTMLLinkElement.res +69 -0
- package/src/html/HTMLMapElement.res +20 -0
- package/src/html/HTMLMenuElement.res +8 -0
- package/src/html/HTMLMetaElement.res +29 -0
- package/src/html/HTMLMeterElement.res +38 -0
- package/src/html/HTMLModElement.res +9 -0
- package/src/html/HTMLOListElement.res +24 -0
- package/src/html/HTMLObjectElement.res +89 -0
- package/src/html/HTMLOptGroupElement.res +19 -0
- package/src/html/HTMLOptionElement.res +49 -0
- package/src/html/HTMLOptionsCollection.res +35 -0
- package/src/html/HTMLOutputElement.res +73 -0
- package/src/html/HTMLParagraphElement.res +9 -0
- package/src/html/HTMLPictureElement.res +9 -0
- package/src/html/HTMLPreElement.res +9 -0
- package/src/html/HTMLProgressElement.res +29 -0
- package/src/html/HTMLQuoteElement.res +9 -0
- package/src/html/HTMLScriptElement.res +310 -0
- package/src/html/HTMLSelectElement.res +157 -0
- package/src/html/HTMLSlotElement.res +34 -0
- package/src/html/HTMLSourceElement.res +18 -0
- package/src/html/HTMLSpanElement.res +9 -0
- package/src/html/HTMLStyleElement.res +24 -0
- package/src/html/HTMLTableCaptionElement.res +9 -0
- package/src/html/HTMLTableCellElement.res +40 -0
- package/src/html/HTMLTableElement.res +100 -0
- package/src/html/HTMLTableRowElement.res +40 -0
- package/src/html/HTMLTableSectionElement.res +30 -0
- package/src/html/HTMLTemplateElement.res +31 -0
- package/src/html/HTMLTextAreaElement.res +177 -0
- package/src/html/HTMLTimeElement.res +14 -0
- package/src/html/HTMLTitleElement.res +15 -0
- package/src/html/HTMLUListElement.res +9 -0
- package/src/html/HTMLUnknownElement.res +9 -0
- package/src/media/BaseEncryptedMediaExtensions.res +97 -0
- package/src/media/DomHTMLMediaElement.res +206 -0
- package/src/media/EncryptedMediaExtensionsHTMLMediaElement.res +15 -0
- package/src/media/EncryptedMediaExtensionsTypes.res +43 -0
- package/src/media/HTMLAudioElement.res +9 -0
- package/src/media/HTMLTrackElement.res +14 -0
- package/src/media/HTMLVideoElement.res +78 -0
- package/src/media/MediaCapabilities.res +19 -0
- package/src/media/MediaCapabilitiesTypes.res +83 -0
- package/src/media/MediaCaptureAndStreamsTypes.res +197 -0
- package/src/media/MediaDeviceInfo.res +9 -0
- package/src/media/MediaDevices.res +40 -0
- package/src/media/MediaError.res +14 -0
- package/src/media/MediaKeySession.res +53 -0
- package/src/media/MediaKeyStatusMap.res +11 -0
- package/src/media/MediaKeySystemAccess.res +14 -0
- package/src/media/MediaKeys.res +35 -0
- package/src/media/MediaMetadata.res +10 -0
- package/src/media/MediaSession.res +25 -0
- package/src/media/MediaSessionTypes.res +85 -0
- package/src/media/MediaStream.res +89 -0
- package/src/media/MediaStreamTrack.res +51 -0
- package/src/media/PictureInPicture.res +7 -0
- package/src/media/PictureInPictureTypes.res +17 -0
- package/src/media/RemotePlayback.res +25 -0
- package/src/media/RemotePlaybackTypes.res +20 -0
- package/src/media/SpeechSynthesis.res +33 -0
- package/src/media/SpeechSynthesisUtterance.res +8 -0
- package/src/media/TextTrack.res +15 -0
- package/src/media/TextTrackCueList.res +9 -0
- package/src/media/TextTrackList.res +17 -0
- package/src/media/TimeRanges.res +29 -0
- package/src/media/VideoPlaybackQuality.res +18 -0
- package/src/media/WebSpeechTypes.res +83 -0
- package/src/media/WebVttTypes.res +123 -0
- package/src/messaging/ApplicationServerKey.res +2 -0
- package/src/messaging/ChannelMessagingTypes.res +12 -0
- package/src/messaging/CloseEvent.res +10 -0
- package/src/messaging/MessageEvent.res +43 -0
- package/src/messaging/MessagePort.res +38 -0
- package/src/messaging/Notification.res +46 -0
- package/src/messaging/NotificationTypes.res +107 -0
- package/src/messaging/PushEvent.res +3 -0
- package/src/messaging/PushManager.res +24 -0
- package/src/messaging/PushMessageData.res +15 -0
- package/src/messaging/PushSubscription.res +20 -0
- package/src/messaging/PushTypes.res +88 -0
- package/src/messaging/WebSocket.res +74 -0
- package/src/messaging/WebSocketsTypes.res +124 -0
- package/src/navigator/Clipboard.res +29 -0
- package/src/navigator/ClipboardItem.res +20 -0
- package/src/navigator/ClipboardTypes.res +31 -0
- package/src/navigator/CredentialManagementTypes.res +138 -0
- package/src/navigator/CredentialsContainer.res +33 -0
- package/src/navigator/Navigator.res +166 -0
- package/src/navigator/Permissions.res +10 -0
- package/src/navigator/PermissionsTypes.res +38 -0
- package/src/observers/IntersectionObserver.res +36 -0
- package/src/observers/IntersectionObserverRoot.res +23 -0
- package/src/observers/IntersectionObserverTypes.res +67 -0
- package/src/observers/MutationObserver.res +94 -0
- package/src/observers/ResizeObserver.res +30 -0
- package/src/observers/ResizeObserverTypes.res +56 -0
- package/src/performance/Performance.res +101 -0
- package/src/performance/PerformanceEntry.res +5 -0
- package/src/performance/PerformanceMark.res +16 -0
- package/src/performance/PerformanceTypes.res +86 -0
- package/src/storage/Cache.res +117 -0
- package/src/storage/CacheStorage.res +43 -0
- package/src/storage/CacheTypes.res +24 -0
- package/src/storage/IDBDatabase.res +54 -0
- package/src/storage/IDBFactory.res +34 -0
- package/src/storage/IDBIndex.res +83 -0
- package/src/storage/IDBObjectStore.res +183 -0
- package/src/storage/IDBTransaction.res +22 -0
- package/src/storage/IndexedDbTypes.res +213 -0
- package/src/storage/Storage.res +42 -0
- package/src/storage/StorageEvent.res +10 -0
- package/src/storage/StorageManager.res +24 -0
- package/src/storage/StorageTypes.res +11 -0
- package/src/storage/WebStorageTypes.res +57 -0
- package/src/svg/SVGElement.res +115 -0
- package/src/svg/SVGGraphicsElement.res +16 -0
- package/src/svg/SVGLength.res +9 -0
- package/src/ui-events/CompositionEvent.res +10 -0
- package/src/ui-events/DataTransfer.res +38 -0
- package/src/ui-events/DataTransferItem.res +21 -0
- package/src/ui-events/DataTransferItemList.res +34 -0
- package/src/ui-events/FocusEvent.res +10 -0
- package/src/ui-events/InputEvent.res +16 -0
- package/src/ui-events/KeyboardEvent.res +16 -0
- package/src/ui-events/MouseEvent.res +26 -0
- package/src/ui-events/PointerEvent.res +24 -0
- package/src/ui-events/Touch.res +5 -0
- package/src/ui-events/TouchEvent.res +10 -0
- package/src/ui-events/TouchList.res +5 -0
- package/src/ui-events/UIEvent.res +20 -0
- package/src/ui-events/UiEventsTypes.res +590 -0
- package/src/ui-events/WheelEvent.res +10 -0
- package/src/url/URL.res +38 -0
- package/src/url/URLSearchParams.res +104 -0
- package/src/url/UrlTypes.res +69 -0
- package/src/view-transitions/ViewTransition.res +5 -0
- package/src/view-transitions/ViewTransitionsTypes.res +22 -0
- package/src/web-audio/AnalyserNode.res +38 -0
- package/src/web-audio/AudioBuffer.res +33 -0
- package/src/web-audio/AudioBufferSourceNode.res +21 -0
- package/src/web-audio/AudioContext.res +59 -0
- package/src/web-audio/AudioDestinationNode.res +1 -0
- package/src/web-audio/AudioNode.res +76 -0
- package/src/web-audio/AudioParam.res +65 -0
- package/src/web-audio/AudioProcessingEvent.res +10 -0
- package/src/web-audio/AudioScheduledSourceNode.res +23 -0
- package/src/web-audio/AudioWorkletNode.res +11 -0
- package/src/web-audio/BaseAudioContext.res +141 -0
- package/src/web-audio/BiquadFilterNode.res +21 -0
- package/src/web-audio/ChannelMergerNode.res +10 -0
- package/src/web-audio/ChannelSplitterNode.res +10 -0
- package/src/web-audio/ConstantSourceNode.res +10 -0
- package/src/web-audio/ConvolverNode.res +10 -0
- package/src/web-audio/DelayNode.res +10 -0
- package/src/web-audio/DynamicsCompressorNode.res +10 -0
- package/src/web-audio/GainNode.res +10 -0
- package/src/web-audio/IIRFilterNode.res +21 -0
- package/src/web-audio/MediaElementAudioSourceNode.res +10 -0
- package/src/web-audio/MediaStreamAudioDestinationNode.res +10 -0
- package/src/web-audio/MediaStreamAudioSourceNode.res +10 -0
- package/src/web-audio/OfflineAudioCompletionEvent.res +10 -0
- package/src/web-audio/OfflineAudioContext.res +58 -0
- package/src/web-audio/OscillatorNode.res +17 -0
- package/src/web-audio/PannerNode.res +10 -0
- package/src/web-audio/PeriodicWave.res +8 -0
- package/src/web-audio/StereoPannerNode.res +10 -0
- package/src/web-audio/WaveShaperNode.res +10 -0
- package/src/web-audio/WebAudioTypes.res +1309 -0
- package/src/web-audio/Worklet.res +14 -0
- package/src/window/CustomElementRegistry.res +30 -0
- package/src/window/Document.res +470 -0
- package/src/window/DomGlobal.res +459 -0
- package/src/window/History.res +37 -0
- package/src/window/HistoryTypes.res +26 -0
- package/src/window/IdleDeadline.res +5 -0
- package/src/window/Location.res +108 -0
- package/src/window/VisualViewport.res +5 -0
- package/src/window/VisualViewportTypes.res +37 -0
- package/src/window/Window.res +556 -0
- package/src/window/XPathExpression.res +16 -0
- package/src/window/XPathResult.res +46 -0
- package/src/workers/Clients.res +39 -0
- package/src/workers/NavigationPreloadManager.res +26 -0
- package/src/workers/ServiceWorker.res +38 -0
- package/src/workers/ServiceWorkerContainer.res +34 -0
- package/src/workers/ServiceWorkerRegistration.res +32 -0
- package/src/workers/ServiceWorkerScope.res +12 -0
- package/src/workers/ServiceWorkerTypes.res +153 -0
- package/src/workers/SharedWorker.res +68 -0
- package/src/workers/SharedWorkerScope.res +29 -0
- package/src/workers/WebWorkersTypes.res +46 -0
- package/src/workers/Worker.res +48 -0
- package/src/workers/WorkerLocation.res +18 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
type t = DOMTree.documentFragment = private {
|
|
2
|
+
...DOMTree.documentFragment,
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragmentFragment)
|
|
7
|
+
*/
|
|
8
|
+
@new
|
|
9
|
+
external make: unit => DOMTree.documentFragment = "DocumentFragment"
|
|
10
|
+
|
|
11
|
+
module Impl = (
|
|
12
|
+
T: {
|
|
13
|
+
type t
|
|
14
|
+
},
|
|
15
|
+
) => {
|
|
16
|
+
include Node.Impl({type t = T.t})
|
|
17
|
+
|
|
18
|
+
external asDocumentFragment: T.t => DOMTree.documentFragment = "%identity"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Inserts nodes after the last 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/DocumentFragment/append)
|
|
25
|
+
*/
|
|
26
|
+
@throws(JsExn) @send
|
|
27
|
+
external append: (T.t, DOMTree.node) => unit = "append"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
Inserts nodes after the last 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/DocumentFragment/append)
|
|
34
|
+
*/
|
|
35
|
+
@throws(JsExn) @send
|
|
36
|
+
external append2: (T.t, string) => unit = "append"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
Returns the first element within node's descendants whose ID is elementId.
|
|
40
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/getElementById)
|
|
41
|
+
*/
|
|
42
|
+
@send
|
|
43
|
+
external getElementById: (T.t, string) => Null.t<DOMTree.element> = "getElementById"
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
47
|
+
|
|
48
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
49
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend)
|
|
50
|
+
*/
|
|
51
|
+
@throws(JsExn) @send
|
|
52
|
+
external prepend: (T.t, DOMTree.node) => unit = "prepend"
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
56
|
+
|
|
57
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
58
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend)
|
|
59
|
+
*/
|
|
60
|
+
@throws(JsExn) @send
|
|
61
|
+
external prepend2: (T.t, string) => unit = "prepend"
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
Returns the first element that is a descendant of node that matches selectors.
|
|
65
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector)
|
|
66
|
+
*/
|
|
67
|
+
@throws(JsExn) @send
|
|
68
|
+
external querySelector: (T.t, string) => Null.t<DOMTree.element> = "querySelector"
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
Returns all element descendants of node that match selectors.
|
|
72
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll)
|
|
73
|
+
*/
|
|
74
|
+
@throws(JsExn) @send
|
|
75
|
+
external querySelectorAll: (T.t, string) => DOM.nodeList<DOMTree.element> = "querySelectorAll"
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
79
|
+
|
|
80
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
81
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren)
|
|
82
|
+
*/
|
|
83
|
+
@throws(JsExn) @send
|
|
84
|
+
external replaceChildren: (T.t, DOMTree.node) => unit = "replaceChildren"
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
88
|
+
|
|
89
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
90
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren)
|
|
91
|
+
*/
|
|
92
|
+
@throws(JsExn) @send
|
|
93
|
+
external replaceChildren2: (T.t, string) => unit = "replaceChildren"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
include Impl({type t = t})
|
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
type t = DOMTree.element = private {
|
|
2
|
+
...DOMTree.element,
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
module Impl = (
|
|
6
|
+
T: {
|
|
7
|
+
type t
|
|
8
|
+
},
|
|
9
|
+
) => {
|
|
10
|
+
include Node.Impl({type t = T.t})
|
|
11
|
+
|
|
12
|
+
external asElement: T.t => DOMTree.element = "%identity"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
16
|
+
|
|
17
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/after)
|
|
19
|
+
*/
|
|
20
|
+
@throws(JsExn) @send
|
|
21
|
+
external after: (T.t, DOMTree.node) => unit = "after"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
|
|
25
|
+
|
|
26
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
27
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/after)
|
|
28
|
+
*/
|
|
29
|
+
@throws(JsExn) @send
|
|
30
|
+
external after2: (T.t, string) => unit = "after"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
|
|
34
|
+
*/
|
|
35
|
+
@send
|
|
36
|
+
external animate: (T.t, ~keyframes: unknown, ~options: float=?) => Animation.t = "animate"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate)
|
|
40
|
+
*/
|
|
41
|
+
@send
|
|
42
|
+
external animate2: (
|
|
43
|
+
T.t,
|
|
44
|
+
~keyframes: unknown,
|
|
45
|
+
~options: Animation.keyframeAnimationOptions=?,
|
|
46
|
+
) => Animation.t = "animate"
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
50
|
+
|
|
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/Element/append)
|
|
53
|
+
*/
|
|
54
|
+
@throws(JsExn) @send
|
|
55
|
+
external append: (T.t, DOMTree.node) => unit = "append"
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
59
|
+
|
|
60
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
61
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/append)
|
|
62
|
+
*/
|
|
63
|
+
@throws(JsExn) @send
|
|
64
|
+
external append2: (T.t, string) => unit = "append"
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
Creates a shadow root for element and returns it.
|
|
68
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow)
|
|
69
|
+
*/
|
|
70
|
+
@throws(JsExn) @send
|
|
71
|
+
external attachShadow: (T.t, HTML.shadowRootInit) => DOMTree.shadowRoot = "attachShadow"
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
75
|
+
|
|
76
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
77
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/before)
|
|
78
|
+
*/
|
|
79
|
+
@throws(JsExn) @send
|
|
80
|
+
external before: (T.t, DOMTree.node) => unit = "before"
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
|
|
84
|
+
|
|
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/Element/before)
|
|
87
|
+
*/
|
|
88
|
+
@throws(JsExn) @send
|
|
89
|
+
external before2: (T.t, string) => unit = "before"
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility)
|
|
93
|
+
*/
|
|
94
|
+
@send
|
|
95
|
+
external checkVisibility: (T.t, ~options: DOM.checkVisibilityOptions=?) => bool =
|
|
96
|
+
"checkVisibility"
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
|
|
100
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest)
|
|
101
|
+
*/
|
|
102
|
+
@throws(JsExn) @send
|
|
103
|
+
external closest: (T.t, string) => Null.t<'e> = "closest"
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap)
|
|
107
|
+
*/
|
|
108
|
+
@send
|
|
109
|
+
external computedStyleMap: T.t => StylePropertyMapReadOnly.t = "computedStyleMap"
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations)
|
|
113
|
+
*/
|
|
114
|
+
@throws(JsExn) @send
|
|
115
|
+
external getAnimations: (
|
|
116
|
+
T.t,
|
|
117
|
+
~options: AnimationEffect.getAnimationsOptions=?,
|
|
118
|
+
) => array<Animation.t> = "getAnimations"
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
|
|
122
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute)
|
|
123
|
+
*/
|
|
124
|
+
@send
|
|
125
|
+
external getAttribute: (T.t, string) => Null.t<string> = "getAttribute"
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
Returns the qualified names of all element's attributes. Can contain duplicates.
|
|
129
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames)
|
|
130
|
+
*/
|
|
131
|
+
@send
|
|
132
|
+
external getAttributeNames: T.t => array<string> = "getAttributeNames"
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode)
|
|
136
|
+
*/
|
|
137
|
+
@send
|
|
138
|
+
external getAttributeNode: (T.t, string) => Null.t<Attr.t> = "getAttributeNode"
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS)
|
|
142
|
+
*/
|
|
143
|
+
@send
|
|
144
|
+
external getAttributeNodeNS: (T.t, ~namespace: string, ~localName: string) => Null.t<Attr.t> =
|
|
145
|
+
"getAttributeNodeNS"
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
|
|
149
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS)
|
|
150
|
+
*/
|
|
151
|
+
@send
|
|
152
|
+
external getAttributeNS: (T.t, ~namespace: string, ~localName: string) => Null.t<string> =
|
|
153
|
+
"getAttributeNS"
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect)
|
|
157
|
+
*/
|
|
158
|
+
@send
|
|
159
|
+
external getBoundingClientRect: T.t => DOM.domRect = "getBoundingClientRect"
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects)
|
|
163
|
+
*/
|
|
164
|
+
@send
|
|
165
|
+
external getClientRects: T.t => DOM.domRectList = "getClientRects"
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
|
|
169
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName)
|
|
170
|
+
*/
|
|
171
|
+
@send
|
|
172
|
+
external getElementsByClassName: (T.t, string) => HTMLCollection.t<DOMTree.element> =
|
|
173
|
+
"getElementsByClassName"
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName)
|
|
177
|
+
*/
|
|
178
|
+
@send
|
|
179
|
+
external getElementsByTagName: (T.t, string) => HTMLCollection.t<DOMTree.element> =
|
|
180
|
+
"getElementsByTagName"
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
|
|
184
|
+
*/
|
|
185
|
+
@send
|
|
186
|
+
external getElementsByTagNameNS: (
|
|
187
|
+
DOMTree.element,
|
|
188
|
+
~namespace: string,
|
|
189
|
+
~localName: string,
|
|
190
|
+
) => HTMLCollection.t<DOMTree.element> = "getElementsByTagNameNS"
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML)
|
|
194
|
+
*/
|
|
195
|
+
@send
|
|
196
|
+
external getHTML: (T.t, ~options: HTML.getHTMLOptions=?) => string = "getHTML"
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
|
|
200
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute)
|
|
201
|
+
*/
|
|
202
|
+
@send
|
|
203
|
+
external hasAttribute: (T.t, string) => bool = "hasAttribute"
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
Returns true if element has an attribute whose namespace is namespace and local name is localName.
|
|
207
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS)
|
|
208
|
+
*/
|
|
209
|
+
@send
|
|
210
|
+
external hasAttributeNS: (T.t, ~namespace: string, ~localName: string) => bool = "hasAttributeNS"
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
Returns true if element has attributes, and false otherwise.
|
|
214
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes)
|
|
215
|
+
*/
|
|
216
|
+
@send
|
|
217
|
+
external hasAttributes: T.t => bool = "hasAttributes"
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture)
|
|
221
|
+
*/
|
|
222
|
+
@send
|
|
223
|
+
external hasPointerCapture: (T.t, int) => bool = "hasPointerCapture"
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement)
|
|
227
|
+
*/
|
|
228
|
+
@send
|
|
229
|
+
external insertAdjacentElement: (
|
|
230
|
+
T.t,
|
|
231
|
+
~where: DOM.insertPosition,
|
|
232
|
+
~element: DOMTree.element,
|
|
233
|
+
) => Null.t<DOMTree.element> = "insertAdjacentElement"
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML)
|
|
237
|
+
*/
|
|
238
|
+
@throws(JsExn) @send
|
|
239
|
+
external insertAdjacentHTML: (T.t, ~position: DOM.insertPosition, ~string: string) => unit =
|
|
240
|
+
"insertAdjacentHTML"
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText)
|
|
244
|
+
*/
|
|
245
|
+
@send
|
|
246
|
+
external insertAdjacentText: (T.t, ~where: DOM.insertPosition, ~data: string) => unit =
|
|
247
|
+
"insertAdjacentText"
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
Returns true if matching selectors against element's root yields element, and false otherwise.
|
|
251
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches)
|
|
252
|
+
*/
|
|
253
|
+
@throws(JsExn) @send
|
|
254
|
+
external matches: (T.t, string) => bool = "matches"
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
258
|
+
|
|
259
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
260
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
|
|
261
|
+
*/
|
|
262
|
+
@throws(JsExn) @send
|
|
263
|
+
external prepend: (T.t, DOMTree.node) => unit = "prepend"
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
|
|
267
|
+
|
|
268
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
269
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend)
|
|
270
|
+
*/
|
|
271
|
+
@throws(JsExn) @send
|
|
272
|
+
external prepend2: (T.t, string) => unit = "prepend"
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
Returns the first element that is a descendant of node that matches selectors.
|
|
276
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
|
|
277
|
+
*/
|
|
278
|
+
@throws(JsExn) @send
|
|
279
|
+
external querySelector: (T.t, string) => Null.t<DOMTree.element> = "querySelector"
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
Returns all element descendants of node that match selectors.
|
|
283
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
|
|
284
|
+
*/
|
|
285
|
+
@throws(JsExn) @send
|
|
286
|
+
external querySelectorAll: (T.t, string) => DOM.nodeList<DOMTree.element> = "querySelectorAll"
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture)
|
|
290
|
+
*/
|
|
291
|
+
@throws(JsExn) @send
|
|
292
|
+
external releasePointerCapture: (T.t, int) => unit = "releasePointerCapture"
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
Removes node.
|
|
296
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove)
|
|
297
|
+
*/
|
|
298
|
+
@send
|
|
299
|
+
external remove: T.t => unit = "remove"
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
Removes element's first attribute whose qualified name is qualifiedName.
|
|
303
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute)
|
|
304
|
+
*/
|
|
305
|
+
@send
|
|
306
|
+
external removeAttribute: (T.t, string) => unit = "removeAttribute"
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode)
|
|
310
|
+
*/
|
|
311
|
+
@throws(JsExn) @send
|
|
312
|
+
external removeAttributeNode: (T.t, Attr.t) => Attr.t = "removeAttributeNode"
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
Removes element's attribute whose namespace is namespace and local name is localName.
|
|
316
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS)
|
|
317
|
+
*/
|
|
318
|
+
@send
|
|
319
|
+
external removeAttributeNS: (T.t, ~namespace: string, ~localName: string) => unit =
|
|
320
|
+
"removeAttributeNS"
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
324
|
+
|
|
325
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
326
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
|
|
327
|
+
*/
|
|
328
|
+
@throws(JsExn) @send
|
|
329
|
+
external replaceChildren: (T.t, DOMTree.node) => unit = "replaceChildren"
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
333
|
+
|
|
334
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
335
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren)
|
|
336
|
+
*/
|
|
337
|
+
@throws(JsExn) @send
|
|
338
|
+
external replaceChildren2: (T.t, string) => unit = "replaceChildren"
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
342
|
+
|
|
343
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
344
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
|
|
345
|
+
*/
|
|
346
|
+
@throws(JsExn) @send
|
|
347
|
+
external replaceWith: (T.t, DOMTree.node) => unit = "replaceWith"
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
|
|
351
|
+
|
|
352
|
+
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
|
|
353
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
|
|
354
|
+
*/
|
|
355
|
+
@throws(JsExn) @send
|
|
356
|
+
external replaceWith2: (T.t, string) => unit = "replaceWith"
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
Displays element fullscreen and resolves promise when done.
|
|
360
|
+
|
|
361
|
+
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
|
|
362
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen)
|
|
363
|
+
*/
|
|
364
|
+
@send
|
|
365
|
+
external requestFullscreen: (T.t, ~options: DOM.fullscreenOptions=?) => promise<unit> =
|
|
366
|
+
"requestFullscreen"
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock)
|
|
370
|
+
*/
|
|
371
|
+
@send
|
|
372
|
+
external requestPointerLock: (T.t, ~options: DOM.pointerLockOptions=?) => promise<unit> =
|
|
373
|
+
"requestPointerLock"
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
|
|
377
|
+
*/
|
|
378
|
+
@send
|
|
379
|
+
external scroll: (T.t, ~options: DOM.scrollToOptions=?) => unit = "scroll"
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll)
|
|
383
|
+
*/
|
|
384
|
+
@send
|
|
385
|
+
external scroll2: (T.t, ~x: float, ~y: float) => unit = "scroll"
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
|
|
389
|
+
*/
|
|
390
|
+
@send
|
|
391
|
+
external scrollBy: (T.t, ~options: DOM.scrollToOptions=?) => unit = "scrollBy"
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
|
|
395
|
+
*/
|
|
396
|
+
@send
|
|
397
|
+
external scrollBy2: (T.t, ~x: float, ~y: float) => unit = "scrollBy"
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
`scrollIntoView()`
|
|
401
|
+
|
|
402
|
+
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
|
|
403
|
+
|
|
404
|
+
```res
|
|
405
|
+
element->Element.scrollIntoView()
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
|
|
409
|
+
*/
|
|
410
|
+
@send
|
|
411
|
+
external scrollIntoView: T.t => unit = "scrollIntoView"
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
`scrollIntoView(true)`
|
|
415
|
+
|
|
416
|
+
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
|
|
417
|
+
|
|
418
|
+
```res
|
|
419
|
+
element->Element.scrollIntoView_alignToTop()
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
|
|
423
|
+
*/
|
|
424
|
+
@send
|
|
425
|
+
external scrollIntoViewAlignToTop: (T.t, @as(json`true`) _) => unit = "scrollIntoView"
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
`scrollIntoView({ behavior: "smooth" })`
|
|
429
|
+
|
|
430
|
+
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
|
|
431
|
+
|
|
432
|
+
```res
|
|
433
|
+
element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth })
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
|
|
437
|
+
*/
|
|
438
|
+
@send
|
|
439
|
+
external scrollIntoViewWithOptions: (T.t, DOM.scrollIntoViewOptions) => unit = "scrollIntoView"
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
|
|
443
|
+
*/
|
|
444
|
+
@send
|
|
445
|
+
external scrollTo: (T.t, ~options: DOM.scrollToOptions=?) => unit = "scrollTo"
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
|
|
449
|
+
*/
|
|
450
|
+
@send
|
|
451
|
+
external scrollTo2: (T.t, ~x: float, ~y: float) => unit = "scrollTo"
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
|
|
455
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute)
|
|
456
|
+
*/
|
|
457
|
+
@throws(JsExn) @send
|
|
458
|
+
external setAttribute: (T.t, ~qualifiedName: string, ~value: string) => unit = "setAttribute"
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode)
|
|
462
|
+
*/
|
|
463
|
+
@send
|
|
464
|
+
external setAttributeNode: (T.t, Attr.t) => Null.t<Attr.t> = "setAttributeNode"
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS)
|
|
468
|
+
*/
|
|
469
|
+
@send
|
|
470
|
+
external setAttributeNodeNS: (T.t, Attr.t) => Null.t<Attr.t> = "setAttributeNodeNS"
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
|
|
474
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS)
|
|
475
|
+
*/
|
|
476
|
+
@throws(JsExn) @send
|
|
477
|
+
external setAttributeNS: (
|
|
478
|
+
T.t,
|
|
479
|
+
~namespace: string,
|
|
480
|
+
~qualifiedName: string,
|
|
481
|
+
~value: string,
|
|
482
|
+
) => unit = "setAttributeNS"
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe)
|
|
486
|
+
*/
|
|
487
|
+
@throws(JsExn) @send
|
|
488
|
+
external setHTMLUnsafe: (T.t, string) => unit = "setHTMLUnsafe"
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture)
|
|
492
|
+
*/
|
|
493
|
+
@throws(JsExn) @send
|
|
494
|
+
external setPointerCapture: (T.t, int) => unit = "setPointerCapture"
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
|
|
498
|
+
|
|
499
|
+
Returns true if qualifiedName is now present, and false otherwise.
|
|
500
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute)
|
|
501
|
+
*/
|
|
502
|
+
@throws(JsExn) @send
|
|
503
|
+
external toggleAttribute: (T.t, ~qualifiedName: string, ~force: bool=?) => bool =
|
|
504
|
+
"toggleAttribute"
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
include Impl({type t = t})
|
|
508
|
+
|
|
509
|
+
let isInstanceOf = (_: 't): bool => %raw(`param instanceof Element`)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type t = DOMTree.elementInternals = private {
|
|
2
|
+
...DOMTree.elementInternals,
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Sets both the state and submission value of internals's target element to value.
|
|
7
|
+
|
|
8
|
+
If value is null, the element won't participate in form submission.
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue)
|
|
10
|
+
*/
|
|
11
|
+
@throws(JsExn) @send
|
|
12
|
+
external setFormValue: (DOMTree.elementInternals, ~value: unknown, ~state: unknown=?) => unit =
|
|
13
|
+
"setFormValue"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called.
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/setValidity)
|
|
18
|
+
*/
|
|
19
|
+
@throws(JsExn) @send
|
|
20
|
+
external setValidity: (
|
|
21
|
+
DOMTree.elementInternals,
|
|
22
|
+
~flags: DOM.validityStateFlags=?,
|
|
23
|
+
~message: string=?,
|
|
24
|
+
~anchor: DOMTree.htmlElement=?,
|
|
25
|
+
) => unit = "setValidity"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case.
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity)
|
|
30
|
+
*/
|
|
31
|
+
@throws(JsExn) @send
|
|
32
|
+
external checkValidity: DOMTree.elementInternals => bool = "checkValidity"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user.
|
|
36
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity)
|
|
37
|
+
*/
|
|
38
|
+
@throws(JsExn) @send
|
|
39
|
+
external reportValidity: DOMTree.elementInternals => bool = "reportValidity"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type shadowRootInit = {
|
|
2
|
+
mutable mode: DOMTree.shadowRootMode,
|
|
3
|
+
mutable delegatesFocus?: bool,
|
|
4
|
+
mutable slotAssignment?: DOMTree.slotAssignmentMode,
|
|
5
|
+
mutable serializable?: bool,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type getHTMLOptions = {
|
|
9
|
+
mutable serializableShadowRoots?: bool,
|
|
10
|
+
mutable shadowRoots?: array<DOMTree.shadowRoot>,
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.
|
|
3
|
+
[See HTMLCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection)
|
|
4
|
+
*/
|
|
5
|
+
type t<'item> = private {
|
|
6
|
+
/**
|
|
7
|
+
Sets or retrieves the number of objects in a collection.
|
|
8
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length)
|
|
9
|
+
*/
|
|
10
|
+
length: int,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
Retrieves an object from various collections.
|
|
15
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)
|
|
16
|
+
*/
|
|
17
|
+
@send
|
|
18
|
+
external item: (t<'item>, int) => Null.t<'item> = "item"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Retrieves a select object or an object from an options collection.
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem)
|
|
23
|
+
*/
|
|
24
|
+
@send
|
|
25
|
+
external namedItem: (t<'item>, string) => Null.t<'item> = "namedItem"
|