From b1af4acfc28ab906f3b01771d45d2a35e343fa5e Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 13:10:55 +0100 Subject: [PATCH 01/13] Extract EventTarget methods --- src/CSSFontLoadingAPI/FontFaceSet.js | 7 +- src/CSSFontLoadingAPI/FontFaceSet.res | 82 +---------------- src/CanvasAPI/OffscreenCanvas.js | 7 +- src/CanvasAPI/OffscreenCanvas.res | 82 +---------------- src/ChannelMessagingAPI/MessagePort.js | 7 +- src/ChannelMessagingAPI/MessagePort.res | 84 +---------------- src/ClipboardAPI/Clipboard.js | 7 +- src/ClipboardAPI/Clipboard.res | 82 +---------------- src/DOMAPI/Animation.js | 7 +- src/DOMAPI/Animation.res | 83 +---------------- src/DOMAPI/MediaQueryList.js | 7 +- src/DOMAPI/MediaQueryList.res | 83 +---------------- src/DOMAPI/Node.js | 7 +- src/DOMAPI/Node.res | 83 +---------------- src/DOMAPI/ScreenOrientation.js | 7 +- src/DOMAPI/ScreenOrientation.res | 82 +---------------- src/DOMAPI/TextTrackList.js | 7 +- src/DOMAPI/TextTrackList.res | 82 +---------------- src/DOMAPI/Window.js | 7 +- src/DOMAPI/Window.res | 84 +---------------- .../MediaKeySession.js | 7 +- .../MediaKeySession.res | 83 +---------------- src/EventAPI/AbortSignal.js | 7 +- src/EventAPI/AbortSignal.res | 83 +---------------- src/EventAPI/EventTarget.js | 11 ++- src/EventAPI/EventTarget.res | 90 +++++++++++-------- src/IndexedDBAPI/IDBDatabase.js | 7 +- src/IndexedDBAPI/IDBDatabase.res | 82 +---------------- src/IndexedDBAPI/IDBTransaction.js | 7 +- src/IndexedDBAPI/IDBTransaction.res | 83 +---------------- src/MediaCaptureAndStreamsAPI/MediaDevices.js | 7 +- .../MediaDevices.res | 82 +---------------- src/MediaCaptureAndStreamsAPI/MediaStream.js | 7 +- src/MediaCaptureAndStreamsAPI/MediaStream.res | 83 +---------------- .../MediaStreamTrack.js | 7 +- .../MediaStreamTrack.res | 84 +---------------- src/NotificationAPI/Notification.js | 7 +- src/NotificationAPI/Notification.res | 83 +---------------- src/PerformanceAPI/Performance.js | 7 +- src/PerformanceAPI/Performance.res | 82 +---------------- src/RemotePlaybackAPI/RemotePlayback.js | 7 +- src/RemotePlaybackAPI/RemotePlayback.res | 82 +---------------- src/ScreenWakeLockAPI/WakeLockSentinel.js | 7 +- src/ScreenWakeLockAPI/WakeLockSentinel.res | 82 +---------------- src/ServiceWorkerAPI/ServiceWorker.js | 7 +- src/ServiceWorkerAPI/ServiceWorker.res | 82 +---------------- .../ServiceWorkerContainer.js | 7 +- .../ServiceWorkerContainer.res | 82 +---------------- .../ServiceWorkerRegistration.js | 7 +- .../ServiceWorkerRegistration.res | 82 +---------------- src/WebAudioAPI/AudioNode.js | 7 +- src/WebAudioAPI/AudioNode.res | 82 +---------------- src/WebAudioAPI/BaseAudioContext.js | 7 +- src/WebAudioAPI/BaseAudioContext.res | 83 +---------------- src/WebSocketsAPI/WebSocket.js | 7 +- src/WebSocketsAPI/WebSocket.res | 82 +---------------- src/WebSpeechAPI/SpeechSynthesis.js | 7 +- src/WebSpeechAPI/SpeechSynthesis.res | 82 +---------------- src/WebVTTAPI/TextTrack.js | 7 +- src/WebVTTAPI/TextTrack.res | 82 +---------------- 60 files changed, 323 insertions(+), 2374 deletions(-) diff --git a/src/CSSFontLoadingAPI/FontFaceSet.js b/src/CSSFontLoadingAPI/FontFaceSet.js index d856702..977be07 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.js +++ b/src/CSSFontLoadingAPI/FontFaceSet.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/CSSFontLoadingAPI/FontFaceSet.res b/src/CSSFontLoadingAPI/FontFaceSet.res index 3f0b3b3..2afe50e 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.res +++ b/src/CSSFontLoadingAPI/FontFaceSet.res @@ -1,85 +1,9 @@ open EventAPI open CSSFontLoadingAPI -external asEventTarget: fontFaceSet => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - fontFaceSet, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - fontFaceSet, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - fontFaceSet, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - fontFaceSet, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (fontFaceSet, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = fontFaceSet +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/add) diff --git a/src/CanvasAPI/OffscreenCanvas.js b/src/CanvasAPI/OffscreenCanvas.js index d856702..977be07 100644 --- a/src/CanvasAPI/OffscreenCanvas.js +++ b/src/CanvasAPI/OffscreenCanvas.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.res b/src/CanvasAPI/OffscreenCanvas.res index 0683f2c..4382385 100644 --- a/src/CanvasAPI/OffscreenCanvas.res +++ b/src/CanvasAPI/OffscreenCanvas.res @@ -9,85 +9,9 @@ open FileAPI @new external make: (~width: int, ~height: int) => offscreenCanvas = "OffscreenCanvas" -external asEventTarget: offscreenCanvas => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - offscreenCanvas, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - offscreenCanvas, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - offscreenCanvas, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - offscreenCanvas, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (offscreenCanvas, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = offscreenCanvas +}) /** Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. diff --git a/src/ChannelMessagingAPI/MessagePort.js b/src/ChannelMessagingAPI/MessagePort.js index d856702..977be07 100644 --- a/src/ChannelMessagingAPI/MessagePort.js +++ b/src/ChannelMessagingAPI/MessagePort.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.res b/src/ChannelMessagingAPI/MessagePort.res index 43a5302..c444cca 100644 --- a/src/ChannelMessagingAPI/MessagePort.res +++ b/src/ChannelMessagingAPI/MessagePort.res @@ -1,86 +1,8 @@ -open EventAPI open ChannelMessagingAPI -open Prelude -external asEventTarget: messagePort => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - messagePort, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - messagePort, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - messagePort, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - messagePort, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (messagePort, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = messagePort +}) /** Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. diff --git a/src/ClipboardAPI/Clipboard.js b/src/ClipboardAPI/Clipboard.js index d856702..977be07 100644 --- a/src/ClipboardAPI/Clipboard.js +++ b/src/ClipboardAPI/Clipboard.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.res b/src/ClipboardAPI/Clipboard.res index 3a451e1..1e6c374 100644 --- a/src/ClipboardAPI/Clipboard.res +++ b/src/ClipboardAPI/Clipboard.res @@ -1,85 +1,9 @@ open EventAPI open ClipboardAPI -external asEventTarget: clipboard => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - clipboard, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - clipboard, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - clipboard, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - clipboard, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (clipboard, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = clipboard +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read) diff --git a/src/DOMAPI/Animation.js b/src/DOMAPI/Animation.js index d856702..977be07 100644 --- a/src/DOMAPI/Animation.js +++ b/src/DOMAPI/Animation.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Animation.res b/src/DOMAPI/Animation.res index f1a0478..89ff512 100644 --- a/src/DOMAPI/Animation.res +++ b/src/DOMAPI/Animation.res @@ -1,4 +1,3 @@ -open EventAPI open DOMAPI /** @@ -8,85 +7,9 @@ open DOMAPI external make: (~effect: animationEffect=?, ~timeline: animationTimeline=?) => animation = "Animation" -external asEventTarget: animation => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - animation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - animation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - animation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - animation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (animation, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = animation +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/cancel) diff --git a/src/DOMAPI/MediaQueryList.js b/src/DOMAPI/MediaQueryList.js index d856702..977be07 100644 --- a/src/DOMAPI/MediaQueryList.js +++ b/src/DOMAPI/MediaQueryList.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/MediaQueryList.res b/src/DOMAPI/MediaQueryList.res index 4883838..596bc7a 100644 --- a/src/DOMAPI/MediaQueryList.res +++ b/src/DOMAPI/MediaQueryList.res @@ -1,82 +1,5 @@ -open EventAPI open DOMAPI -external asEventTarget: mediaQueryList => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaQueryList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaQueryList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaQueryList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaQueryList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaQueryList, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = mediaQueryList +}) diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index d856702..977be07 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Node.res b/src/DOMAPI/Node.res index 03de5ef..b8bc916 100644 --- a/src/DOMAPI/Node.res +++ b/src/DOMAPI/Node.res @@ -1,85 +1,8 @@ -open EventAPI open DOMAPI -external asEventTarget: node => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - node, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - node, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - node, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - node, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (node, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = node +}) /** Returns node's root. diff --git a/src/DOMAPI/ScreenOrientation.js b/src/DOMAPI/ScreenOrientation.js index d856702..977be07 100644 --- a/src/DOMAPI/ScreenOrientation.js +++ b/src/DOMAPI/ScreenOrientation.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/ScreenOrientation.res b/src/DOMAPI/ScreenOrientation.res index 71e0af3..ac8a0cd 100644 --- a/src/DOMAPI/ScreenOrientation.res +++ b/src/DOMAPI/ScreenOrientation.res @@ -1,85 +1,9 @@ open EventAPI open DOMAPI -external asEventTarget: screenOrientation => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - screenOrientation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - screenOrientation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - screenOrientation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - screenOrientation, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (screenOrientation, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = screenOrientation +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation/unlock) diff --git a/src/DOMAPI/TextTrackList.js b/src/DOMAPI/TextTrackList.js index d856702..977be07 100644 --- a/src/DOMAPI/TextTrackList.js +++ b/src/DOMAPI/TextTrackList.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/TextTrackList.res b/src/DOMAPI/TextTrackList.res index af2430c..ed515c2 100644 --- a/src/DOMAPI/TextTrackList.res +++ b/src/DOMAPI/TextTrackList.res @@ -2,85 +2,9 @@ open EventAPI open DOMAPI open WebVTTAPI -external asEventTarget: textTrackList => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - textTrackList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - textTrackList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - textTrackList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - textTrackList, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (textTrackList, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = textTrackList +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackList/getTrackById) diff --git a/src/DOMAPI/Window.js b/src/DOMAPI/Window.js index d856702..977be07 100644 --- a/src/DOMAPI/Window.js +++ b/src/DOMAPI/Window.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Window.res b/src/DOMAPI/Window.res index 150849f..ce403a2 100644 --- a/src/DOMAPI/Window.res +++ b/src/DOMAPI/Window.res @@ -6,7 +6,10 @@ open ChannelMessagingAPI open FetchAPI open EventAPI -external asEventTarget: window => eventTarget = "%identity" +include EventTarget.Impl({ + type t = window +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/reportError) */ @@ -314,85 +317,6 @@ external requestAnimationFrame: (window, frameRequestCallback) => int = "request @send external cancelAnimationFrame: (window, int) => unit = "cancelAnimationFrame" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - window, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - window, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - window, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - window, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (window, event) => bool = "dispatchEvent" - /** Closes the window. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/close) diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js index d856702..977be07 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.res b/src/EncryptedMediaExtensionsAPI/MediaKeySession.res index a3c9ac1..ea5f24d 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.res +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.res @@ -1,85 +1,8 @@ -open EventAPI open EncryptedMediaExtensionsAPI -external asEventTarget: mediaKeySession => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaKeySession, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaKeySession, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaKeySession, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaKeySession, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaKeySession, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = mediaKeySession +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaKeySession/generateRequest) diff --git a/src/EventAPI/AbortSignal.js b/src/EventAPI/AbortSignal.js index d856702..e8afbf4 100644 --- a/src/EventAPI/AbortSignal.js +++ b/src/EventAPI/AbortSignal.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "./EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/EventAPI/AbortSignal.res b/src/EventAPI/AbortSignal.res index 3f66669..b4252a7 100644 --- a/src/EventAPI/AbortSignal.res +++ b/src/EventAPI/AbortSignal.res @@ -1,85 +1,8 @@ open EventAPI -open Prelude -external asEventTarget: abortSignal => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - abortSignal, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - abortSignal, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - abortSignal, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - abortSignal, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (abortSignal, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = abortSignal +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) diff --git a/src/EventAPI/EventTarget.js b/src/EventAPI/EventTarget.js index d856702..3af64bd 100644 --- a/src/EventAPI/EventTarget.js +++ b/src/EventAPI/EventTarget.js @@ -1,2 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + + +function Impl(T) { + return {}; +} + +export { + Impl, +} +/* No side effect */ diff --git a/src/EventAPI/EventTarget.res b/src/EventAPI/EventTarget.res index d81c90b..949f79c 100644 --- a/src/EventAPI/EventTarget.res +++ b/src/EventAPI/EventTarget.res @@ -6,7 +6,14 @@ open EventAPI @new external make: unit => eventTarget = "EventTarget" -/** +module Impl = ( + T: { + type t + }, +) => { + external asEventTarget: T.t => eventTarget = "%identity" + + /** 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. 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. @@ -22,15 +29,15 @@ If an AbortSignal is passed for options's signal, then the event listener will b The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) */ -@send -external addEventListener: ( - eventTarget, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** + @send + external addEventListener: ( + T.t, + ~type_: eventType, + ~callback: eventListener<'event>, + ~options: addEventListenerOptions=?, + ) => unit = "addEventListener" + + /** 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. 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. @@ -46,41 +53,46 @@ If an AbortSignal is passed for options's signal, then the event listener will b The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) */ -@send -external addEventListener2: ( - eventTarget, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** + @send + external addEventListener_useCapture: ( + T.t, + ~type_: eventType, + ~callback: eventListener<'event>, + @as(json`true`) _, + ) => unit = "addEventListener" + + /** Removes the event listener in target's event listener list with the same type, callback, and options. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ -@send -external removeEventListener: ( - eventTarget, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** + @send + external removeEventListener: ( + T.t, + ~type_: eventType, + ~callback: eventListener<'event>, + ~options: eventListenerOptions=?, + ) => unit = "removeEventListener" + + /** Removes the event listener in target's event listener list with the same type, callback, and options. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ -@send -external removeEventListener2: ( - eventTarget, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** + @send + external removeEventListener_useCapture: ( + T.t, + ~type_: eventType, + ~callback: eventListener<'event>, + @as(json`true`) _, + ) => unit = "removeEventListener" + + /** 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. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) */ -@send -external dispatchEvent: (eventTarget, event) => bool = "dispatchEvent" + @send + external dispatchEvent: (T.t, event) => bool = "dispatchEvent" +} + +include Impl({ + type t = eventTarget +}) diff --git a/src/IndexedDBAPI/IDBDatabase.js b/src/IndexedDBAPI/IDBDatabase.js index d856702..977be07 100644 --- a/src/IndexedDBAPI/IDBDatabase.js +++ b/src/IndexedDBAPI/IDBDatabase.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBDatabase.res b/src/IndexedDBAPI/IDBDatabase.res index a276961..bb0eea8 100644 --- a/src/IndexedDBAPI/IDBDatabase.res +++ b/src/IndexedDBAPI/IDBDatabase.res @@ -1,85 +1,9 @@ open EventAPI open IndexedDBAPI -external asEventTarget: idbDatabase => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - idbDatabase, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - idbDatabase, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - idbDatabase, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - idbDatabase, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (idbDatabase, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = idbDatabase +}) /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. diff --git a/src/IndexedDBAPI/IDBTransaction.js b/src/IndexedDBAPI/IDBTransaction.js index d856702..977be07 100644 --- a/src/IndexedDBAPI/IDBTransaction.js +++ b/src/IndexedDBAPI/IDBTransaction.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBTransaction.res b/src/IndexedDBAPI/IDBTransaction.res index 6774ec8..3a033fa 100644 --- a/src/IndexedDBAPI/IDBTransaction.res +++ b/src/IndexedDBAPI/IDBTransaction.res @@ -1,85 +1,8 @@ -open EventAPI open IndexedDBAPI -external asEventTarget: idbTransaction => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - idbTransaction, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - idbTransaction, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - idbTransaction, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - idbTransaction, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (idbTransaction, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = idbTransaction +}) /** Returns an IDBObjectStore in the transaction's scope. diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.js b/src/MediaCaptureAndStreamsAPI/MediaDevices.js index d856702..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.js +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.res b/src/MediaCaptureAndStreamsAPI/MediaDevices.res index 66bafb7..279eb8f 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.res +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.res @@ -1,85 +1,9 @@ open EventAPI open MediaCaptureAndStreamsAPI -external asEventTarget: mediaDevices => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaDevices, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaDevices, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaDevices, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaDevices, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaDevices, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = mediaDevices +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaDevices/enumerateDevices) diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.js b/src/MediaCaptureAndStreamsAPI/MediaStream.js index d856702..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.res b/src/MediaCaptureAndStreamsAPI/MediaStream.res index 64e78b3..655de49 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.res +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.res @@ -1,4 +1,3 @@ -open EventAPI open MediaCaptureAndStreamsAPI /** @@ -19,85 +18,9 @@ external make2: mediaStream => mediaStream = "MediaStream" @new external make3: array => mediaStream = "MediaStream" -external asEventTarget: mediaStream => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaStream, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaStream, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaStream, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaStream, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaStream, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = mediaStream +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStream/getAudioTracks) diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js index d856702..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res index 375a9f3..e0ce0c4 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.res @@ -1,86 +1,8 @@ -open EventAPI open MediaCaptureAndStreamsAPI -open WebAudioAPI -external asEventTarget: mediaStreamTrack => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaStreamTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaStreamTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaStreamTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaStreamTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaStreamTrack, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = mediaStreamTrack +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/clone) diff --git a/src/NotificationAPI/Notification.js b/src/NotificationAPI/Notification.js index d856702..977be07 100644 --- a/src/NotificationAPI/Notification.js +++ b/src/NotificationAPI/Notification.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/NotificationAPI/Notification.res b/src/NotificationAPI/Notification.res index 85225c2..964fab7 100644 --- a/src/NotificationAPI/Notification.res +++ b/src/NotificationAPI/Notification.res @@ -1,4 +1,3 @@ -open EventAPI open NotificationAPI /** @@ -7,85 +6,9 @@ open NotificationAPI @new external make: (~title: string, ~options: notificationOptions=?) => notification = "Notification" -external asEventTarget: notification => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - notification, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - notification, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - notification, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - notification, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (notification, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = notification +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Notification/requestPermission_static) diff --git a/src/PerformanceAPI/Performance.js b/src/PerformanceAPI/Performance.js index d856702..977be07 100644 --- a/src/PerformanceAPI/Performance.js +++ b/src/PerformanceAPI/Performance.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/PerformanceAPI/Performance.res b/src/PerformanceAPI/Performance.res index 530dc90..4bb078a 100644 --- a/src/PerformanceAPI/Performance.res +++ b/src/PerformanceAPI/Performance.res @@ -1,85 +1,9 @@ open EventAPI open PerformanceAPI -external asEventTarget: performance => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - performance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - performance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - performance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - performance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (performance, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = performance +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Performance/now) diff --git a/src/RemotePlaybackAPI/RemotePlayback.js b/src/RemotePlaybackAPI/RemotePlayback.js index d856702..977be07 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.js +++ b/src/RemotePlaybackAPI/RemotePlayback.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.res b/src/RemotePlaybackAPI/RemotePlayback.res index 53290f1..67d675c 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.res +++ b/src/RemotePlaybackAPI/RemotePlayback.res @@ -1,85 +1,9 @@ open EventAPI open RemotePlaybackAPI -external asEventTarget: remotePlayback => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - remotePlayback, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - remotePlayback, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - remotePlayback, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - remotePlayback, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (remotePlayback, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = remotePlayback +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/RemotePlayback/watchAvailability) diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.js b/src/ScreenWakeLockAPI/WakeLockSentinel.js index d856702..977be07 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.js +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.res b/src/ScreenWakeLockAPI/WakeLockSentinel.res index 5e39fbb..c0e2c42 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.res +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.res @@ -1,85 +1,9 @@ open EventAPI open ScreenWakeLockAPI -external asEventTarget: wakeLockSentinel => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - wakeLockSentinel, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - wakeLockSentinel, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - wakeLockSentinel, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - wakeLockSentinel, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (wakeLockSentinel, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = wakeLockSentinel +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/release) diff --git a/src/ServiceWorkerAPI/ServiceWorker.js b/src/ServiceWorkerAPI/ServiceWorker.js index d856702..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.js +++ b/src/ServiceWorkerAPI/ServiceWorker.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorker.res b/src/ServiceWorkerAPI/ServiceWorker.res index e3a5f62..3998713 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.res +++ b/src/ServiceWorkerAPI/ServiceWorker.res @@ -3,85 +3,9 @@ open ServiceWorkerAPI open Prelude open ChannelMessagingAPI -external asEventTarget: serviceWorker => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - serviceWorker, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - serviceWorker, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - serviceWorker, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - serviceWorker, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (serviceWorker, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = serviceWorker +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorker/postMessage) diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.js b/src/ServiceWorkerAPI/ServiceWorkerContainer.js index d856702..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.js +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.res b/src/ServiceWorkerAPI/ServiceWorkerContainer.res index d358237..ba1d0db 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.res +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.res @@ -1,85 +1,9 @@ open EventAPI open ServiceWorkerAPI -external asEventTarget: serviceWorkerContainer => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - serviceWorkerContainer, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - serviceWorkerContainer, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - serviceWorkerContainer, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - serviceWorkerContainer, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (serviceWorkerContainer, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = serviceWorkerContainer +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerContainer/register) diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js index d856702..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.res b/src/ServiceWorkerAPI/ServiceWorkerRegistration.res index 1969db6..3c4d64e 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.res +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.res @@ -2,85 +2,9 @@ open EventAPI open ServiceWorkerAPI open NotificationAPI -external asEventTarget: serviceWorkerRegistration => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - serviceWorkerRegistration, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - serviceWorkerRegistration, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - serviceWorkerRegistration, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - serviceWorkerRegistration, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (serviceWorkerRegistration, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = serviceWorkerRegistration +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/update) diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index d856702..977be07 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.res b/src/WebAudioAPI/AudioNode.res index 660f23b..d39d67f 100644 --- a/src/WebAudioAPI/AudioNode.res +++ b/src/WebAudioAPI/AudioNode.res @@ -1,85 +1,9 @@ open EventAPI open WebAudioAPI -external asEventTarget: audioNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - audioNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - audioNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - audioNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - audioNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (audioNode, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = audioNode +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index d856702..977be07 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/BaseAudioContext.res b/src/WebAudioAPI/BaseAudioContext.res index 8e93fda..8e794b8 100644 --- a/src/WebAudioAPI/BaseAudioContext.res +++ b/src/WebAudioAPI/BaseAudioContext.res @@ -1,85 +1,8 @@ -open EventAPI open WebAudioAPI -external asEventTarget: baseAudioContext => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - baseAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - baseAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - baseAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - baseAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (baseAudioContext, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = baseAudioContext +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) diff --git a/src/WebSocketsAPI/WebSocket.js b/src/WebSocketsAPI/WebSocket.js index d856702..977be07 100644 --- a/src/WebSocketsAPI/WebSocket.js +++ b/src/WebSocketsAPI/WebSocket.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebSocketsAPI/WebSocket.res b/src/WebSocketsAPI/WebSocket.res index 659a639..5986b07 100644 --- a/src/WebSocketsAPI/WebSocket.res +++ b/src/WebSocketsAPI/WebSocket.res @@ -14,85 +14,9 @@ external make: (~url: string, ~protocols: string=?) => webSocket = "WebSocket" @new external make2: (~url: string, ~protocols: array=?) => webSocket = "WebSocket" -external asEventTarget: webSocket => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - webSocket, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - webSocket, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - webSocket, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - webSocket, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (webSocket, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = webSocket +}) /** Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason. diff --git a/src/WebSpeechAPI/SpeechSynthesis.js b/src/WebSpeechAPI/SpeechSynthesis.js index d856702..977be07 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.js +++ b/src/WebSpeechAPI/SpeechSynthesis.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesis.res b/src/WebSpeechAPI/SpeechSynthesis.res index df82238..d3ae28c 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.res +++ b/src/WebSpeechAPI/SpeechSynthesis.res @@ -1,85 +1,9 @@ open EventAPI open WebSpeechAPI -external asEventTarget: speechSynthesis => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - speechSynthesis, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - speechSynthesis, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - speechSynthesis, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - speechSynthesis, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (speechSynthesis, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = speechSynthesis +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/speak) diff --git a/src/WebVTTAPI/TextTrack.js b/src/WebVTTAPI/TextTrack.js index d856702..977be07 100644 --- a/src/WebVTTAPI/TextTrack.js +++ b/src/WebVTTAPI/TextTrack.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; + +EventTarget$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebVTTAPI/TextTrack.res b/src/WebVTTAPI/TextTrack.res index 203539d..aba41df 100644 --- a/src/WebVTTAPI/TextTrack.res +++ b/src/WebVTTAPI/TextTrack.res @@ -1,85 +1,9 @@ open EventAPI open WebVTTAPI -external asEventTarget: textTrack => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - textTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - textTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - textTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - textTrack, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (textTrack, event) => bool = "dispatchEvent" +include EventTarget.Impl({ + type t = textTrack +}) /** Adds the given cue to textTrack's text track list of cues. From 570fb564b8a866e1565442bcb7fa58036f4895cc Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 13:23:00 +0100 Subject: [PATCH 02/13] Extract Node --- src/DOMAPI/CharacterData.res | 182 +------------------------------- src/DOMAPI/Document.res | 182 +------------------------------- src/DOMAPI/DocumentFragment.res | 182 +------------------------------- src/DOMAPI/Element.res | 182 +------------------------------- src/DOMAPI/Node.js | 10 +- src/DOMAPI/Node.res | 110 ++++++++++--------- 6 files changed, 85 insertions(+), 763 deletions(-) diff --git a/src/DOMAPI/CharacterData.res b/src/DOMAPI/CharacterData.res index 213a37c..0eb4a04 100644 --- a/src/DOMAPI/CharacterData.res +++ b/src/DOMAPI/CharacterData.res @@ -1,8 +1,10 @@ open DOMAPI open EventAPI -external asNode: characterData => node = "%identity" -external asEventTarget: characterData => eventTarget = "%identity" +include Node.Impl({ + type t = characterData +}) + /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. @@ -64,182 +66,6 @@ Removes node. @send external remove: characterData => unit = "remove" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - characterData, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - characterData, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - characterData, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - characterData, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (characterData, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (characterData, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: characterData => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: characterData => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (characterData, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (characterData, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (characterData, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (characterData, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (characterData, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (characterData, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (characterData, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (characterData, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (characterData, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (characterData, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (characterData, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (characterData, 't) => 't = "removeChild" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) */ diff --git a/src/DOMAPI/Document.res b/src/DOMAPI/Document.res index 8501ac2..9c0c84c 100644 --- a/src/DOMAPI/Document.res +++ b/src/DOMAPI/Document.res @@ -8,8 +8,10 @@ open ViewTransitionsAPI @new external make: unit => document = "Document" -external asNode: document => node = "%identity" -external asEventTarget: document => eventTarget = "%identity" +include Node.Impl({ + type t = document +}) + /** Returns the first element within node's descendants whose ID is elementId. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById) @@ -114,182 +116,6 @@ external evaluate: ( ~result: xPathResult=?, ) => xPathResult = "evaluate" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - document, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - document, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - document, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - document, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (document, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (document, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: document => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: document => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (document, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (document, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (document, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (document, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (document, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (document, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (document, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (document, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (document, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (document, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (document, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (document, 't) => 't = "removeChild" - /** Retrieves a collection of objects based on the specified element name. @param name Specifies the name of an element. diff --git a/src/DOMAPI/DocumentFragment.res b/src/DOMAPI/DocumentFragment.res index 97dfcca..49d1a6f 100644 --- a/src/DOMAPI/DocumentFragment.res +++ b/src/DOMAPI/DocumentFragment.res @@ -7,8 +7,10 @@ open EventAPI @new external make: unit => documentFragment = "DocumentFragment" -external asNode: documentFragment => node = "%identity" -external asEventTarget: documentFragment => eventTarget = "%identity" +include Node.Impl({ + type t = documentFragment +}) + /** Returns the first element within node's descendants whose ID is elementId. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById) @@ -83,179 +85,3 @@ Returns all element descendants of node that match selectors. */ @send external querySelectorAll: (documentFragment, string) => nodeList = "querySelectorAll" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - documentFragment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - documentFragment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - documentFragment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - documentFragment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (documentFragment, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (documentFragment, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: documentFragment => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: documentFragment => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (documentFragment, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (documentFragment, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (documentFragment, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (documentFragment, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (documentFragment, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (documentFragment, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (documentFragment, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (documentFragment, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (documentFragment, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (documentFragment, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (documentFragment, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (documentFragment, 't) => 't = "removeChild" diff --git a/src/DOMAPI/Element.res b/src/DOMAPI/Element.res index 251e5f0..755a9c8 100644 --- a/src/DOMAPI/Element.res +++ b/src/DOMAPI/Element.res @@ -2,8 +2,10 @@ open DOMAPI open Prelude open EventAPI -external asNode: element => node = "%identity" -external asEventTarget: element => eventTarget = "%identity" +include Node.Impl({ + type t = element +}) + /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -153,182 +155,6 @@ external animate2: (element, ~keyframes: any, ~options: keyframeAnimationOptions external getAnimations: (element, ~options: getAnimationsOptions=?) => array = "getAnimations" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - element, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - element, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - element, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - element, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (element, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (element, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: element => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: element => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (element, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (element, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (element, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (element, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (element, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (element, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (element, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (element, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (element, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (element, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (element, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (element, 't) => 't = "removeChild" - /** Returns true if element has attributes, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index 977be07..0500a81 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -2,6 +2,12 @@ import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +function Impl(T) { + EventTarget$WebApi.Impl({}); + return {}; +} -/* Not a pure module */ +export { + Impl, +} +/* No side effect */ diff --git a/src/DOMAPI/Node.res b/src/DOMAPI/Node.res index b8bc916..524d08a 100644 --- a/src/DOMAPI/Node.res +++ b/src/DOMAPI/Node.res @@ -1,102 +1,114 @@ open DOMAPI -include EventTarget.Impl({ - type t = node -}) - -/** +module Impl = ( + T: { + type t + }, +) => { + include EventTarget.Impl({ + type t = T.t + }) + + external asNode: T.t => node = "%identity" + + /** Returns node's root. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) */ -@send -external getRootNode: (node, ~options: getRootNodeOptions=?) => node = "getRootNode" + @send + external getRootNode: (T.t, ~options: getRootNodeOptions=?) => node = "getRootNode" -/** + /** Returns whether node has children. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) */ -@send -external hasChildNodes: node => bool = "hasChildNodes" + @send + external hasChildNodes: T.t => bool = "hasChildNodes" -/** + /** Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) */ -@send -external normalize: node => unit = "normalize" + @send + external normalize: T.t => unit = "normalize" -/** + /** Returns a copy of node. If deep is true, the copy also includes the node's descendants. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) */ -@send -external cloneNode: (node, ~deep: bool=?) => node = "cloneNode" + @send + external cloneNode: (T.t, ~deep: bool=?) => T.t = "cloneNode" -/** + /** Returns whether node and otherNode have the same properties. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) */ -@send -external isEqualNode: (node, node) => bool = "isEqualNode" + @send + external isEqualNode: (T.t, node) => bool = "isEqualNode" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) */ -@send -external isSameNode: (node, node) => bool = "isSameNode" + @send + external isSameNode: (T.t, node) => bool = "isSameNode" -/** + /** Returns a bitmask indicating the position of other relative to node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) */ -@send -external compareDocumentPosition: (node, node) => int = "compareDocumentPosition" + @send + external compareDocumentPosition: (T.t, node) => int = "compareDocumentPosition" -/** + /** Returns true if other is an inclusive descendant of node, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) */ -@send -external contains: (node, node) => bool = "contains" + @send + external contains: (T.t, node) => bool = "contains" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) */ -@send -external lookupPrefix: (node, string) => string = "lookupPrefix" + @send + external lookupPrefix: (T.t, string) => string = "lookupPrefix" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) */ -@send -external lookupNamespaceURI: (node, string) => string = "lookupNamespaceURI" + @send + external lookupNamespaceURI: (T.t, string) => string = "lookupNamespaceURI" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) */ -@send -external isDefaultNamespace: (node, string) => bool = "isDefaultNamespace" + @send + external isDefaultNamespace: (T.t, string) => bool = "isDefaultNamespace" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) */ -@send -external insertBefore: (node, 't, ~child: node) => 't = "insertBefore" + @send + external insertBefore: (T.t, 't, ~child: node) => 't = "insertBefore" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) */ -@send -external appendChild: (node, 't) => 't = "appendChild" + @send + external appendChild: (T.t, 't) => 't = "appendChild" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) */ -@send -external replaceChild: (node, ~node: node, 't) => 't = "replaceChild" + @send + external replaceChild: (T.t, ~node: node, 't) => 't = "replaceChild" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) */ -@send -external removeChild: (node, 't) => 't = "removeChild" + @send + external removeChild: (T.t, 't) => 't = "removeChild" +} + +include Impl({ + type t = node +}) From 48ee189e758f2a249a5ad68c7c727a33138d9d72 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 13:41:57 +0100 Subject: [PATCH 03/13] Extract Element --- src/CSSFontLoadingAPI/FontFaceSet.js | 4 +- src/CanvasAPI/OffscreenCanvas.js | 4 +- src/ChannelMessagingAPI/MessagePort.js | 4 +- src/ClipboardAPI/Clipboard.js | 4 +- src/DOMAPI/Animation.js | 4 +- src/DOMAPI/CharacterData.js | 7 +- src/DOMAPI/Document.js | 7 +- src/DOMAPI/DocumentFragment.js | 7 +- src/DOMAPI/Element.js | 15 +- src/DOMAPI/Element.res | 642 +++++++++--------- src/DOMAPI/FillStyle.js | 8 +- src/DOMAPI/MediaQueryList.js | 4 +- src/DOMAPI/Node.js | 8 +- src/DOMAPI/ScreenOrientation.js | 4 +- src/DOMAPI/TextTrackList.js | 4 +- src/DOMAPI/Window.js | 4 +- .../MediaKeySession.js | 4 +- src/EventAPI/AbortSignal.js | 4 +- src/IndexedDBAPI/IDBDatabase.js | 4 +- src/IndexedDBAPI/IDBTransaction.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaDevices.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaStream.js | 4 +- .../MediaStreamTrack.js | 4 +- src/NotificationAPI/Notification.js | 4 +- src/PerformanceAPI/Performance.js | 4 +- src/RemotePlaybackAPI/RemotePlayback.js | 4 +- src/ScreenWakeLockAPI/WakeLockSentinel.js | 4 +- src/ServiceWorkerAPI/ServiceWorker.js | 4 +- .../ServiceWorkerContainer.js | 4 +- .../ServiceWorkerRegistration.js | 4 +- src/WebAudioAPI/AudioNode.js | 4 +- src/WebAudioAPI/BaseAudioContext.js | 4 +- src/WebSocketsAPI/WebSocket.js | 4 +- src/WebSpeechAPI/SpeechSynthesis.js | 4 +- src/WebVTTAPI/TextTrack.js | 4 +- 35 files changed, 423 insertions(+), 383 deletions(-) diff --git a/src/CSSFontLoadingAPI/FontFaceSet.js b/src/CSSFontLoadingAPI/FontFaceSet.js index 977be07..dbf8d92 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.js +++ b/src/CSSFontLoadingAPI/FontFaceSet.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.js b/src/CanvasAPI/OffscreenCanvas.js index 977be07..dbf8d92 100644 --- a/src/CanvasAPI/OffscreenCanvas.js +++ b/src/CanvasAPI/OffscreenCanvas.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.js b/src/ChannelMessagingAPI/MessagePort.js index 977be07..dbf8d92 100644 --- a/src/ChannelMessagingAPI/MessagePort.js +++ b/src/ChannelMessagingAPI/MessagePort.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.js b/src/ClipboardAPI/Clipboard.js index 977be07..dbf8d92 100644 --- a/src/ClipboardAPI/Clipboard.js +++ b/src/ClipboardAPI/Clipboard.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Animation.js b/src/DOMAPI/Animation.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/Animation.js +++ b/src/DOMAPI/Animation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/CharacterData.js b/src/DOMAPI/CharacterData.js index d856702..e6a3a30 100644 --- a/src/DOMAPI/CharacterData.js +++ b/src/DOMAPI/CharacterData.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Node$WebAPI from "./Node.js"; + +Node$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Document.js b/src/DOMAPI/Document.js index d856702..e6a3a30 100644 --- a/src/DOMAPI/Document.js +++ b/src/DOMAPI/Document.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Node$WebAPI from "./Node.js"; + +Node$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/DocumentFragment.js b/src/DOMAPI/DocumentFragment.js index d856702..e6a3a30 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/src/DOMAPI/DocumentFragment.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Node$WebAPI from "./Node.js"; + +Node$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Element.js b/src/DOMAPI/Element.js index d856702..d7d93d7 100644 --- a/src/DOMAPI/Element.js +++ b/src/DOMAPI/Element.js @@ -1,2 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Node$WebAPI from "./Node.js"; + +function Impl(T) { + Node$WebAPI.Impl({}); + return {}; +} + +Node$WebAPI.Impl({}); + +export { + Impl, +} +/* Not a pure module */ diff --git a/src/DOMAPI/Element.res b/src/DOMAPI/Element.res index 755a9c8..222a995 100644 --- a/src/DOMAPI/Element.res +++ b/src/DOMAPI/Element.res @@ -1,460 +1,470 @@ open DOMAPI open Prelude -open EventAPI -include Node.Impl({ - type t = element -}) - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. +module Impl = ( + T: { + type t + }, +) => { + include Node.Impl({ + type t = T.t + }) -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (element, node) => unit = "prepend" + external asElement: T.t => element = "%identity" -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/after) */ -@send -external prepend2: (element, string) => unit = "prepend" + @send + external after: (T.t, node) => unit = "after" -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/after) */ -@send -external append: (element, node) => unit = "append" + @send + external after2: (T.t, string) => unit = "after" -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) +*/ + @send + external animate: (T.t, ~keyframes: any, ~options: float=?) => animation = "animate" -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) */ -@send -external append2: (element, string) => unit = "append" + @send + external animate2: (T.t, ~keyframes: any, ~options: keyframeAnimationOptions=?) => animation = + "animate" -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/append) */ -@send -external replaceChildren: (element, node) => unit = "replaceChildren" + @send + external append: (T.t, node) => unit = "append" -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/append) */ -@send -external replaceChildren2: (element, string) => unit = "replaceChildren" + @send + external append2: (T.t, string) => unit = "append" -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (element, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) + /** +Creates a shadow root for element and returns it. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) */ -@send -external querySelectorAll: (element, string) => nodeList = "querySelectorAll" + @send + external attachShadow: (T.t, shadowRootInit) => shadowRoot = "attachShadow" -/** + /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/before) */ -@send -external before: (element, node) => unit = "before" + @send + external before: (T.t, node) => unit = "before" -/** + /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/before) */ -@send -external before2: (element, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + @send + external before2: (T.t, string) => unit = "before" -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (element, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (element, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (element, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (element, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) */ -@send -external remove: element => unit = "remove" + @send + external checkVisibility: (T.t, ~options: checkVisibilityOptions=?) => bool = "checkVisibility" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) + /** +Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) */ -@send -external animate: (element, ~keyframes: any, ~options: float=?) => animation = "animate" + @send + external closest: (T.t, string) => 'e = "closest" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) */ -@send -external animate2: (element, ~keyframes: any, ~options: keyframeAnimationOptions=?) => animation = - "animate" + @send + external computedStyleMap: element => stylePropertyMapReadOnly = "computedStyleMap" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) */ -@send -external getAnimations: (element, ~options: getAnimationsOptions=?) => array = - "getAnimations" + @send + external getAnimations: (T.t, ~options: getAnimationsOptions=?) => array = + "getAnimations" -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) + /** +Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) */ -@send -external hasAttributes: element => bool = "hasAttributes" + @send + external getAttribute: (T.t, string) => string = "getAttribute" -/** + /** Returns the qualified names of all element's attributes. Can contain duplicates. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) */ -@send -external getAttributeNames: element => array = "getAttributeNames" + @send + external getAttributeNames: element => array = "getAttributeNames" -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) +*/ + @send + external getAttributeNode: (T.t, string) => attr = "getAttributeNode" + + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) */ -@send -external getAttribute: (element, string) => string = "getAttribute" + @send + external getAttributeNodeNS: (T.t, ~namespace: string, ~localName: string) => attr = + "getAttributeNodeNS" -/** + /** Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) */ -@send -external getAttributeNS: (element, ~namespace: string, ~localName: string) => string = - "getAttributeNS" + @send + external getAttributeNS: (T.t, ~namespace: string, ~localName: string) => string = + "getAttributeNS" -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) */ -@send -external setAttribute: (element, ~qualifiedName: string, ~value: string) => unit = "setAttribute" + @send + external getBoundingClientRect: element => domRect = "getBoundingClientRect" -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) */ -@send -external setAttributeNS: ( - element, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" + @send + external getClientRects: element => domRectList = "getClientRects" -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) + /** +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. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) */ -@send -external removeAttribute: (element, string) => unit = "removeAttribute" + @send + external getElementsByClassName: (T.t, string) => htmlCollectionOf = + "getElementsByClassName" -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ -@send -external removeAttributeNS: (element, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" + @send + external getElementsByTagName: (T.t, string) => htmlCollection = "getElementsByTagName" -/** -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. + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) +*/ + @send + external getElementsByTagNameNS: ( + element, + ~namespace: string, + ~localName: string, + ) => htmlCollectionOf = "getElementsByTagNameNS" -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) */ -@send -external toggleAttribute: (element, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" + @send + external getHTML: (T.t, ~options: getHTMLOptions=?) => string = "getHTML" -/** + /** Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) */ -@send -external hasAttribute: (element, string) => bool = "hasAttribute" + @send + external hasAttribute: (T.t, string) => bool = "hasAttribute" -/** + /** Returns true if element has an attribute whose namespace is namespace and local name is localName. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) */ -@send -external hasAttributeNS: (element, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" + @send + external hasAttributeNS: (T.t, ~namespace: string, ~localName: string) => bool = "hasAttributeNS" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) + /** +Returns true if element has attributes, and false otherwise. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) */ -@send -external getAttributeNode: (element, string) => attr = "getAttributeNode" + @send + external hasAttributes: element => bool = "hasAttributes" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) */ -@send -external getAttributeNodeNS: (element, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" + @send + external hasPointerCapture: (T.t, int) => bool = "hasPointerCapture" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) */ -@send -external setAttributeNode: (element, attr) => attr = "setAttributeNode" + @send + external insertAdjacentElement: (T.t, ~where: insertPosition, ~element: element) => element = + "insertAdjacentElement" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) */ -@send -external setAttributeNodeNS: (element, attr) => attr = "setAttributeNodeNS" + @send + external insertAdjacentHTML: (T.t, ~position: insertPosition, ~string: string) => unit = + "insertAdjacentHTML" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) */ -@send -external removeAttributeNode: (element, attr) => attr = "removeAttributeNode" + @send + external insertAdjacentText: (T.t, ~where: insertPosition, ~data: string) => unit = + "insertAdjacentText" -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) + /** +Returns true if matching selectors against element's root yields element, and false otherwise. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) */ -@send -external attachShadow: (element, shadowRootInit) => shadowRoot = "attachShadow" + @send + external matches: (T.t, string) => bool = "matches" -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) + /** +Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) */ -@send -external closest: (element, string) => 'e = "closest" + @send + external prepend: (T.t, node) => unit = "prepend" -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) + /** +Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) */ -@send -external matches: (element, string) => bool = "matches" + @send + external prepend2: (T.t, string) => unit = "prepend" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) + /** +Returns the first element that is a descendant of node that matches selectors. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) */ -@send -external getElementsByTagName: (element, string) => htmlCollection = "getElementsByTagName" + @send + external querySelector: (T.t, string) => element = "querySelector" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) + /** +Returns all element descendants of node that match selectors. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) */ -@send -external getElementsByTagNameNS: ( - element, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" + @send + external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll" -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) */ -@send -external getElementsByClassName: (element, string) => htmlCollectionOf = - "getElementsByClassName" + @send + external releasePointerCapture: (T.t, int) => unit = "releasePointerCapture" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) + /** +Removes node. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) */ -@send -external insertAdjacentElement: (element, ~where: insertPosition, ~element: element) => element = - "insertAdjacentElement" + @send + external remove: element => unit = "remove" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) + /** +Removes element's first attribute whose qualified name is qualifiedName. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) */ -@send -external insertAdjacentText: (element, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" + @send + external removeAttribute: (T.t, string) => unit = "removeAttribute" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) */ -@send -external computedStyleMap: element => stylePropertyMapReadOnly = "computedStyleMap" + @send + external removeAttributeNode: (T.t, attr) => attr = "removeAttributeNode" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) + /** +Removes element's attribute whose namespace is namespace and local name is localName. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) */ -@send -external getClientRects: element => domRectList = "getClientRects" + @send + external removeAttributeNS: (T.t, ~namespace: string, ~localName: string) => unit = + "removeAttributeNS" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) + /** +Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) */ -@send -external getBoundingClientRect: element => domRect = "getBoundingClientRect" + @send + external replaceChildren: (T.t, node) => unit = "replaceChildren" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) + /** +Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) */ -@send -external checkVisibility: (element, ~options: checkVisibilityOptions=?) => bool = "checkVisibility" + @send + external replaceChildren2: (T.t, string) => unit = "replaceChildren" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) + /** +Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ -@send -external scrollIntoView: (element, ~arg: bool=?) => unit = "scrollIntoView" + @send + external replaceWith: (T.t, node) => unit = "replaceWith" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) + /** +Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ -@send -external scrollIntoView2: (element, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" + @send + external replaceWith2: (T.t, string) => unit = "replaceWith" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) + /** +Displays element fullscreen and resolves promise when done. + +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. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) */ -@send -external scroll: (element, ~options: scrollToOptions=?) => unit = "scroll" + @send + external requestFullscreen: (T.t, ~options: fullscreenOptions=?) => Promise.t = + "requestFullscreen" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) */ -@send -external scroll2: (element, ~x: float, ~y: float) => unit = "scroll" + @send + external requestPointerLock: (T.t, ~options: pointerLockOptions=?) => Promise.t = + "requestPointerLock" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) */ -@send -external scrollTo: (element, ~options: scrollToOptions=?) => unit = "scrollTo" + @send + external scroll: (T.t, ~options: scrollToOptions=?) => unit = "scroll" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) */ -@send -external scrollTo2: (element, ~x: float, ~y: float) => unit = "scrollTo" + @send + external scroll2: (T.t, ~x: float, ~y: float) => unit = "scroll" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) */ -@send -external scrollBy: (element, ~options: scrollToOptions=?) => unit = "scrollBy" + @send + external scrollBy: (T.t, ~options: scrollToOptions=?) => unit = "scrollBy" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) */ -@send -external scrollBy2: (element, ~x: float, ~y: float) => unit = "scrollBy" + @send + external scrollBy2: (T.t, ~x: float, ~y: float) => unit = "scrollBy" -/** -Displays element fullscreen and resolves promise when done. + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) +*/ + @send + external scrollIntoView: (T.t, ~arg: bool=?) => unit = "scrollIntoView" -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) */ -@send -external requestFullscreen: (element, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" + @send + external scrollIntoView2: (T.t, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) */ -@send -external setHTMLUnsafe: (element, string) => unit = "setHTMLUnsafe" + @send + external scrollTo: (T.t, ~options: scrollToOptions=?) => unit = "scrollTo" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) */ -@send -external getHTML: (element, ~options: getHTMLOptions=?) => string = "getHTML" + @send + external scrollTo2: (T.t, ~x: float, ~y: float) => unit = "scrollTo" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) + /** +Sets the value of element's first attribute whose qualified name is qualifiedName to value. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) */ -@send -external insertAdjacentHTML: (element, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" + @send + external setAttribute: (T.t, ~qualifiedName: string, ~value: string) => unit = "setAttribute" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) */ -@send -external setPointerCapture: (element, int) => unit = "setPointerCapture" + @send + external setAttributeNode: (T.t, attr) => attr = "setAttributeNode" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ -@send -external releasePointerCapture: (element, int) => unit = "releasePointerCapture" + @send + external setAttributeNodeNS: (T.t, attr) => attr = "setAttributeNodeNS" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) + /** +Sets the value of element's attribute whose namespace is namespace and local name is localName to value. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) */ -@send -external hasPointerCapture: (element, int) => bool = "hasPointerCapture" + @send + external setAttributeNS: ( + element, + ~namespace: string, + ~qualifiedName: string, + ~value: string, + ) => unit = "setAttributeNS" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) */ -@send -external requestPointerLock: (element, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" + @send + external setHTMLUnsafe: (T.t, string) => unit = "setHTMLUnsafe" + + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) +*/ + @send + external setPointerCapture: (T.t, int) => unit = "setPointerCapture" + + /** +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. + +Returns true if qualifiedName is now present, and false otherwise. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) +*/ + @send + external toggleAttribute: (T.t, ~qualifiedName: string, ~force: bool=?) => bool = + "toggleAttribute" +} + +include Impl({ + type t = element +}) diff --git a/src/DOMAPI/FillStyle.js b/src/DOMAPI/FillStyle.js index 1e79cc4..d12dfc1 100644 --- a/src/DOMAPI/FillStyle.js +++ b/src/DOMAPI/FillStyle.js @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebApi from "../CanvasAPI/CanvasPattern.js"; -import * as CanvasGradient$WebApi from "../CanvasAPI/CanvasGradient.js"; +import * as CanvasPattern$WebAPI from "../CanvasAPI/CanvasPattern.js"; +import * as CanvasGradient$WebAPI from "../CanvasAPI/CanvasGradient.js"; function decode(t) { - if (CanvasGradient$WebApi.isInstanceOf(t)) { + if (CanvasGradient$WebAPI.isInstanceOf(t)) { return { TAG: "CanvasGradient", _0: t }; - } else if (CanvasPattern$WebApi.isInstanceOf(t)) { + } else if (CanvasPattern$WebAPI.isInstanceOf(t)) { return { TAG: "CanvasPattern", _0: t diff --git a/src/DOMAPI/MediaQueryList.js b/src/DOMAPI/MediaQueryList.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/MediaQueryList.js +++ b/src/DOMAPI/MediaQueryList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index 0500a81..d309b02 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -1,13 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebApi.Impl({}); + EventTarget$WebAPI.Impl({}); return {}; } +EventTarget$WebAPI.Impl({}); + export { Impl, } -/* No side effect */ +/* Not a pure module */ diff --git a/src/DOMAPI/ScreenOrientation.js b/src/DOMAPI/ScreenOrientation.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/ScreenOrientation.js +++ b/src/DOMAPI/ScreenOrientation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/TextTrackList.js b/src/DOMAPI/TextTrackList.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/TextTrackList.js +++ b/src/DOMAPI/TextTrackList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Window.js b/src/DOMAPI/Window.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/Window.js +++ b/src/DOMAPI/Window.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js index 977be07..dbf8d92 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/EventAPI/AbortSignal.js b/src/EventAPI/AbortSignal.js index e8afbf4..b228e27 100644 --- a/src/EventAPI/AbortSignal.js +++ b/src/EventAPI/AbortSignal.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "./EventTarget.js"; +import * as EventTarget$WebAPI from "./EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBDatabase.js b/src/IndexedDBAPI/IDBDatabase.js index 977be07..dbf8d92 100644 --- a/src/IndexedDBAPI/IDBDatabase.js +++ b/src/IndexedDBAPI/IDBDatabase.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBTransaction.js b/src/IndexedDBAPI/IDBTransaction.js index 977be07..dbf8d92 100644 --- a/src/IndexedDBAPI/IDBTransaction.js +++ b/src/IndexedDBAPI/IDBTransaction.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.js b/src/MediaCaptureAndStreamsAPI/MediaDevices.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.js +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.js b/src/MediaCaptureAndStreamsAPI/MediaStream.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/NotificationAPI/Notification.js b/src/NotificationAPI/Notification.js index 977be07..dbf8d92 100644 --- a/src/NotificationAPI/Notification.js +++ b/src/NotificationAPI/Notification.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/PerformanceAPI/Performance.js b/src/PerformanceAPI/Performance.js index 977be07..dbf8d92 100644 --- a/src/PerformanceAPI/Performance.js +++ b/src/PerformanceAPI/Performance.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.js b/src/RemotePlaybackAPI/RemotePlayback.js index 977be07..dbf8d92 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.js +++ b/src/RemotePlaybackAPI/RemotePlayback.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.js b/src/ScreenWakeLockAPI/WakeLockSentinel.js index 977be07..dbf8d92 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.js +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorker.js b/src/ServiceWorkerAPI/ServiceWorker.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.js +++ b/src/ServiceWorkerAPI/ServiceWorker.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.js b/src/ServiceWorkerAPI/ServiceWorkerContainer.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.js +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index 977be07..dbf8d92 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index 977be07..dbf8d92 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebSocketsAPI/WebSocket.js b/src/WebSocketsAPI/WebSocket.js index 977be07..dbf8d92 100644 --- a/src/WebSocketsAPI/WebSocket.js +++ b/src/WebSocketsAPI/WebSocket.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesis.js b/src/WebSpeechAPI/SpeechSynthesis.js index 977be07..dbf8d92 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.js +++ b/src/WebSpeechAPI/SpeechSynthesis.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebVTTAPI/TextTrack.js b/src/WebVTTAPI/TextTrack.js index 977be07..dbf8d92 100644 --- a/src/WebVTTAPI/TextTrack.js +++ b/src/WebVTTAPI/TextTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ From 3a379cec93a557ee7a8d3d4247e58fd8fdae4f3f Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 13:50:35 +0100 Subject: [PATCH 04/13] Extract HTMLElement --- src/DOMAPI/Element.res | 12 +- src/DOMAPI/HTMLElement.js | 13 +- src/DOMAPI/HTMLElement.res | 702 ++----------------------------------- 3 files changed, 55 insertions(+), 672 deletions(-) diff --git a/src/DOMAPI/Element.res b/src/DOMAPI/Element.res index 222a995..fd2cbd8 100644 --- a/src/DOMAPI/Element.res +++ b/src/DOMAPI/Element.res @@ -103,7 +103,7 @@ Returns the first (starting at element) inclusive ancestor that matches selector [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) */ @send - external computedStyleMap: element => stylePropertyMapReadOnly = "computedStyleMap" + external computedStyleMap: T.t => stylePropertyMapReadOnly = "computedStyleMap" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) @@ -124,7 +124,7 @@ Returns the qualified names of all element's attributes. Can contain duplicates. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) */ @send - external getAttributeNames: element => array = "getAttributeNames" + external getAttributeNames: T.t => array = "getAttributeNames" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) @@ -151,13 +151,13 @@ Returns element's attribute whose namespace is namespace and local name is local [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) */ @send - external getBoundingClientRect: element => domRect = "getBoundingClientRect" + external getBoundingClientRect: T.t => domRect = "getBoundingClientRect" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) */ @send - external getClientRects: element => domRectList = "getClientRects" + external getClientRects: T.t => domRectList = "getClientRects" /** 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. @@ -208,7 +208,7 @@ Returns true if element has attributes, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) */ @send - external hasAttributes: element => bool = "hasAttributes" + external hasAttributes: T.t => bool = "hasAttributes" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) @@ -287,7 +287,7 @@ Removes node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) */ @send - external remove: element => unit = "remove" + external remove: T.t => unit = "remove" /** Removes element's first attribute whose qualified name is qualifiedName. diff --git a/src/DOMAPI/HTMLElement.js b/src/DOMAPI/HTMLElement.js index d856702..c9fbea5 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/src/DOMAPI/HTMLElement.js @@ -1,2 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Element$WebAPI from "./Element.js"; + +function Impl(T) { + Element$WebAPI.Impl({}); + return {}; +} + +export { + Impl, +} +/* Element-WebAPI Not a pure module */ diff --git a/src/DOMAPI/HTMLElement.res b/src/DOMAPI/HTMLElement.res index 463750c..eca45dc 100644 --- a/src/DOMAPI/HTMLElement.res +++ b/src/DOMAPI/HTMLElement.res @@ -2,684 +2,56 @@ open DOMAPI open Prelude open EventAPI -external asElement: htmlElement => element = "%identity" -external asNode: htmlElement => node = "%identity" -external asEventTarget: htmlElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) +module Impl = ( + T: { + type t + }, +) => { + include Element.Impl({ + type t = T.t + }) + + external asHTMLElement: T.t => htmlElement = "%identity" + + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) */ -@send -external focus: (htmlElement, ~options: focusOptions=?) => unit = "focus" + @send + external attachInternals: T.t => elementInternals = "attachInternals" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) */ -@send -external blur: htmlElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" + @send + external blur: T.t => unit = "blur" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) */ -@send -external click: htmlElement => unit = "click" + @send + external click: T.t => unit = "click" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) */ -@send -external attachInternals: htmlElement => elementInternals = "attachInternals" + @send + external focus: (T.t, ~options: focusOptions=?) => unit = "focus" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) */ -@send -external showPopover: htmlElement => unit = "showPopover" + @send + external hidePopover: T.t => unit = "hidePopover" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) */ -@send -external hidePopover: htmlElement => unit = "hidePopover" + @send + external showPopover: T.t => unit = "showPopover" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) */ -@send -external togglePopover: (htmlElement, ~force: bool=?) => bool = "togglePopover" + @send + external togglePopover: (T.t, ~force: bool=?) => bool = "togglePopover" +} From 73fb51d49e054bf09492c2d532fe5b725b3f4012 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 14:07:01 +0100 Subject: [PATCH 05/13] Extract HTMLElement --- src/CSSFontLoadingAPI/FontFaceSet.js | 4 +- src/CanvasAPI/OffscreenCanvas.js | 4 +- src/ChannelMessagingAPI/MessagePort.js | 4 +- src/ClipboardAPI/Clipboard.js | 4 +- src/DOMAPI/Animation.js | 4 +- src/DOMAPI/CharacterData.js | 4 +- src/DOMAPI/Document.js | 4 +- src/DOMAPI/DocumentFragment.js | 4 +- src/DOMAPI/Element.js | 6 +- src/DOMAPI/FillStyle.js | 8 +- src/DOMAPI/HTMLButtonElement.js | 7 +- src/DOMAPI/HTMLButtonElement.res | 694 +---------------- src/DOMAPI/HTMLCanvasElement.js | 7 +- src/DOMAPI/HTMLCanvasElement.res | 694 +---------------- src/DOMAPI/HTMLDialogElement.js | 7 +- src/DOMAPI/HTMLDialogElement.res | 694 +---------------- src/DOMAPI/HTMLElement.js | 6 +- src/DOMAPI/HTMLEmbedElement.js | 7 +- src/DOMAPI/HTMLEmbedElement.res | 691 +---------------- src/DOMAPI/HTMLFieldSetElement.js | 7 +- src/DOMAPI/HTMLFieldSetElement.res | 698 +---------------- src/DOMAPI/HTMLFormElement.js | 7 +- src/DOMAPI/HTMLFormElement.res | 688 +---------------- src/DOMAPI/HTMLIFrameElement.js | 7 +- src/DOMAPI/HTMLIFrameElement.res | 694 +---------------- src/DOMAPI/HTMLImageElement.js | 7 +- src/DOMAPI/HTMLImageElement.res | 691 +---------------- src/DOMAPI/HTMLInputElement.js | 7 +- src/DOMAPI/HTMLInputElement.res | 691 +---------------- src/DOMAPI/HTMLMediaElement.js | 7 +- src/DOMAPI/HTMLMediaElement.res | 691 +---------------- src/DOMAPI/HTMLObjectElement.js | 7 +- src/DOMAPI/HTMLObjectElement.res | 694 +---------------- src/DOMAPI/HTMLOutputElement.js | 7 +- src/DOMAPI/HTMLOutputElement.res | 694 +---------------- src/DOMAPI/HTMLScriptElement.js | 7 +- src/DOMAPI/HTMLScriptElement.res | 694 +---------------- src/DOMAPI/HTMLSlotElement.js | 7 +- src/DOMAPI/HTMLSlotElement.res | 688 +---------------- src/DOMAPI/HTMLTableElement.js | 7 +- src/DOMAPI/HTMLTableElement.res | 691 +---------------- src/DOMAPI/HTMLTableRowElement.js | 7 +- src/DOMAPI/HTMLTableRowElement.res | 698 +---------------- src/DOMAPI/HTMLTableSectionElement.js | 7 +- src/DOMAPI/HTMLTableSectionElement.res | 715 +----------------- src/DOMAPI/HTMLTextAreaElement.js | 7 +- src/DOMAPI/HTMLTextAreaElement.res | 698 +---------------- src/DOMAPI/MediaQueryList.js | 4 +- src/DOMAPI/Node.js | 6 +- src/DOMAPI/ScreenOrientation.js | 4 +- src/DOMAPI/TextTrackList.js | 4 +- src/DOMAPI/Window.js | 4 +- .../MediaKeySession.js | 4 +- src/EventAPI/AbortSignal.js | 4 +- src/IndexedDBAPI/IDBDatabase.js | 4 +- src/IndexedDBAPI/IDBTransaction.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaDevices.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaStream.js | 4 +- .../MediaStreamTrack.js | 4 +- src/NotificationAPI/Notification.js | 4 +- src/PerformanceAPI/Performance.js | 4 +- src/RemotePlaybackAPI/RemotePlayback.js | 4 +- src/ScreenWakeLockAPI/WakeLockSentinel.js | 4 +- src/ServiceWorkerAPI/ServiceWorker.js | 4 +- .../ServiceWorkerContainer.js | 4 +- .../ServiceWorkerRegistration.js | 4 +- src/WebAudioAPI/AudioNode.js | 4 +- src/WebAudioAPI/BaseAudioContext.js | 4 +- src/WebSocketsAPI/WebSocket.js | 4 +- src/WebSpeechAPI/SpeechSynthesis.js | 4 +- src/WebVTTAPI/TextTrack.js | 4 +- 71 files changed, 237 insertions(+), 12537 deletions(-) diff --git a/src/CSSFontLoadingAPI/FontFaceSet.js b/src/CSSFontLoadingAPI/FontFaceSet.js index dbf8d92..977be07 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.js +++ b/src/CSSFontLoadingAPI/FontFaceSet.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.js b/src/CanvasAPI/OffscreenCanvas.js index dbf8d92..977be07 100644 --- a/src/CanvasAPI/OffscreenCanvas.js +++ b/src/CanvasAPI/OffscreenCanvas.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.js b/src/ChannelMessagingAPI/MessagePort.js index dbf8d92..977be07 100644 --- a/src/ChannelMessagingAPI/MessagePort.js +++ b/src/ChannelMessagingAPI/MessagePort.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.js b/src/ClipboardAPI/Clipboard.js index dbf8d92..977be07 100644 --- a/src/ClipboardAPI/Clipboard.js +++ b/src/ClipboardAPI/Clipboard.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Animation.js b/src/DOMAPI/Animation.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/Animation.js +++ b/src/DOMAPI/Animation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/CharacterData.js b/src/DOMAPI/CharacterData.js index e6a3a30..2fbb7a8 100644 --- a/src/DOMAPI/CharacterData.js +++ b/src/DOMAPI/CharacterData.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Document.js b/src/DOMAPI/Document.js index e6a3a30..2fbb7a8 100644 --- a/src/DOMAPI/Document.js +++ b/src/DOMAPI/Document.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/DocumentFragment.js b/src/DOMAPI/DocumentFragment.js index e6a3a30..2fbb7a8 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/src/DOMAPI/DocumentFragment.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Element.js b/src/DOMAPI/Element.js index d7d93d7..5c41d3b 100644 --- a/src/DOMAPI/Element.js +++ b/src/DOMAPI/Element.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$WebApi.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/FillStyle.js b/src/DOMAPI/FillStyle.js index d12dfc1..1e79cc4 100644 --- a/src/DOMAPI/FillStyle.js +++ b/src/DOMAPI/FillStyle.js @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebAPI from "../CanvasAPI/CanvasPattern.js"; -import * as CanvasGradient$WebAPI from "../CanvasAPI/CanvasGradient.js"; +import * as CanvasPattern$WebApi from "../CanvasAPI/CanvasPattern.js"; +import * as CanvasGradient$WebApi from "../CanvasAPI/CanvasGradient.js"; function decode(t) { - if (CanvasGradient$WebAPI.isInstanceOf(t)) { + if (CanvasGradient$WebApi.isInstanceOf(t)) { return { TAG: "CanvasGradient", _0: t }; - } else if (CanvasPattern$WebAPI.isInstanceOf(t)) { + } else if (CanvasPattern$WebApi.isInstanceOf(t)) { return { TAG: "CanvasPattern", _0: t diff --git a/src/DOMAPI/HTMLButtonElement.js b/src/DOMAPI/HTMLButtonElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLButtonElement.js +++ b/src/DOMAPI/HTMLButtonElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLButtonElement.res b/src/DOMAPI/HTMLButtonElement.res index 00f4263..5410af0 100644 --- a/src/DOMAPI/HTMLButtonElement.res +++ b/src/DOMAPI/HTMLButtonElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlButtonElement => htmlElement = "%identity" -external asElement: htmlButtonElement => element = "%identity" -external asNode: htmlButtonElement => node = "%identity" -external asEventTarget: htmlButtonElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlButtonElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlButtonElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlButtonElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlButtonElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlButtonElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlButtonElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlButtonElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlButtonElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlButtonElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlButtonElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlButtonElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlButtonElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlButtonElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlButtonElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlButtonElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlButtonElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlButtonElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlButtonElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlButtonElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlButtonElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlButtonElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlButtonElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlButtonElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlButtonElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlButtonElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlButtonElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlButtonElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlButtonElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlButtonElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlButtonElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlButtonElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlButtonElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlButtonElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlButtonElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlButtonElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlButtonElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlButtonElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlButtonElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlButtonElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlButtonElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlButtonElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlButtonElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlButtonElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlButtonElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlButtonElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlButtonElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlButtonElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlButtonElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlButtonElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlButtonElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlButtonElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlButtonElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlButtonElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlButtonElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlButtonElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlButtonElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlButtonElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlButtonElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlButtonElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlButtonElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlButtonElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlButtonElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlButtonElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlButtonElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlButtonElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlButtonElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlButtonElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlButtonElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlButtonElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlButtonElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlButtonElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlButtonElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlButtonElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlButtonElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlButtonElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlButtonElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlButtonElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlButtonElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlButtonElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlButtonElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlButtonElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlButtonElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlButtonElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlButtonElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlButtonElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlButtonElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlButtonElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlButtonElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlButtonElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlButtonElement +}) /** Returns whether a form will validate when it is submitted, without having to submit it. diff --git a/src/DOMAPI/HTMLCanvasElement.js b/src/DOMAPI/HTMLCanvasElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLCanvasElement.js +++ b/src/DOMAPI/HTMLCanvasElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLCanvasElement.res b/src/DOMAPI/HTMLCanvasElement.res index 6fcc4da..df7e570 100644 --- a/src/DOMAPI/HTMLCanvasElement.res +++ b/src/DOMAPI/HTMLCanvasElement.res @@ -1,698 +1,10 @@ open DOMAPI -open Prelude -open EventAPI open CanvasAPI open MediaCaptureAndStreamsAPI -external asHTMLElement: htmlCanvasElement => htmlElement = "%identity" -external asElement: htmlCanvasElement => element = "%identity" -external asNode: htmlCanvasElement => node = "%identity" -external asEventTarget: htmlCanvasElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlCanvasElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlCanvasElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlCanvasElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlCanvasElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlCanvasElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlCanvasElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlCanvasElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlCanvasElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlCanvasElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlCanvasElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlCanvasElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlCanvasElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlCanvasElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlCanvasElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlCanvasElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlCanvasElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlCanvasElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlCanvasElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlCanvasElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlCanvasElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlCanvasElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlCanvasElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlCanvasElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlCanvasElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlCanvasElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlCanvasElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlCanvasElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlCanvasElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlCanvasElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlCanvasElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlCanvasElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlCanvasElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlCanvasElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlCanvasElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlCanvasElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlCanvasElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlCanvasElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlCanvasElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlCanvasElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlCanvasElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlCanvasElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlCanvasElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlCanvasElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlCanvasElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlCanvasElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlCanvasElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlCanvasElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlCanvasElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlCanvasElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlCanvasElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlCanvasElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlCanvasElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlCanvasElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlCanvasElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlCanvasElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlCanvasElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlCanvasElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlCanvasElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlCanvasElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlCanvasElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlCanvasElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlCanvasElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlCanvasElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlCanvasElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlCanvasElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlCanvasElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlCanvasElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlCanvasElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlCanvasElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlCanvasElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlCanvasElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlCanvasElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlCanvasElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlCanvasElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlCanvasElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlCanvasElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlCanvasElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlCanvasElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlCanvasElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlCanvasElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlCanvasElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlCanvasElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlCanvasElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlCanvasElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlCanvasElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlCanvasElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlCanvasElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlCanvasElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlCanvasElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlCanvasElement +}) /** Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. diff --git a/src/DOMAPI/HTMLDialogElement.js b/src/DOMAPI/HTMLDialogElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLDialogElement.js +++ b/src/DOMAPI/HTMLDialogElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDialogElement.res b/src/DOMAPI/HTMLDialogElement.res index 6113e79..1112770 100644 --- a/src/DOMAPI/HTMLDialogElement.res +++ b/src/DOMAPI/HTMLDialogElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlDialogElement => htmlElement = "%identity" -external asElement: htmlDialogElement => element = "%identity" -external asNode: htmlDialogElement => node = "%identity" -external asEventTarget: htmlDialogElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlDialogElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlDialogElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlDialogElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlDialogElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlDialogElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlDialogElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlDialogElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlDialogElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlDialogElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlDialogElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlDialogElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlDialogElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlDialogElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlDialogElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlDialogElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlDialogElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlDialogElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlDialogElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlDialogElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlDialogElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlDialogElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlDialogElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlDialogElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlDialogElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlDialogElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlDialogElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlDialogElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlDialogElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlDialogElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlDialogElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlDialogElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlDialogElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlDialogElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlDialogElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlDialogElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlDialogElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlDialogElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlDialogElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlDialogElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlDialogElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlDialogElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlDialogElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlDialogElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlDialogElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlDialogElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlDialogElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlDialogElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlDialogElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlDialogElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlDialogElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlDialogElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlDialogElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlDialogElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlDialogElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlDialogElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlDialogElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlDialogElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlDialogElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlDialogElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlDialogElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlDialogElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlDialogElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlDialogElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlDialogElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlDialogElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlDialogElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlDialogElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlDialogElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlDialogElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlDialogElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlDialogElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlDialogElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlDialogElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlDialogElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlDialogElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlDialogElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlDialogElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlDialogElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlDialogElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlDialogElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlDialogElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlDialogElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlDialogElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlDialogElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlDialogElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlDialogElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlDialogElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlDialogElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlDialogElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlDialogElement +}) /** Displays the dialog element. diff --git a/src/DOMAPI/HTMLElement.js b/src/DOMAPI/HTMLElement.js index c9fbea5..feae551 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/src/DOMAPI/HTMLElement.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebAPI from "./Element.js"; +import * as Element$WebApi from "./Element.js"; function Impl(T) { - Element$WebAPI.Impl({}); + Element$WebApi.Impl({}); return {}; } export { Impl, } -/* Element-WebAPI Not a pure module */ +/* Element-WebApi Not a pure module */ diff --git a/src/DOMAPI/HTMLEmbedElement.js b/src/DOMAPI/HTMLEmbedElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLEmbedElement.js +++ b/src/DOMAPI/HTMLEmbedElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLEmbedElement.res b/src/DOMAPI/HTMLEmbedElement.res index 8c532ff..b92577d 100644 --- a/src/DOMAPI/HTMLEmbedElement.res +++ b/src/DOMAPI/HTMLEmbedElement.res @@ -1,693 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlEmbedElement => htmlElement = "%identity" -external asElement: htmlEmbedElement => element = "%identity" -external asNode: htmlEmbedElement => node = "%identity" -external asEventTarget: htmlEmbedElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlEmbedElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlEmbedElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlEmbedElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlEmbedElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlEmbedElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlEmbedElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlEmbedElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlEmbedElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlEmbedElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlEmbedElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlEmbedElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlEmbedElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlEmbedElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlEmbedElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlEmbedElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlEmbedElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlEmbedElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlEmbedElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlEmbedElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlEmbedElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlEmbedElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlEmbedElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlEmbedElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlEmbedElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlEmbedElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlEmbedElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlEmbedElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlEmbedElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlEmbedElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlEmbedElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlEmbedElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlEmbedElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlEmbedElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlEmbedElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlEmbedElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlEmbedElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlEmbedElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlEmbedElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlEmbedElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlEmbedElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlEmbedElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlEmbedElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlEmbedElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlEmbedElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlEmbedElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlEmbedElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlEmbedElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlEmbedElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlEmbedElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlEmbedElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlEmbedElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlEmbedElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlEmbedElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlEmbedElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlEmbedElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlEmbedElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlEmbedElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlEmbedElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlEmbedElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlEmbedElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlEmbedElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlEmbedElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlEmbedElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlEmbedElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlEmbedElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlEmbedElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlEmbedElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlEmbedElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlEmbedElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlEmbedElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlEmbedElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlEmbedElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlEmbedElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlEmbedElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlEmbedElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlEmbedElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlEmbedElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlEmbedElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlEmbedElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlEmbedElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlEmbedElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlEmbedElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlEmbedElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlEmbedElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlEmbedElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlEmbedElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlEmbedElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlEmbedElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlEmbedElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlEmbedElement +}) @send external getSVGDocument: htmlEmbedElement => document = "getSVGDocument" diff --git a/src/DOMAPI/HTMLFieldSetElement.js b/src/DOMAPI/HTMLFieldSetElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLFieldSetElement.js +++ b/src/DOMAPI/HTMLFieldSetElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLFieldSetElement.res b/src/DOMAPI/HTMLFieldSetElement.res index 6d64436..5d518c4 100644 --- a/src/DOMAPI/HTMLFieldSetElement.res +++ b/src/DOMAPI/HTMLFieldSetElement.res @@ -1,700 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlFieldSetElement => htmlElement = "%identity" -external asElement: htmlFieldSetElement => element = "%identity" -external asNode: htmlFieldSetElement => node = "%identity" -external asEventTarget: htmlFieldSetElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlFieldSetElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlFieldSetElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlFieldSetElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlFieldSetElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlFieldSetElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlFieldSetElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlFieldSetElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlFieldSetElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlFieldSetElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlFieldSetElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlFieldSetElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlFieldSetElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlFieldSetElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlFieldSetElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlFieldSetElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlFieldSetElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlFieldSetElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlFieldSetElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlFieldSetElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlFieldSetElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlFieldSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlFieldSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlFieldSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlFieldSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlFieldSetElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlFieldSetElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlFieldSetElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlFieldSetElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlFieldSetElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlFieldSetElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlFieldSetElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlFieldSetElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlFieldSetElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlFieldSetElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlFieldSetElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlFieldSetElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlFieldSetElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlFieldSetElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlFieldSetElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlFieldSetElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlFieldSetElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlFieldSetElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlFieldSetElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlFieldSetElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlFieldSetElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlFieldSetElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlFieldSetElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlFieldSetElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlFieldSetElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlFieldSetElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlFieldSetElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlFieldSetElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlFieldSetElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlFieldSetElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlFieldSetElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlFieldSetElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlFieldSetElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlFieldSetElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlFieldSetElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlFieldSetElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlFieldSetElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlFieldSetElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlFieldSetElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlFieldSetElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlFieldSetElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlFieldSetElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlFieldSetElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlFieldSetElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlFieldSetElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlFieldSetElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlFieldSetElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlFieldSetElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlFieldSetElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlFieldSetElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlFieldSetElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlFieldSetElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlFieldSetElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlFieldSetElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlFieldSetElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlFieldSetElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlFieldSetElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlFieldSetElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlFieldSetElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlFieldSetElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlFieldSetElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlFieldSetElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlFieldSetElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlFieldSetElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlFieldSetElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlFieldSetElement +}) /** Returns whether a form will validate when it is submitted, without having to submit it. diff --git a/src/DOMAPI/HTMLFormElement.js b/src/DOMAPI/HTMLFormElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLFormElement.js +++ b/src/DOMAPI/HTMLFormElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLFormElement.res b/src/DOMAPI/HTMLFormElement.res index 6ef4978..02d5481 100644 --- a/src/DOMAPI/HTMLFormElement.res +++ b/src/DOMAPI/HTMLFormElement.res @@ -1,690 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlFormElement => htmlElement = "%identity" -external asElement: htmlFormElement => element = "%identity" -external asNode: htmlFormElement => node = "%identity" -external asEventTarget: htmlFormElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlFormElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlFormElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlFormElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlFormElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlFormElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlFormElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlFormElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlFormElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlFormElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlFormElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlFormElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlFormElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlFormElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlFormElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlFormElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlFormElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlFormElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlFormElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlFormElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlFormElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlFormElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlFormElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlFormElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlFormElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlFormElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlFormElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlFormElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlFormElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlFormElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlFormElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlFormElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlFormElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlFormElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlFormElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlFormElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlFormElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlFormElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlFormElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlFormElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlFormElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlFormElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlFormElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlFormElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlFormElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlFormElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlFormElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlFormElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlFormElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlFormElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlFormElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlFormElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlFormElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlFormElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlFormElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlFormElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlFormElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlFormElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlFormElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlFormElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlFormElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlFormElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlFormElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlFormElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlFormElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlFormElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlFormElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlFormElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlFormElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlFormElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlFormElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlFormElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlFormElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlFormElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlFormElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlFormElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlFormElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlFormElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlFormElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlFormElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlFormElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlFormElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlFormElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlFormElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlFormElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlFormElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlFormElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlFormElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlFormElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlFormElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlFormElement +}) /** Fires when a FORM is about to be submitted. diff --git a/src/DOMAPI/HTMLIFrameElement.js b/src/DOMAPI/HTMLIFrameElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLIFrameElement.js +++ b/src/DOMAPI/HTMLIFrameElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLIFrameElement.res b/src/DOMAPI/HTMLIFrameElement.res index 105a727..4d0f6c5 100644 --- a/src/DOMAPI/HTMLIFrameElement.res +++ b/src/DOMAPI/HTMLIFrameElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmliFrameElement => htmlElement = "%identity" -external asElement: htmliFrameElement => element = "%identity" -external asNode: htmliFrameElement => node = "%identity" -external asEventTarget: htmliFrameElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmliFrameElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmliFrameElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmliFrameElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmliFrameElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmliFrameElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmliFrameElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmliFrameElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmliFrameElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmliFrameElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmliFrameElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmliFrameElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmliFrameElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmliFrameElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmliFrameElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmliFrameElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmliFrameElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmliFrameElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmliFrameElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmliFrameElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmliFrameElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmliFrameElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmliFrameElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmliFrameElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmliFrameElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmliFrameElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmliFrameElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmliFrameElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmliFrameElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmliFrameElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmliFrameElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmliFrameElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmliFrameElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmliFrameElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmliFrameElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmliFrameElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmliFrameElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmliFrameElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmliFrameElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmliFrameElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmliFrameElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmliFrameElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmliFrameElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmliFrameElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmliFrameElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmliFrameElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmliFrameElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmliFrameElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmliFrameElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmliFrameElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmliFrameElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmliFrameElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmliFrameElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmliFrameElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmliFrameElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmliFrameElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmliFrameElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmliFrameElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmliFrameElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmliFrameElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmliFrameElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmliFrameElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmliFrameElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmliFrameElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmliFrameElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmliFrameElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmliFrameElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmliFrameElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmliFrameElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmliFrameElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmliFrameElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmliFrameElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmliFrameElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmliFrameElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmliFrameElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmliFrameElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmliFrameElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmliFrameElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmliFrameElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmliFrameElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmliFrameElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmliFrameElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmliFrameElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmliFrameElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmliFrameElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmliFrameElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmliFrameElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmliFrameElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmliFrameElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmliFrameElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmliFrameElement +}) @send external getSVGDocument: htmliFrameElement => document = "getSVGDocument" diff --git a/src/DOMAPI/HTMLImageElement.js b/src/DOMAPI/HTMLImageElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLImageElement.js +++ b/src/DOMAPI/HTMLImageElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLImageElement.res b/src/DOMAPI/HTMLImageElement.res index 4a2ec17..d0bab36 100644 --- a/src/DOMAPI/HTMLImageElement.res +++ b/src/DOMAPI/HTMLImageElement.res @@ -1,693 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlImageElement => htmlElement = "%identity" -external asElement: htmlImageElement => element = "%identity" -external asNode: htmlImageElement => node = "%identity" -external asEventTarget: htmlImageElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlImageElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlImageElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlImageElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlImageElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlImageElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlImageElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlImageElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlImageElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlImageElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlImageElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlImageElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlImageElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlImageElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlImageElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlImageElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlImageElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlImageElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlImageElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlImageElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlImageElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlImageElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlImageElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlImageElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlImageElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlImageElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlImageElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlImageElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlImageElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlImageElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlImageElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlImageElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlImageElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlImageElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlImageElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlImageElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlImageElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlImageElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlImageElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlImageElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlImageElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlImageElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlImageElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlImageElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlImageElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlImageElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlImageElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlImageElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlImageElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlImageElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlImageElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlImageElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlImageElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlImageElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlImageElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlImageElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlImageElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlImageElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlImageElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlImageElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlImageElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlImageElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlImageElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlImageElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlImageElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlImageElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlImageElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlImageElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlImageElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlImageElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlImageElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlImageElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlImageElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlImageElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlImageElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlImageElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlImageElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlImageElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlImageElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlImageElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlImageElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlImageElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlImageElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlImageElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlImageElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlImageElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlImageElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlImageElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlImageElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlImageElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlImageElement +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/decode) diff --git a/src/DOMAPI/HTMLInputElement.js b/src/DOMAPI/HTMLInputElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLInputElement.js +++ b/src/DOMAPI/HTMLInputElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLInputElement.res b/src/DOMAPI/HTMLInputElement.res index 5a4160c..8f73a98 100644 --- a/src/DOMAPI/HTMLInputElement.res +++ b/src/DOMAPI/HTMLInputElement.res @@ -1,693 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlInputElement => htmlElement = "%identity" -external asElement: htmlInputElement => element = "%identity" -external asNode: htmlInputElement => node = "%identity" -external asEventTarget: htmlInputElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlInputElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlInputElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlInputElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlInputElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlInputElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlInputElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlInputElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlInputElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlInputElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlInputElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlInputElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlInputElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlInputElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlInputElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlInputElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlInputElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlInputElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlInputElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlInputElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlInputElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlInputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlInputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlInputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlInputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlInputElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlInputElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlInputElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlInputElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlInputElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlInputElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlInputElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlInputElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlInputElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlInputElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlInputElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlInputElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlInputElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlInputElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlInputElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlInputElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlInputElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlInputElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlInputElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlInputElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlInputElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlInputElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlInputElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlInputElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlInputElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlInputElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlInputElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlInputElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlInputElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlInputElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlInputElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlInputElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlInputElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlInputElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlInputElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlInputElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlInputElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlInputElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlInputElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlInputElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlInputElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlInputElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlInputElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlInputElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlInputElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlInputElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlInputElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlInputElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlInputElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlInputElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlInputElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlInputElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlInputElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlInputElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlInputElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlInputElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlInputElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlInputElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlInputElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlInputElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlInputElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlInputElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlInputElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlInputElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlInputElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlInputElement +}) /** Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. diff --git a/src/DOMAPI/HTMLMediaElement.js b/src/DOMAPI/HTMLMediaElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLMediaElement.js +++ b/src/DOMAPI/HTMLMediaElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMediaElement.res b/src/DOMAPI/HTMLMediaElement.res index 3ff516f..0088928 100644 --- a/src/DOMAPI/HTMLMediaElement.res +++ b/src/DOMAPI/HTMLMediaElement.res @@ -1,695 +1,10 @@ open DOMAPI -open Prelude -open EventAPI open WebVTTAPI open EncryptedMediaExtensionsAPI -external asHTMLElement: htmlMediaElement => htmlElement = "%identity" -external asElement: htmlMediaElement => element = "%identity" -external asNode: htmlMediaElement => node = "%identity" -external asEventTarget: htmlMediaElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlMediaElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlMediaElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlMediaElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlMediaElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlMediaElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlMediaElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlMediaElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlMediaElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlMediaElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlMediaElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlMediaElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlMediaElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlMediaElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlMediaElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlMediaElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlMediaElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlMediaElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlMediaElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlMediaElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlMediaElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlMediaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlMediaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlMediaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlMediaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlMediaElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlMediaElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlMediaElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlMediaElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlMediaElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlMediaElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlMediaElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlMediaElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlMediaElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlMediaElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlMediaElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlMediaElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlMediaElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlMediaElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlMediaElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlMediaElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlMediaElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlMediaElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlMediaElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlMediaElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlMediaElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlMediaElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlMediaElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlMediaElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlMediaElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlMediaElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlMediaElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlMediaElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlMediaElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlMediaElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlMediaElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlMediaElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlMediaElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlMediaElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlMediaElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlMediaElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlMediaElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlMediaElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlMediaElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlMediaElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlMediaElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlMediaElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlMediaElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlMediaElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlMediaElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlMediaElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlMediaElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlMediaElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlMediaElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlMediaElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlMediaElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlMediaElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlMediaElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlMediaElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlMediaElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlMediaElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlMediaElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlMediaElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlMediaElement +}) /** Resets the audio or video object and loads a new media resource. diff --git a/src/DOMAPI/HTMLObjectElement.js b/src/DOMAPI/HTMLObjectElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLObjectElement.js +++ b/src/DOMAPI/HTMLObjectElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLObjectElement.res b/src/DOMAPI/HTMLObjectElement.res index 8e4874d..e412bdc 100644 --- a/src/DOMAPI/HTMLObjectElement.res +++ b/src/DOMAPI/HTMLObjectElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlObjectElement => htmlElement = "%identity" -external asElement: htmlObjectElement => element = "%identity" -external asNode: htmlObjectElement => node = "%identity" -external asEventTarget: htmlObjectElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlObjectElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlObjectElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlObjectElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlObjectElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlObjectElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlObjectElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlObjectElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlObjectElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlObjectElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlObjectElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlObjectElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlObjectElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlObjectElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlObjectElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlObjectElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlObjectElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlObjectElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlObjectElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlObjectElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlObjectElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlObjectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlObjectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlObjectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlObjectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlObjectElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlObjectElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlObjectElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlObjectElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlObjectElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlObjectElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlObjectElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlObjectElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlObjectElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlObjectElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlObjectElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlObjectElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlObjectElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlObjectElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlObjectElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlObjectElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlObjectElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlObjectElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlObjectElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlObjectElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlObjectElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlObjectElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlObjectElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlObjectElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlObjectElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlObjectElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlObjectElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlObjectElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlObjectElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlObjectElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlObjectElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlObjectElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlObjectElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlObjectElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlObjectElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlObjectElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlObjectElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlObjectElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlObjectElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlObjectElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlObjectElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlObjectElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlObjectElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlObjectElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlObjectElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlObjectElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlObjectElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlObjectElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlObjectElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlObjectElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlObjectElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlObjectElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlObjectElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlObjectElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlObjectElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlObjectElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlObjectElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlObjectElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlObjectElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlObjectElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlObjectElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlObjectElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlObjectElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlObjectElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlObjectElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlObjectElement +}) @send external getSVGDocument: htmlObjectElement => document = "getSVGDocument" diff --git a/src/DOMAPI/HTMLOutputElement.js b/src/DOMAPI/HTMLOutputElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLOutputElement.js +++ b/src/DOMAPI/HTMLOutputElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLOutputElement.res b/src/DOMAPI/HTMLOutputElement.res index ec8a4ce..f9b4ed5 100644 --- a/src/DOMAPI/HTMLOutputElement.res +++ b/src/DOMAPI/HTMLOutputElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlOutputElement => htmlElement = "%identity" -external asElement: htmlOutputElement => element = "%identity" -external asNode: htmlOutputElement => node = "%identity" -external asEventTarget: htmlOutputElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlOutputElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlOutputElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlOutputElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlOutputElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlOutputElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlOutputElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlOutputElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlOutputElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlOutputElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlOutputElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlOutputElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlOutputElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlOutputElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlOutputElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlOutputElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlOutputElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlOutputElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlOutputElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlOutputElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlOutputElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlOutputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlOutputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlOutputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlOutputElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlOutputElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlOutputElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlOutputElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlOutputElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlOutputElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlOutputElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlOutputElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlOutputElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlOutputElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlOutputElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlOutputElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlOutputElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlOutputElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlOutputElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlOutputElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlOutputElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlOutputElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlOutputElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlOutputElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlOutputElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlOutputElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlOutputElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlOutputElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlOutputElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlOutputElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlOutputElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlOutputElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlOutputElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlOutputElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlOutputElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlOutputElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlOutputElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlOutputElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlOutputElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlOutputElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlOutputElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlOutputElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlOutputElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlOutputElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlOutputElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlOutputElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlOutputElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlOutputElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlOutputElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlOutputElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlOutputElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlOutputElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlOutputElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlOutputElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlOutputElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlOutputElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlOutputElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlOutputElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlOutputElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlOutputElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlOutputElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlOutputElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlOutputElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlOutputElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlOutputElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlOutputElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlOutputElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlOutputElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlOutputElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlOutputElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlOutputElement +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/checkValidity) diff --git a/src/DOMAPI/HTMLScriptElement.js b/src/DOMAPI/HTMLScriptElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLScriptElement.js +++ b/src/DOMAPI/HTMLScriptElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLScriptElement.res b/src/DOMAPI/HTMLScriptElement.res index c3272ff..25ec64d 100644 --- a/src/DOMAPI/HTMLScriptElement.res +++ b/src/DOMAPI/HTMLScriptElement.res @@ -1,696 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlScriptElement => htmlElement = "%identity" -external asElement: htmlScriptElement => element = "%identity" -external asNode: htmlScriptElement => node = "%identity" -external asEventTarget: htmlScriptElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlScriptElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlScriptElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlScriptElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlScriptElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlScriptElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlScriptElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlScriptElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlScriptElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlScriptElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlScriptElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlScriptElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlScriptElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlScriptElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlScriptElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlScriptElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlScriptElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlScriptElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlScriptElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlScriptElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlScriptElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlScriptElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlScriptElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlScriptElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlScriptElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlScriptElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlScriptElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlScriptElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlScriptElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlScriptElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlScriptElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlScriptElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlScriptElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlScriptElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlScriptElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlScriptElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlScriptElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlScriptElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlScriptElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlScriptElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlScriptElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlScriptElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlScriptElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlScriptElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlScriptElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlScriptElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlScriptElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlScriptElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlScriptElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlScriptElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlScriptElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlScriptElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlScriptElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlScriptElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlScriptElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlScriptElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlScriptElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlScriptElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlScriptElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlScriptElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlScriptElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlScriptElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlScriptElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlScriptElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlScriptElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlScriptElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlScriptElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlScriptElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlScriptElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlScriptElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlScriptElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlScriptElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlScriptElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlScriptElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlScriptElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlScriptElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlScriptElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlScriptElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlScriptElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlScriptElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlScriptElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlScriptElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlScriptElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlScriptElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlScriptElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlScriptElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlScriptElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlScriptElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlScriptElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlScriptElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlScriptElement +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLScriptElement/supports_static) diff --git a/src/DOMAPI/HTMLSlotElement.js b/src/DOMAPI/HTMLSlotElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLSlotElement.js +++ b/src/DOMAPI/HTMLSlotElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSlotElement.res b/src/DOMAPI/HTMLSlotElement.res index da424a4..56691fb 100644 --- a/src/DOMAPI/HTMLSlotElement.res +++ b/src/DOMAPI/HTMLSlotElement.res @@ -1,690 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlSlotElement => htmlElement = "%identity" -external asElement: htmlSlotElement => element = "%identity" -external asNode: htmlSlotElement => node = "%identity" -external asEventTarget: htmlSlotElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlSlotElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlSlotElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlSlotElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlSlotElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlSlotElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlSlotElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlSlotElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlSlotElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlSlotElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlSlotElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlSlotElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlSlotElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlSlotElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlSlotElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlSlotElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlSlotElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlSlotElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlSlotElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlSlotElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlSlotElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlSlotElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlSlotElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlSlotElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlSlotElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlSlotElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlSlotElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlSlotElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlSlotElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlSlotElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlSlotElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlSlotElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlSlotElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlSlotElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlSlotElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlSlotElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlSlotElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlSlotElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlSlotElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlSlotElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlSlotElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlSlotElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlSlotElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlSlotElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlSlotElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlSlotElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlSlotElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlSlotElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlSlotElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlSlotElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlSlotElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlSlotElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlSlotElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlSlotElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlSlotElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlSlotElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlSlotElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlSlotElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlSlotElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlSlotElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlSlotElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlSlotElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlSlotElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlSlotElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlSlotElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlSlotElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlSlotElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlSlotElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlSlotElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlSlotElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlSlotElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlSlotElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlSlotElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlSlotElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlSlotElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlSlotElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlSlotElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlSlotElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlSlotElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlSlotElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlSlotElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlSlotElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlSlotElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlSlotElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlSlotElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlSlotElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlSlotElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlSlotElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlSlotElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlSlotElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlSlotElement +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/assignedNodes) diff --git a/src/DOMAPI/HTMLTableElement.js b/src/DOMAPI/HTMLTableElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLTableElement.js +++ b/src/DOMAPI/HTMLTableElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableElement.res b/src/DOMAPI/HTMLTableElement.res index aed63e7..dec9827 100644 --- a/src/DOMAPI/HTMLTableElement.res +++ b/src/DOMAPI/HTMLTableElement.res @@ -1,693 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTableElement => htmlElement = "%identity" -external asElement: htmlTableElement => element = "%identity" -external asNode: htmlTableElement => node = "%identity" -external asEventTarget: htmlTableElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTableElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTableElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTableElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTableElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTableElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTableElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTableElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTableElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTableElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTableElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTableElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTableElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTableElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTableElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTableElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTableElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTableElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTableElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTableElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlTableElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTableElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTableElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTableElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTableElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTableElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTableElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTableElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTableElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTableElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTableElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTableElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTableElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTableElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTableElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTableElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTableElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTableElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTableElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTableElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTableElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTableElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTableElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTableElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTableElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTableElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTableElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTableElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTableElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTableElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTableElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTableElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTableElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTableElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTableElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTableElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTableElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTableElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTableElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTableElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTableElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTableElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTableElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTableElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTableElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTableElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTableElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTableElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTableElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTableElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTableElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTableElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTableElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTableElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTableElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTableElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTableElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlTableElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTableElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTableElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTableElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTableElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTableElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTableElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlTableElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTableElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTableElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTableElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTableElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTableElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTableElement +}) /** Creates an empty caption element in the table. diff --git a/src/DOMAPI/HTMLTableRowElement.js b/src/DOMAPI/HTMLTableRowElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLTableRowElement.js +++ b/src/DOMAPI/HTMLTableRowElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableRowElement.res b/src/DOMAPI/HTMLTableRowElement.res index 146616d..dd7a1dd 100644 --- a/src/DOMAPI/HTMLTableRowElement.res +++ b/src/DOMAPI/HTMLTableRowElement.res @@ -1,700 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTableRowElement => htmlElement = "%identity" -external asElement: htmlTableRowElement => element = "%identity" -external asNode: htmlTableRowElement => node = "%identity" -external asEventTarget: htmlTableRowElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTableRowElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTableRowElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTableRowElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTableRowElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTableRowElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTableRowElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTableRowElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTableRowElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTableRowElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTableRowElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTableRowElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTableRowElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTableRowElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTableRowElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTableRowElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTableRowElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTableRowElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTableRowElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTableRowElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTableRowElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTableRowElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTableRowElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTableRowElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTableRowElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTableRowElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTableRowElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTableRowElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTableRowElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTableRowElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTableRowElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTableRowElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTableRowElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTableRowElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTableRowElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTableRowElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTableRowElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTableRowElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTableRowElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTableRowElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTableRowElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTableRowElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTableRowElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTableRowElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTableRowElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTableRowElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTableRowElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTableRowElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTableRowElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTableRowElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTableRowElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTableRowElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTableRowElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTableRowElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTableRowElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTableRowElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTableRowElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTableRowElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTableRowElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTableRowElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTableRowElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTableRowElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTableRowElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTableRowElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTableRowElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTableRowElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTableRowElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTableRowElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTableRowElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTableRowElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTableRowElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTableRowElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTableRowElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTableRowElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTableRowElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTableRowElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTableRowElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTableRowElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTableRowElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTableRowElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTableRowElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTableRowElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTableRowElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTableRowElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTableRowElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTableRowElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTableRowElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTableRowElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTableRowElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTableRowElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTableRowElement +}) /** Creates a new cell in the table row, and adds the cell to the cells collection. diff --git a/src/DOMAPI/HTMLTableSectionElement.js b/src/DOMAPI/HTMLTableSectionElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLTableSectionElement.js +++ b/src/DOMAPI/HTMLTableSectionElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableSectionElement.res b/src/DOMAPI/HTMLTableSectionElement.res index da84e38..fd90084 100644 --- a/src/DOMAPI/HTMLTableSectionElement.res +++ b/src/DOMAPI/HTMLTableSectionElement.res @@ -1,717 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTableSectionElement => htmlElement = "%identity" -external asElement: htmlTableSectionElement => element = "%identity" -external asNode: htmlTableSectionElement => node = "%identity" -external asEventTarget: htmlTableSectionElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTableSectionElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTableSectionElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTableSectionElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTableSectionElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTableSectionElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTableSectionElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTableSectionElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTableSectionElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTableSectionElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTableSectionElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTableSectionElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTableSectionElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTableSectionElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTableSectionElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTableSectionElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTableSectionElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTableSectionElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTableSectionElement, ~keyframes: any, ~options: float=?) => animation = - "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTableSectionElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTableSectionElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTableSectionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTableSectionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTableSectionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTableSectionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTableSectionElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTableSectionElement, ~options: getRootNodeOptions=?) => node = - "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTableSectionElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTableSectionElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTableSectionElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTableSectionElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTableSectionElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTableSectionElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTableSectionElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTableSectionElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTableSectionElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTableSectionElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTableSectionElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTableSectionElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTableSectionElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTableSectionElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTableSectionElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTableSectionElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTableSectionElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: ( - htmlTableSectionElement, - ~namespace: string, - ~localName: string, -) => string = "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTableSectionElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTableSectionElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTableSectionElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: ( - htmlTableSectionElement, - ~namespace: string, - ~localName: string, -) => unit = "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: ( - htmlTableSectionElement, - ~qualifiedName: string, - ~force: bool=?, -) => bool = "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTableSectionElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTableSectionElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTableSectionElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: ( - htmlTableSectionElement, - ~namespace: string, - ~localName: string, -) => attr = "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTableSectionElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTableSectionElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTableSectionElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTableSectionElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTableSectionElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTableSectionElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTableSectionElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTableSectionElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTableSectionElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTableSectionElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: ( - htmlTableSectionElement, - ~where: insertPosition, - ~data: string, -) => unit = "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTableSectionElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTableSectionElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTableSectionElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTableSectionElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTableSectionElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTableSectionElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTableSectionElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTableSectionElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTableSectionElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTableSectionElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTableSectionElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTableSectionElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTableSectionElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTableSectionElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTableSectionElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTableSectionElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTableSectionElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTableSectionElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTableSectionElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTableSectionElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTableSectionElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTableSectionElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTableSectionElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTableSectionElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTableSectionElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTableSectionElement +}) /** Creates a new row (tr) in the table, and adds the row to the rows collection. diff --git a/src/DOMAPI/HTMLTextAreaElement.js b/src/DOMAPI/HTMLTextAreaElement.js index d856702..816311b 100644 --- a/src/DOMAPI/HTMLTextAreaElement.js +++ b/src/DOMAPI/HTMLTextAreaElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebApi from "./HTMLElement.js"; + +HTMLElement$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTextAreaElement.res b/src/DOMAPI/HTMLTextAreaElement.res index a771f20..6780132 100644 --- a/src/DOMAPI/HTMLTextAreaElement.res +++ b/src/DOMAPI/HTMLTextAreaElement.res @@ -1,700 +1,8 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTextAreaElement => htmlElement = "%identity" -external asElement: htmlTextAreaElement => element = "%identity" -external asNode: htmlTextAreaElement => node = "%identity" -external asEventTarget: htmlTextAreaElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTextAreaElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTextAreaElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTextAreaElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTextAreaElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTextAreaElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTextAreaElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTextAreaElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTextAreaElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTextAreaElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTextAreaElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTextAreaElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTextAreaElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTextAreaElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTextAreaElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTextAreaElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTextAreaElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTextAreaElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTextAreaElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTextAreaElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTextAreaElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTextAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTextAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTextAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTextAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTextAreaElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTextAreaElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTextAreaElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTextAreaElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTextAreaElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTextAreaElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTextAreaElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTextAreaElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTextAreaElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTextAreaElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTextAreaElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTextAreaElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTextAreaElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTextAreaElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTextAreaElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTextAreaElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTextAreaElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTextAreaElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTextAreaElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTextAreaElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTextAreaElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTextAreaElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTextAreaElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTextAreaElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTextAreaElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTextAreaElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTextAreaElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTextAreaElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTextAreaElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTextAreaElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTextAreaElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTextAreaElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTextAreaElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTextAreaElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTextAreaElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTextAreaElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTextAreaElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTextAreaElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTextAreaElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTextAreaElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTextAreaElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTextAreaElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTextAreaElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTextAreaElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTextAreaElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTextAreaElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTextAreaElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTextAreaElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTextAreaElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTextAreaElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTextAreaElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTextAreaElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTextAreaElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTextAreaElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTextAreaElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTextAreaElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTextAreaElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTextAreaElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTextAreaElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTextAreaElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTextAreaElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTextAreaElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTextAreaElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTextAreaElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTextAreaElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTextAreaElement +}) /** Returns whether a form will validate when it is submitted, without having to submit it. diff --git a/src/DOMAPI/MediaQueryList.js b/src/DOMAPI/MediaQueryList.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/MediaQueryList.js +++ b/src/DOMAPI/MediaQueryList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index d309b02..0fd239b 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebAPI.Impl({}); + EventTarget$WebApi.Impl({}); return {}; } -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/ScreenOrientation.js b/src/DOMAPI/ScreenOrientation.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/ScreenOrientation.js +++ b/src/DOMAPI/ScreenOrientation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/TextTrackList.js b/src/DOMAPI/TextTrackList.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/TextTrackList.js +++ b/src/DOMAPI/TextTrackList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Window.js b/src/DOMAPI/Window.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/Window.js +++ b/src/DOMAPI/Window.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js index dbf8d92..977be07 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/EventAPI/AbortSignal.js b/src/EventAPI/AbortSignal.js index b228e27..e8afbf4 100644 --- a/src/EventAPI/AbortSignal.js +++ b/src/EventAPI/AbortSignal.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "./EventTarget.js"; +import * as EventTarget$WebApi from "./EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBDatabase.js b/src/IndexedDBAPI/IDBDatabase.js index dbf8d92..977be07 100644 --- a/src/IndexedDBAPI/IDBDatabase.js +++ b/src/IndexedDBAPI/IDBDatabase.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBTransaction.js b/src/IndexedDBAPI/IDBTransaction.js index dbf8d92..977be07 100644 --- a/src/IndexedDBAPI/IDBTransaction.js +++ b/src/IndexedDBAPI/IDBTransaction.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.js b/src/MediaCaptureAndStreamsAPI/MediaDevices.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.js +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.js b/src/MediaCaptureAndStreamsAPI/MediaStream.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/NotificationAPI/Notification.js b/src/NotificationAPI/Notification.js index dbf8d92..977be07 100644 --- a/src/NotificationAPI/Notification.js +++ b/src/NotificationAPI/Notification.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/PerformanceAPI/Performance.js b/src/PerformanceAPI/Performance.js index dbf8d92..977be07 100644 --- a/src/PerformanceAPI/Performance.js +++ b/src/PerformanceAPI/Performance.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.js b/src/RemotePlaybackAPI/RemotePlayback.js index dbf8d92..977be07 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.js +++ b/src/RemotePlaybackAPI/RemotePlayback.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.js b/src/ScreenWakeLockAPI/WakeLockSentinel.js index dbf8d92..977be07 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.js +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorker.js b/src/ServiceWorkerAPI/ServiceWorker.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.js +++ b/src/ServiceWorkerAPI/ServiceWorker.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.js b/src/ServiceWorkerAPI/ServiceWorkerContainer.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.js +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index dbf8d92..977be07 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index dbf8d92..977be07 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebSocketsAPI/WebSocket.js b/src/WebSocketsAPI/WebSocket.js index dbf8d92..977be07 100644 --- a/src/WebSocketsAPI/WebSocket.js +++ b/src/WebSocketsAPI/WebSocket.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesis.js b/src/WebSpeechAPI/SpeechSynthesis.js index dbf8d92..977be07 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.js +++ b/src/WebSpeechAPI/SpeechSynthesis.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebVTTAPI/TextTrack.js b/src/WebVTTAPI/TextTrack.js index dbf8d92..977be07 100644 --- a/src/WebVTTAPI/TextTrack.js +++ b/src/WebVTTAPI/TextTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ From befe65960f1c782fe5ca167e717151836951bab5 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 14:17:23 +0100 Subject: [PATCH 06/13] Extract CharacterData --- src/CSSFontLoadingAPI/FontFaceSet.js | 4 +- src/CanvasAPI/OffscreenCanvas.js | 4 +- src/ChannelMessagingAPI/MessagePort.js | 4 +- src/ClipboardAPI/Clipboard.js | 4 +- src/DOMAPI/Animation.js | 4 +- src/DOMAPI/CharacterData.js | 12 +- src/DOMAPI/CharacterData.res | 133 +++++---- src/DOMAPI/Document.js | 4 +- src/DOMAPI/DocumentFragment.js | 4 +- src/DOMAPI/Element.js | 6 +- src/DOMAPI/FillStyle.js | 8 +- src/DOMAPI/HTMLButtonElement.js | 4 +- src/DOMAPI/HTMLCanvasElement.js | 4 +- src/DOMAPI/HTMLDialogElement.js | 4 +- src/DOMAPI/HTMLElement.js | 6 +- src/DOMAPI/HTMLEmbedElement.js | 4 +- src/DOMAPI/HTMLFieldSetElement.js | 4 +- src/DOMAPI/HTMLFormElement.js | 4 +- src/DOMAPI/HTMLIFrameElement.js | 4 +- src/DOMAPI/HTMLImageElement.js | 4 +- src/DOMAPI/HTMLInputElement.js | 4 +- src/DOMAPI/HTMLMediaElement.js | 4 +- src/DOMAPI/HTMLObjectElement.js | 4 +- src/DOMAPI/HTMLOutputElement.js | 4 +- src/DOMAPI/HTMLScriptElement.js | 4 +- src/DOMAPI/HTMLSlotElement.js | 4 +- src/DOMAPI/HTMLTableElement.js | 4 +- src/DOMAPI/HTMLTableRowElement.js | 4 +- src/DOMAPI/HTMLTableSectionElement.js | 4 +- src/DOMAPI/HTMLTextAreaElement.js | 4 +- src/DOMAPI/MediaQueryList.js | 4 +- src/DOMAPI/Node.js | 6 +- src/DOMAPI/ScreenOrientation.js | 4 +- src/DOMAPI/Text.js | 7 +- src/DOMAPI/Text.res | 275 +----------------- src/DOMAPI/TextTrackList.js | 4 +- src/DOMAPI/Window.js | 4 +- .../MediaKeySession.js | 4 +- src/EventAPI/AbortSignal.js | 4 +- src/IndexedDBAPI/IDBDatabase.js | 4 +- src/IndexedDBAPI/IDBTransaction.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaDevices.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaStream.js | 4 +- .../MediaStreamTrack.js | 4 +- src/NotificationAPI/Notification.js | 4 +- src/PerformanceAPI/Performance.js | 4 +- src/RemotePlaybackAPI/RemotePlayback.js | 4 +- src/RemotePlaybackAPI/RemotePlayback.res | 1 - src/ScreenWakeLockAPI/WakeLockSentinel.js | 4 +- src/ServiceWorkerAPI/ServiceWorker.js | 4 +- .../ServiceWorkerContainer.js | 4 +- .../ServiceWorkerRegistration.js | 4 +- src/WebAudioAPI/AudioNode.js | 4 +- src/WebAudioAPI/AudioNode.res | 1 - src/WebAudioAPI/BaseAudioContext.js | 4 +- src/WebSocketsAPI/WebSocket.js | 4 +- src/WebSpeechAPI/SpeechSynthesis.js | 4 +- src/WebVTTAPI/TextTrack.js | 4 +- 58 files changed, 201 insertions(+), 446 deletions(-) diff --git a/src/CSSFontLoadingAPI/FontFaceSet.js b/src/CSSFontLoadingAPI/FontFaceSet.js index 977be07..dbf8d92 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.js +++ b/src/CSSFontLoadingAPI/FontFaceSet.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.js b/src/CanvasAPI/OffscreenCanvas.js index 977be07..dbf8d92 100644 --- a/src/CanvasAPI/OffscreenCanvas.js +++ b/src/CanvasAPI/OffscreenCanvas.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.js b/src/ChannelMessagingAPI/MessagePort.js index 977be07..dbf8d92 100644 --- a/src/ChannelMessagingAPI/MessagePort.js +++ b/src/ChannelMessagingAPI/MessagePort.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.js b/src/ClipboardAPI/Clipboard.js index 977be07..dbf8d92 100644 --- a/src/ClipboardAPI/Clipboard.js +++ b/src/ClipboardAPI/Clipboard.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Animation.js b/src/DOMAPI/Animation.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/Animation.js +++ b/src/DOMAPI/Animation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/CharacterData.js b/src/DOMAPI/CharacterData.js index 2fbb7a8..d7d93d7 100644 --- a/src/DOMAPI/CharacterData.js +++ b/src/DOMAPI/CharacterData.js @@ -1,7 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebApi from "./Node.js"; +import * as Node$WebAPI from "./Node.js"; -Node$WebApi.Impl({}); +function Impl(T) { + Node$WebAPI.Impl({}); + return {}; +} +Node$WebAPI.Impl({}); + +export { + Impl, +} /* Not a pure module */ diff --git a/src/DOMAPI/CharacterData.res b/src/DOMAPI/CharacterData.res index 0eb4a04..e46dc11 100644 --- a/src/DOMAPI/CharacterData.res +++ b/src/DOMAPI/CharacterData.res @@ -1,98 +1,109 @@ open DOMAPI open EventAPI -include Node.Impl({ - type t = characterData -}) +module Impl = ( + T: { + type t + }, +) => { + include Node.Impl({ + type t = T.t + }) + + external asCharacterData: T.t => characterData = "%identity" + + /** +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) +*/ + @send + external after: (T.t, node) => unit = "after" + + /** +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. -/** +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) +*/ + @send + external after2: (T.t, string) => unit = "after" + + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) +*/ + @send + external appendData: (T.t, string) => unit = "appendData" + + /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) */ -@send -external before: (characterData, node) => unit = "before" + @send + external before: (T.t, node) => unit = "before" -/** + /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) */ -@send -external before2: (characterData, string) => unit = "before" + @send + external before2: (T.t, string) => unit = "before" -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) +*/ + @send + external deleteData: (T.t, ~offset: int, ~count: int) => unit = "deleteData" -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) */ -@send -external after: (characterData, node) => unit = "after" + @send + external insertData: (T.t, ~offset: int, ~data: string) => unit = "insertData" -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + /** +Removes node. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) +*/ + @send + external remove: T.t => unit = "remove" -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) */ -@send -external after2: (characterData, string) => unit = "after" + @send + external replaceData: (T.t, ~offset: int, ~count: int, ~data: string) => unit = "replaceData" -/** + /** Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ -@send -external replaceWith: (characterData, node) => unit = "replaceWith" + @send + external replaceWith: (T.t, node) => unit = "replaceWith" -/** + /** Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ -@send -external replaceWith2: (characterData, string) => unit = "replaceWith" + @send + external replaceWith2: (T.t, string) => unit = "replaceWith" -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: characterData => unit = "remove" - -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) */ -@send -external substringData: (characterData, ~offset: int, ~count: int) => string = "substringData" + @send + external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData" +} -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) -*/ -@send -external appendData: (characterData, string) => unit = "appendData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) -*/ -@send -external insertData: (characterData, ~offset: int, ~data: string) => unit = "insertData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) -*/ -@send -external deleteData: (characterData, ~offset: int, ~count: int) => unit = "deleteData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) -*/ -@send -external replaceData: (characterData, ~offset: int, ~count: int, ~data: string) => unit = - "replaceData" +include Impl({ + type t = characterData +}) diff --git a/src/DOMAPI/Document.js b/src/DOMAPI/Document.js index 2fbb7a8..e6a3a30 100644 --- a/src/DOMAPI/Document.js +++ b/src/DOMAPI/Document.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebApi from "./Node.js"; +import * as Node$WebAPI from "./Node.js"; -Node$WebApi.Impl({}); +Node$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/DocumentFragment.js b/src/DOMAPI/DocumentFragment.js index 2fbb7a8..e6a3a30 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/src/DOMAPI/DocumentFragment.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebApi from "./Node.js"; +import * as Node$WebAPI from "./Node.js"; -Node$WebApi.Impl({}); +Node$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Element.js b/src/DOMAPI/Element.js index 5c41d3b..d7d93d7 100644 --- a/src/DOMAPI/Element.js +++ b/src/DOMAPI/Element.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebApi from "./Node.js"; +import * as Node$WebAPI from "./Node.js"; function Impl(T) { - Node$WebApi.Impl({}); + Node$WebAPI.Impl({}); return {}; } -Node$WebApi.Impl({}); +Node$WebAPI.Impl({}); export { Impl, diff --git a/src/DOMAPI/FillStyle.js b/src/DOMAPI/FillStyle.js index 1e79cc4..d12dfc1 100644 --- a/src/DOMAPI/FillStyle.js +++ b/src/DOMAPI/FillStyle.js @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebApi from "../CanvasAPI/CanvasPattern.js"; -import * as CanvasGradient$WebApi from "../CanvasAPI/CanvasGradient.js"; +import * as CanvasPattern$WebAPI from "../CanvasAPI/CanvasPattern.js"; +import * as CanvasGradient$WebAPI from "../CanvasAPI/CanvasGradient.js"; function decode(t) { - if (CanvasGradient$WebApi.isInstanceOf(t)) { + if (CanvasGradient$WebAPI.isInstanceOf(t)) { return { TAG: "CanvasGradient", _0: t }; - } else if (CanvasPattern$WebApi.isInstanceOf(t)) { + } else if (CanvasPattern$WebAPI.isInstanceOf(t)) { return { TAG: "CanvasPattern", _0: t diff --git a/src/DOMAPI/HTMLButtonElement.js b/src/DOMAPI/HTMLButtonElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLButtonElement.js +++ b/src/DOMAPI/HTMLButtonElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLCanvasElement.js b/src/DOMAPI/HTMLCanvasElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLCanvasElement.js +++ b/src/DOMAPI/HTMLCanvasElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDialogElement.js b/src/DOMAPI/HTMLDialogElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLDialogElement.js +++ b/src/DOMAPI/HTMLDialogElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLElement.js b/src/DOMAPI/HTMLElement.js index feae551..c9fbea5 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/src/DOMAPI/HTMLElement.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebApi from "./Element.js"; +import * as Element$WebAPI from "./Element.js"; function Impl(T) { - Element$WebApi.Impl({}); + Element$WebAPI.Impl({}); return {}; } export { Impl, } -/* Element-WebApi Not a pure module */ +/* Element-WebAPI Not a pure module */ diff --git a/src/DOMAPI/HTMLEmbedElement.js b/src/DOMAPI/HTMLEmbedElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLEmbedElement.js +++ b/src/DOMAPI/HTMLEmbedElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLFieldSetElement.js b/src/DOMAPI/HTMLFieldSetElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLFieldSetElement.js +++ b/src/DOMAPI/HTMLFieldSetElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLFormElement.js b/src/DOMAPI/HTMLFormElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLFormElement.js +++ b/src/DOMAPI/HTMLFormElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLIFrameElement.js b/src/DOMAPI/HTMLIFrameElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLIFrameElement.js +++ b/src/DOMAPI/HTMLIFrameElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLImageElement.js b/src/DOMAPI/HTMLImageElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLImageElement.js +++ b/src/DOMAPI/HTMLImageElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLInputElement.js b/src/DOMAPI/HTMLInputElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLInputElement.js +++ b/src/DOMAPI/HTMLInputElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMediaElement.js b/src/DOMAPI/HTMLMediaElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLMediaElement.js +++ b/src/DOMAPI/HTMLMediaElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLObjectElement.js b/src/DOMAPI/HTMLObjectElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLObjectElement.js +++ b/src/DOMAPI/HTMLObjectElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLOutputElement.js b/src/DOMAPI/HTMLOutputElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLOutputElement.js +++ b/src/DOMAPI/HTMLOutputElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLScriptElement.js b/src/DOMAPI/HTMLScriptElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLScriptElement.js +++ b/src/DOMAPI/HTMLScriptElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLSlotElement.js b/src/DOMAPI/HTMLSlotElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLSlotElement.js +++ b/src/DOMAPI/HTMLSlotElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableElement.js b/src/DOMAPI/HTMLTableElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLTableElement.js +++ b/src/DOMAPI/HTMLTableElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableRowElement.js b/src/DOMAPI/HTMLTableRowElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLTableRowElement.js +++ b/src/DOMAPI/HTMLTableRowElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableSectionElement.js b/src/DOMAPI/HTMLTableSectionElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLTableSectionElement.js +++ b/src/DOMAPI/HTMLTableSectionElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTextAreaElement.js b/src/DOMAPI/HTMLTextAreaElement.js index 816311b..1541b40 100644 --- a/src/DOMAPI/HTMLTextAreaElement.js +++ b/src/DOMAPI/HTMLTextAreaElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebApi from "./HTMLElement.js"; +import * as HTMLElement$WebAPI from "./HTMLElement.js"; -HTMLElement$WebApi.Impl({}); +HTMLElement$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/MediaQueryList.js b/src/DOMAPI/MediaQueryList.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/MediaQueryList.js +++ b/src/DOMAPI/MediaQueryList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index 0fd239b..d309b02 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebApi.Impl({}); + EventTarget$WebAPI.Impl({}); return {}; } -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); export { Impl, diff --git a/src/DOMAPI/ScreenOrientation.js b/src/DOMAPI/ScreenOrientation.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/ScreenOrientation.js +++ b/src/DOMAPI/ScreenOrientation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Text.js b/src/DOMAPI/Text.js index d856702..4670387 100644 --- a/src/DOMAPI/Text.js +++ b/src/DOMAPI/Text.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as CharacterData$WebAPI from "./CharacterData.js"; + +CharacterData$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Text.res b/src/DOMAPI/Text.res index 35afbb0..3c88fa4 100644 --- a/src/DOMAPI/Text.res +++ b/src/DOMAPI/Text.res @@ -1,5 +1,8 @@ open DOMAPI -open EventAPI + +include CharacterData.Impl({ + type t = text +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Text) @@ -7,276 +10,6 @@ open EventAPI @new external make: (~data: string=?) => text = "Text" -external asCharacterData: text => characterData = "%identity" -external asNode: text => node = "%identity" -external asEventTarget: text => eventTarget = "%identity" -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (text, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (text, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (text, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (text, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (text, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (text, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: text => unit = "remove" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - text, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - text, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - text, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - text, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (text, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (text, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: text => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: text => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (text, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (text, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (text, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (text, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (text, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (text, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (text, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (text, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (text, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (text, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (text, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (text, 't) => 't = "removeChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) -*/ -@send -external substringData: (text, ~offset: int, ~count: int) => string = "substringData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) -*/ -@send -external appendData: (text, string) => unit = "appendData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) -*/ -@send -external insertData: (text, ~offset: int, ~data: string) => unit = "insertData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) -*/ -@send -external deleteData: (text, ~offset: int, ~count: int) => unit = "deleteData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) -*/ -@send -external replaceData: (text, ~offset: int, ~count: int, ~data: string) => unit = "replaceData" - /** Splits data at the given offset and returns the remainder as Text node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Text/splitText) diff --git a/src/DOMAPI/TextTrackList.js b/src/DOMAPI/TextTrackList.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/TextTrackList.js +++ b/src/DOMAPI/TextTrackList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Window.js b/src/DOMAPI/Window.js index 977be07..dbf8d92 100644 --- a/src/DOMAPI/Window.js +++ b/src/DOMAPI/Window.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js index 977be07..dbf8d92 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/EventAPI/AbortSignal.js b/src/EventAPI/AbortSignal.js index e8afbf4..b228e27 100644 --- a/src/EventAPI/AbortSignal.js +++ b/src/EventAPI/AbortSignal.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "./EventTarget.js"; +import * as EventTarget$WebAPI from "./EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBDatabase.js b/src/IndexedDBAPI/IDBDatabase.js index 977be07..dbf8d92 100644 --- a/src/IndexedDBAPI/IDBDatabase.js +++ b/src/IndexedDBAPI/IDBDatabase.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBTransaction.js b/src/IndexedDBAPI/IDBTransaction.js index 977be07..dbf8d92 100644 --- a/src/IndexedDBAPI/IDBTransaction.js +++ b/src/IndexedDBAPI/IDBTransaction.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.js b/src/MediaCaptureAndStreamsAPI/MediaDevices.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.js +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.js b/src/MediaCaptureAndStreamsAPI/MediaStream.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js index 977be07..dbf8d92 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/NotificationAPI/Notification.js b/src/NotificationAPI/Notification.js index 977be07..dbf8d92 100644 --- a/src/NotificationAPI/Notification.js +++ b/src/NotificationAPI/Notification.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/PerformanceAPI/Performance.js b/src/PerformanceAPI/Performance.js index 977be07..dbf8d92 100644 --- a/src/PerformanceAPI/Performance.js +++ b/src/PerformanceAPI/Performance.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.js b/src/RemotePlaybackAPI/RemotePlayback.js index 977be07..dbf8d92 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.js +++ b/src/RemotePlaybackAPI/RemotePlayback.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.res b/src/RemotePlaybackAPI/RemotePlayback.res index 67d675c..bb21178 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.res +++ b/src/RemotePlaybackAPI/RemotePlayback.res @@ -1,4 +1,3 @@ -open EventAPI open RemotePlaybackAPI include EventTarget.Impl({ diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.js b/src/ScreenWakeLockAPI/WakeLockSentinel.js index 977be07..dbf8d92 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.js +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorker.js b/src/ServiceWorkerAPI/ServiceWorker.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.js +++ b/src/ServiceWorkerAPI/ServiceWorker.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.js b/src/ServiceWorkerAPI/ServiceWorkerContainer.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.js +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js index 977be07..dbf8d92 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index 977be07..dbf8d92 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.res b/src/WebAudioAPI/AudioNode.res index d39d67f..a83e674 100644 --- a/src/WebAudioAPI/AudioNode.res +++ b/src/WebAudioAPI/AudioNode.res @@ -1,4 +1,3 @@ -open EventAPI open WebAudioAPI include EventTarget.Impl({ diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index 977be07..dbf8d92 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebSocketsAPI/WebSocket.js b/src/WebSocketsAPI/WebSocket.js index 977be07..dbf8d92 100644 --- a/src/WebSocketsAPI/WebSocket.js +++ b/src/WebSocketsAPI/WebSocket.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesis.js b/src/WebSpeechAPI/SpeechSynthesis.js index 977be07..dbf8d92 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.js +++ b/src/WebSpeechAPI/SpeechSynthesis.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ diff --git a/src/WebVTTAPI/TextTrack.js b/src/WebVTTAPI/TextTrack.js index 977be07..dbf8d92 100644 --- a/src/WebVTTAPI/TextTrack.js +++ b/src/WebVTTAPI/TextTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebApi.Impl({}); +EventTarget$WebAPI.Impl({}); /* Not a pure module */ From e0bad5c72c706169462b4fac081b0488ace3fbe7 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 14:22:53 +0100 Subject: [PATCH 07/13] Extract DocumentFragment --- src/DOMAPI/DocumentFragment.js | 8 + src/DOMAPI/DocumentFragment.res | 112 ++++++++------ src/DOMAPI/ShadowRoot.js | 7 +- src/DOMAPI/ShadowRoot.res | 259 +------------------------------- 4 files changed, 80 insertions(+), 306 deletions(-) diff --git a/src/DOMAPI/DocumentFragment.js b/src/DOMAPI/DocumentFragment.js index e6a3a30..d7d93d7 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/src/DOMAPI/DocumentFragment.js @@ -2,6 +2,14 @@ import * as Node$WebAPI from "./Node.js"; +function Impl(T) { + Node$WebAPI.Impl({}); + return {}; +} + Node$WebAPI.Impl({}); +export { + Impl, +} /* Not a pure module */ diff --git a/src/DOMAPI/DocumentFragment.res b/src/DOMAPI/DocumentFragment.res index 49d1a6f..b52239e 100644 --- a/src/DOMAPI/DocumentFragment.res +++ b/src/DOMAPI/DocumentFragment.res @@ -2,86 +2,98 @@ open DOMAPI open EventAPI /** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragmentFragment) */ @new external make: unit => documentFragment = "DocumentFragment" -include Node.Impl({ - type t = documentFragment -}) +module Impl = ( + T: { + type t + }, +) => { + include Node.Impl({ + type t = T.t + }) -/** -Returns the first element within node's descendants whose ID is elementId. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById) + external asDocumentFragment: T.t => documentFragment = "%identity" + + /** +Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. + +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append) */ -@send -external getElementById: (documentFragment, string) => element = "getElementById" + @send + external append: (T.t, node) => unit = "append" -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append) */ -@send -external prepend: (documentFragment, node) => unit = "prepend" + @send + external append2: (T.t, string) => unit = "append" -/** + /** +Returns the first element within node's descendants whose ID is elementId. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/getElementById) +*/ + @send + external getElementById: (T.t, string) => element = "getElementById" + + /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend) */ -@send -external prepend2: (documentFragment, string) => unit = "prepend" + @send + external prepend: (T.t, node) => unit = "prepend" -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. + /** +Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend) */ -@send -external append: (documentFragment, node) => unit = "append" + @send + external prepend2: (T.t, string) => unit = "prepend" -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. + /** +Returns the first element that is a descendant of node that matches selectors. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector) +*/ + @send + external querySelector: (T.t, string) => element = "querySelector" -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) + /** +Returns all element descendants of node that match selectors. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll) */ -@send -external append2: (documentFragment, string) => unit = "append" + @send + external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll" -/** + /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren) */ -@send -external replaceChildren: (documentFragment, node) => unit = "replaceChildren" + @send + external replaceChildren: (T.t, node) => unit = "replaceChildren" -/** + /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren) */ -@send -external replaceChildren2: (documentFragment, string) => unit = "replaceChildren" + @send + external replaceChildren2: (T.t, string) => unit = "replaceChildren" +} -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (documentFragment, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (documentFragment, string) => nodeList = "querySelectorAll" +include Impl({ + type t = documentFragment +}) diff --git a/src/DOMAPI/ShadowRoot.js b/src/DOMAPI/ShadowRoot.js index d856702..360355a 100644 --- a/src/DOMAPI/ShadowRoot.js +++ b/src/DOMAPI/ShadowRoot.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as DocumentFragment$WebAPI from "./DocumentFragment.js"; + +DocumentFragment$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/ShadowRoot.res b/src/DOMAPI/ShadowRoot.res index 7801123..19c91ec 100644 --- a/src/DOMAPI/ShadowRoot.res +++ b/src/DOMAPI/ShadowRoot.res @@ -1,266 +1,15 @@ open DOMAPI -open EventAPI -external asDocumentFragment: shadowRoot => documentFragment = "%identity" -external asNode: shadowRoot => node = "%identity" -external asEventTarget: shadowRoot => eventTarget = "%identity" +include DocumentFragment.Impl({ + type t = shadowRoot +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getAnimations) */ @send external getAnimations: shadowRoot => array = "getAnimations" -/** -Returns the first element within node's descendants whose ID is elementId. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById) -*/ -@send -external getElementById: (shadowRoot, string) => element = "getElementById" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (shadowRoot, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (shadowRoot, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (shadowRoot, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (shadowRoot, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (shadowRoot, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (shadowRoot, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (shadowRoot, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (shadowRoot, string) => nodeList = "querySelectorAll" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - shadowRoot, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - shadowRoot, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - shadowRoot, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - shadowRoot, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (shadowRoot, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (shadowRoot, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: shadowRoot => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: shadowRoot => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (shadowRoot, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (shadowRoot, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (shadowRoot, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (shadowRoot, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (shadowRoot, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (shadowRoot, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (shadowRoot, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (shadowRoot, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (shadowRoot, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (shadowRoot, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (shadowRoot, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (shadowRoot, 't) => 't = "removeChild" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ShadowRoot/setHTMLUnsafe) */ From be944b309e781503081b55d8ee8561ddc7b801ba Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 14:26:33 +0100 Subject: [PATCH 08/13] Comment inherits from CharacterData --- src/DOMAPI/Comment.js | 7 +- src/DOMAPI/Comment.res | 274 +---------------------------------------- 2 files changed, 10 insertions(+), 271 deletions(-) diff --git a/src/DOMAPI/Comment.js b/src/DOMAPI/Comment.js index d856702..4670387 100644 --- a/src/DOMAPI/Comment.js +++ b/src/DOMAPI/Comment.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as CharacterData$WebAPI from "./CharacterData.js"; + +CharacterData$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Comment.res b/src/DOMAPI/Comment.res index 04bd3d0..71924e3 100644 --- a/src/DOMAPI/Comment.res +++ b/src/DOMAPI/Comment.res @@ -1,5 +1,8 @@ open DOMAPI -open EventAPI + +include CharacterData.Impl({ + type t = comment +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Comment) @@ -7,272 +10,3 @@ open EventAPI @new external make: (~data: string=?) => comment = "Comment" -external asCharacterData: comment => characterData = "%identity" -external asNode: comment => node = "%identity" -external asEventTarget: comment => eventTarget = "%identity" -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (comment, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (comment, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (comment, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (comment, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (comment, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (comment, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: comment => unit = "remove" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - comment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - comment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - comment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - comment, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (comment, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (comment, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: comment => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: comment => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (comment, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (comment, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (comment, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (comment, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (comment, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (comment, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (comment, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (comment, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (comment, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (comment, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (comment, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (comment, 't) => 't = "removeChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) -*/ -@send -external substringData: (comment, ~offset: int, ~count: int) => string = "substringData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) -*/ -@send -external appendData: (comment, string) => unit = "appendData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) -*/ -@send -external insertData: (comment, ~offset: int, ~data: string) => unit = "insertData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) -*/ -@send -external deleteData: (comment, ~offset: int, ~count: int) => unit = "deleteData" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) -*/ -@send -external replaceData: (comment, ~offset: int, ~count: int, ~data: string) => unit = "replaceData" From 4a5f0ada6483700e91d4314645051f595b4dc8b1 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 14:48:47 +0100 Subject: [PATCH 09/13] More HTMLElement extraction --- src/ClipboardAPI/Clipboard.res | 1 - src/DOMAPI/Comment.res | 1 - src/DOMAPI/HTMLAnchorElement.js | 7 +- src/DOMAPI/HTMLAnchorElement.res | 694 +---------------------- src/DOMAPI/HTMLAreaElement.js | 7 +- src/DOMAPI/HTMLAreaElement.res | 688 +--------------------- src/DOMAPI/HTMLAudioElement.js | 7 +- src/DOMAPI/HTMLAudioElement.res | 751 +------------------------ src/DOMAPI/HTMLBRElement.js | 7 +- src/DOMAPI/HTMLBRElement.res | 687 +--------------------- src/DOMAPI/HTMLBaseElement.js | 7 +- src/DOMAPI/HTMLBaseElement.res | 688 +--------------------- src/DOMAPI/HTMLBodyElement.js | 7 +- src/DOMAPI/HTMLBodyElement.res | 688 +--------------------- src/DOMAPI/HTMLDListElement.js | 7 +- src/DOMAPI/HTMLDListElement.res | 691 +---------------------- src/DOMAPI/HTMLDataElement.js | 7 +- src/DOMAPI/HTMLDataElement.res | 688 +--------------------- src/DOMAPI/HTMLDataListElement.js | 7 +- src/DOMAPI/HTMLDataListElement.res | 698 +---------------------- src/DOMAPI/HTMLDivElement.js | 7 +- src/DOMAPI/HTMLDivElement.res | 687 +--------------------- src/DOMAPI/HTMLElement.js | 4 +- src/DOMAPI/HTMLElement.res | 6 +- src/DOMAPI/HTMLFrameSetElement.js | 7 +- src/DOMAPI/HTMLFrameSetElement.res | 698 +---------------------- src/DOMAPI/HTMLHRElement.js | 7 +- src/DOMAPI/HTMLHRElement.res | 687 +--------------------- src/DOMAPI/HTMLHeadElement.js | 7 +- src/DOMAPI/HTMLHeadElement.res | 688 +--------------------- src/DOMAPI/HTMLHeadingElement.js | 7 +- src/DOMAPI/HTMLHeadingElement.res | 694 +---------------------- src/DOMAPI/HTMLHtmlElement.js | 7 +- src/DOMAPI/HTMLHtmlElement.res | 688 +--------------------- src/DOMAPI/HTMLLIElement.js | 7 +- src/DOMAPI/HTMLLIElement.res | 687 +--------------------- src/DOMAPI/HTMLLabelElement.js | 7 +- src/DOMAPI/HTMLLabelElement.res | 691 +---------------------- src/DOMAPI/HTMLLegendElement.js | 7 +- src/DOMAPI/HTMLLegendElement.res | 694 +---------------------- src/DOMAPI/HTMLLinkElement.js | 7 +- src/DOMAPI/HTMLLinkElement.res | 688 +--------------------- src/DOMAPI/HTMLMapElement.js | 7 +- src/DOMAPI/HTMLMapElement.res | 687 +--------------------- src/DOMAPI/HTMLMediaElement.js | 8 + src/DOMAPI/HTMLMediaElement.res | 90 +-- src/DOMAPI/HTMLMenuElement.js | 7 +- src/DOMAPI/HTMLMenuElement.res | 688 +--------------------- src/DOMAPI/HTMLMetaElement.js | 7 +- src/DOMAPI/HTMLMetaElement.res | 688 +--------------------- src/DOMAPI/HTMLMeterElement.js | 7 +- src/DOMAPI/HTMLMeterElement.res | 691 +---------------------- src/DOMAPI/HTMLModElement.js | 7 +- src/DOMAPI/HTMLModElement.res | 687 +--------------------- src/DOMAPI/HTMLOListElement.js | 7 +- src/DOMAPI/HTMLOListElement.res | 691 +---------------------- src/DOMAPI/HTMLOptGroupElement.js | 7 +- src/DOMAPI/HTMLOptGroupElement.res | 698 +---------------------- src/DOMAPI/HTMLOptionElement.js | 7 +- src/DOMAPI/HTMLOptionElement.res | 694 +---------------------- src/DOMAPI/HTMLParagraphElement.js | 7 +- src/DOMAPI/HTMLParagraphElement.res | 702 +---------------------- src/DOMAPI/HTMLPictureElement.js | 7 +- src/DOMAPI/HTMLPictureElement.res | 694 +---------------------- src/DOMAPI/HTMLPreElement.js | 7 +- src/DOMAPI/HTMLPreElement.res | 687 +--------------------- src/DOMAPI/HTMLProgressElement.js | 7 +- src/DOMAPI/HTMLProgressElement.res | 698 +---------------------- src/DOMAPI/HTMLQuoteElement.js | 7 +- src/DOMAPI/HTMLQuoteElement.res | 691 +---------------------- src/DOMAPI/HTMLSelectElement.js | 7 +- src/DOMAPI/HTMLSelectElement.res | 696 +---------------------- src/DOMAPI/HTMLSourceElement.js | 7 +- src/DOMAPI/HTMLSourceElement.res | 694 +---------------------- src/DOMAPI/HTMLSpanElement.js | 7 +- src/DOMAPI/HTMLSpanElement.res | 688 +--------------------- src/DOMAPI/HTMLStyleElement.js | 7 +- src/DOMAPI/HTMLStyleElement.res | 691 +---------------------- src/DOMAPI/HTMLTableCaptionElement.js | 7 +- src/DOMAPI/HTMLTableCaptionElement.res | 715 +---------------------- src/DOMAPI/HTMLTableCellElement.js | 7 +- src/DOMAPI/HTMLTableCellElement.res | 702 +---------------------- src/DOMAPI/HTMLTemplateElement.js | 7 +- src/DOMAPI/HTMLTemplateElement.res | 698 +---------------------- src/DOMAPI/HTMLTimeElement.js | 7 +- src/DOMAPI/HTMLTimeElement.res | 688 +--------------------- src/DOMAPI/HTMLTitleElement.js | 7 +- src/DOMAPI/HTMLTitleElement.res | 691 +---------------------- src/DOMAPI/HTMLTrackElement.js | 7 +- src/DOMAPI/HTMLTrackElement.res | 691 +---------------------- src/DOMAPI/HTMLUListElement.js | 7 +- src/DOMAPI/HTMLUListElement.res | 691 +---------------------- src/DOMAPI/HTMLVideoElement.js | 7 +- src/DOMAPI/HTMLVideoElement.res | 751 +------------------------ 94 files changed, 463 insertions(+), 30522 deletions(-) diff --git a/src/ClipboardAPI/Clipboard.res b/src/ClipboardAPI/Clipboard.res index 1e6c374..28c7b2c 100644 --- a/src/ClipboardAPI/Clipboard.res +++ b/src/ClipboardAPI/Clipboard.res @@ -1,4 +1,3 @@ -open EventAPI open ClipboardAPI include EventTarget.Impl({ diff --git a/src/DOMAPI/Comment.res b/src/DOMAPI/Comment.res index 71924e3..b7ec3f8 100644 --- a/src/DOMAPI/Comment.res +++ b/src/DOMAPI/Comment.res @@ -9,4 +9,3 @@ include CharacterData.Impl({ */ @new external make: (~data: string=?) => comment = "Comment" - diff --git a/src/DOMAPI/HTMLAnchorElement.js b/src/DOMAPI/HTMLAnchorElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLAnchorElement.js +++ b/src/DOMAPI/HTMLAnchorElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLAnchorElement.res b/src/DOMAPI/HTMLAnchorElement.res index 2c7ec0f..4506d98 100644 --- a/src/DOMAPI/HTMLAnchorElement.res +++ b/src/DOMAPI/HTMLAnchorElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlAnchorElement => htmlElement = "%identity" -external asElement: htmlAnchorElement => element = "%identity" -external asNode: htmlAnchorElement => node = "%identity" -external asEventTarget: htmlAnchorElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlAnchorElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlAnchorElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlAnchorElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlAnchorElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlAnchorElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlAnchorElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlAnchorElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlAnchorElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlAnchorElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlAnchorElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlAnchorElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlAnchorElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlAnchorElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlAnchorElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlAnchorElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlAnchorElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlAnchorElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlAnchorElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlAnchorElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlAnchorElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlAnchorElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlAnchorElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlAnchorElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlAnchorElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlAnchorElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlAnchorElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlAnchorElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlAnchorElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlAnchorElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlAnchorElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlAnchorElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlAnchorElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlAnchorElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlAnchorElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlAnchorElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlAnchorElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlAnchorElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlAnchorElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlAnchorElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlAnchorElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlAnchorElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlAnchorElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlAnchorElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlAnchorElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlAnchorElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlAnchorElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlAnchorElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlAnchorElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlAnchorElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlAnchorElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlAnchorElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlAnchorElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlAnchorElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlAnchorElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlAnchorElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlAnchorElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlAnchorElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlAnchorElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlAnchorElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlAnchorElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlAnchorElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlAnchorElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlAnchorElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlAnchorElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlAnchorElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlAnchorElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlAnchorElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlAnchorElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlAnchorElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlAnchorElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlAnchorElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlAnchorElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlAnchorElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlAnchorElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlAnchorElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlAnchorElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlAnchorElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlAnchorElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlAnchorElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlAnchorElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlAnchorElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlAnchorElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlAnchorElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlAnchorElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlAnchorElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlAnchorElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlAnchorElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlAnchorElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlAnchorElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlAnchorElement +}) diff --git a/src/DOMAPI/HTMLAreaElement.js b/src/DOMAPI/HTMLAreaElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLAreaElement.js +++ b/src/DOMAPI/HTMLAreaElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLAreaElement.res b/src/DOMAPI/HTMLAreaElement.res index b22cf8c..ac2a222 100644 --- a/src/DOMAPI/HTMLAreaElement.res +++ b/src/DOMAPI/HTMLAreaElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlAreaElement => htmlElement = "%identity" -external asElement: htmlAreaElement => element = "%identity" -external asNode: htmlAreaElement => node = "%identity" -external asEventTarget: htmlAreaElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlAreaElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlAreaElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlAreaElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlAreaElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlAreaElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlAreaElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlAreaElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlAreaElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlAreaElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlAreaElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlAreaElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlAreaElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlAreaElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlAreaElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlAreaElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlAreaElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlAreaElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlAreaElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlAreaElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlAreaElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlAreaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlAreaElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlAreaElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlAreaElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlAreaElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlAreaElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlAreaElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlAreaElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlAreaElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlAreaElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlAreaElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlAreaElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlAreaElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlAreaElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlAreaElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlAreaElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlAreaElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlAreaElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlAreaElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlAreaElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlAreaElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlAreaElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlAreaElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlAreaElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlAreaElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlAreaElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlAreaElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlAreaElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlAreaElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlAreaElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlAreaElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlAreaElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlAreaElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlAreaElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlAreaElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlAreaElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlAreaElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlAreaElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlAreaElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlAreaElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlAreaElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlAreaElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlAreaElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlAreaElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlAreaElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlAreaElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlAreaElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlAreaElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlAreaElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlAreaElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlAreaElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlAreaElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlAreaElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlAreaElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlAreaElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlAreaElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlAreaElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlAreaElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlAreaElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlAreaElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlAreaElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlAreaElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlAreaElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlAreaElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlAreaElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlAreaElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlAreaElement +}) diff --git a/src/DOMAPI/HTMLAudioElement.js b/src/DOMAPI/HTMLAudioElement.js index d856702..7937791 100644 --- a/src/DOMAPI/HTMLAudioElement.js +++ b/src/DOMAPI/HTMLAudioElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLMediaElement$WebAPI from "./HTMLMediaElement.js"; + +HTMLMediaElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLAudioElement.res b/src/DOMAPI/HTMLAudioElement.res index db9f193..dd9749e 100644 --- a/src/DOMAPI/HTMLAudioElement.res +++ b/src/DOMAPI/HTMLAudioElement.res @@ -1,750 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -open WebVTTAPI -open EncryptedMediaExtensionsAPI -external asHTMLMediaElement: htmlAudioElement => htmlMediaElement = "%identity" -external asHTMLElement: htmlAudioElement => htmlElement = "%identity" -external asElement: htmlAudioElement => element = "%identity" -external asNode: htmlAudioElement => node = "%identity" -external asEventTarget: htmlAudioElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlAudioElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlAudioElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlAudioElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlAudioElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlAudioElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlAudioElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlAudioElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlAudioElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlAudioElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlAudioElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlAudioElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlAudioElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlAudioElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlAudioElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlAudioElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlAudioElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlAudioElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlAudioElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlAudioElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlAudioElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlAudioElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlAudioElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlAudioElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlAudioElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlAudioElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlAudioElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlAudioElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlAudioElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlAudioElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlAudioElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlAudioElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlAudioElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlAudioElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlAudioElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlAudioElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlAudioElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlAudioElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlAudioElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlAudioElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlAudioElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlAudioElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlAudioElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlAudioElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlAudioElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlAudioElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlAudioElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlAudioElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlAudioElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlAudioElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlAudioElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlAudioElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlAudioElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlAudioElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlAudioElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlAudioElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlAudioElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlAudioElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlAudioElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlAudioElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlAudioElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlAudioElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlAudioElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlAudioElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlAudioElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlAudioElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlAudioElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlAudioElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlAudioElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlAudioElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlAudioElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlAudioElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlAudioElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlAudioElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlAudioElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlAudioElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlAudioElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlAudioElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlAudioElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlAudioElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlAudioElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlAudioElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlAudioElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlAudioElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlAudioElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlAudioElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlAudioElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlAudioElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlAudioElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlAudioElement, ~force: bool=?) => bool = "togglePopover" - -/** -Resets the audio or video object and loads a new media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/load) -*/ -@send -external load: htmlAudioElement => unit = "load" - -/** -Returns a string that specifies whether the client can play a given media resource type. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType) -*/ -@send -external canPlayType: (htmlAudioElement, string) => canPlayTypeResult = "canPlayType" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek) -*/ -@send -external fastSeek: (htmlAudioElement, float) => unit = "fastSeek" - -/** -Loads and starts playback of a media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play) -*/ -@send -external play: htmlAudioElement => Promise.t = "play" - -/** -Pauses the current playback and sets paused to TRUE. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause) -*/ -@send -external pause: htmlAudioElement => unit = "pause" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack) -*/ -@send -external addTextTrack: ( - htmlAudioElement, - ~kind: textTrackKind, - ~label: string=?, - ~language: string=?, -) => textTrack = "addTextTrack" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId) -*/ -@send -external setSinkId: (htmlAudioElement, string) => Promise.t = "setSinkId" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys) -*/ -@send -external setMediaKeys: (htmlAudioElement, mediaKeys) => Promise.t = "setMediaKeys" +include HTMLMediaElement.Impl({ + type t = htmlAudioElement +}) diff --git a/src/DOMAPI/HTMLBRElement.js b/src/DOMAPI/HTMLBRElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLBRElement.js +++ b/src/DOMAPI/HTMLBRElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLBRElement.res b/src/DOMAPI/HTMLBRElement.res index 8c0f475..553bdef 100644 --- a/src/DOMAPI/HTMLBRElement.res +++ b/src/DOMAPI/HTMLBRElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlbrElement => htmlElement = "%identity" -external asElement: htmlbrElement => element = "%identity" -external asNode: htmlbrElement => node = "%identity" -external asEventTarget: htmlbrElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlbrElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlbrElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlbrElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlbrElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlbrElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlbrElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlbrElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlbrElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlbrElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlbrElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlbrElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlbrElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlbrElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlbrElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlbrElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlbrElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlbrElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlbrElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlbrElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlbrElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlbrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlbrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlbrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlbrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlbrElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlbrElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlbrElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlbrElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlbrElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlbrElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlbrElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlbrElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlbrElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlbrElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlbrElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlbrElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlbrElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlbrElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlbrElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlbrElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlbrElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlbrElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlbrElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlbrElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlbrElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlbrElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlbrElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlbrElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlbrElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlbrElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlbrElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlbrElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlbrElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlbrElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlbrElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlbrElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlbrElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlbrElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlbrElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlbrElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlbrElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlbrElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlbrElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlbrElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlbrElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlbrElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlbrElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlbrElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlbrElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlbrElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlbrElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlbrElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlbrElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlbrElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlbrElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlbrElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlbrElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlbrElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlbrElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlbrElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlbrElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlbrElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlbrElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlbrElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlbrElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlbrElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlbrElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlbrElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlbrElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlbrElement +}) diff --git a/src/DOMAPI/HTMLBaseElement.js b/src/DOMAPI/HTMLBaseElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLBaseElement.js +++ b/src/DOMAPI/HTMLBaseElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLBaseElement.res b/src/DOMAPI/HTMLBaseElement.res index 6e59d34..c322ed5 100644 --- a/src/DOMAPI/HTMLBaseElement.res +++ b/src/DOMAPI/HTMLBaseElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlBaseElement => htmlElement = "%identity" -external asElement: htmlBaseElement => element = "%identity" -external asNode: htmlBaseElement => node = "%identity" -external asEventTarget: htmlBaseElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlBaseElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlBaseElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlBaseElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlBaseElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlBaseElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlBaseElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlBaseElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlBaseElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlBaseElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlBaseElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlBaseElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlBaseElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlBaseElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlBaseElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlBaseElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlBaseElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlBaseElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlBaseElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlBaseElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlBaseElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlBaseElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlBaseElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlBaseElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlBaseElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlBaseElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlBaseElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlBaseElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlBaseElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlBaseElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlBaseElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlBaseElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlBaseElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlBaseElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlBaseElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlBaseElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlBaseElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlBaseElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlBaseElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlBaseElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlBaseElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlBaseElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlBaseElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlBaseElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlBaseElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlBaseElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlBaseElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlBaseElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlBaseElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlBaseElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlBaseElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlBaseElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlBaseElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlBaseElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlBaseElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlBaseElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlBaseElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlBaseElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlBaseElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlBaseElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlBaseElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlBaseElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlBaseElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlBaseElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlBaseElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlBaseElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlBaseElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlBaseElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlBaseElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlBaseElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlBaseElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlBaseElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlBaseElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlBaseElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlBaseElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlBaseElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlBaseElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlBaseElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlBaseElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlBaseElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlBaseElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlBaseElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlBaseElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlBaseElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlBaseElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlBaseElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlBaseElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlBaseElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlBaseElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlBaseElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlBaseElement +}) diff --git a/src/DOMAPI/HTMLBodyElement.js b/src/DOMAPI/HTMLBodyElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLBodyElement.js +++ b/src/DOMAPI/HTMLBodyElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLBodyElement.res b/src/DOMAPI/HTMLBodyElement.res index 345120f..0a940cb 100644 --- a/src/DOMAPI/HTMLBodyElement.res +++ b/src/DOMAPI/HTMLBodyElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlBodyElement => htmlElement = "%identity" -external asElement: htmlBodyElement => element = "%identity" -external asNode: htmlBodyElement => node = "%identity" -external asEventTarget: htmlBodyElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlBodyElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlBodyElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlBodyElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlBodyElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlBodyElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlBodyElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlBodyElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlBodyElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlBodyElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlBodyElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlBodyElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlBodyElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlBodyElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlBodyElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlBodyElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlBodyElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlBodyElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlBodyElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlBodyElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlBodyElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlBodyElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlBodyElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlBodyElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlBodyElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlBodyElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlBodyElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlBodyElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlBodyElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlBodyElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlBodyElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlBodyElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlBodyElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlBodyElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlBodyElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlBodyElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlBodyElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlBodyElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlBodyElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlBodyElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlBodyElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlBodyElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlBodyElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlBodyElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlBodyElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlBodyElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlBodyElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlBodyElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlBodyElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlBodyElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlBodyElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlBodyElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlBodyElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlBodyElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlBodyElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlBodyElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlBodyElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlBodyElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlBodyElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlBodyElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlBodyElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlBodyElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlBodyElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlBodyElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlBodyElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlBodyElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlBodyElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlBodyElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlBodyElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlBodyElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlBodyElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlBodyElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlBodyElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlBodyElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlBodyElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlBodyElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlBodyElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlBodyElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlBodyElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlBodyElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlBodyElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlBodyElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlBodyElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlBodyElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlBodyElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlBodyElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlBodyElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlBodyElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlBodyElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlBodyElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlBodyElement +}) diff --git a/src/DOMAPI/HTMLDListElement.js b/src/DOMAPI/HTMLDListElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLDListElement.js +++ b/src/DOMAPI/HTMLDListElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDListElement.res b/src/DOMAPI/HTMLDListElement.res index d9f6b71..9ff6795 100644 --- a/src/DOMAPI/HTMLDListElement.res +++ b/src/DOMAPI/HTMLDListElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmldListElement => htmlElement = "%identity" -external asElement: htmldListElement => element = "%identity" -external asNode: htmldListElement => node = "%identity" -external asEventTarget: htmldListElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmldListElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmldListElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmldListElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmldListElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmldListElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmldListElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmldListElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmldListElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmldListElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmldListElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmldListElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmldListElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmldListElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmldListElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmldListElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmldListElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmldListElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmldListElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmldListElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmldListElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmldListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmldListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmldListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmldListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmldListElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmldListElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmldListElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmldListElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmldListElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmldListElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmldListElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmldListElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmldListElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmldListElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmldListElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmldListElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmldListElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmldListElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmldListElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmldListElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmldListElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmldListElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmldListElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmldListElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmldListElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmldListElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmldListElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmldListElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmldListElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmldListElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmldListElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmldListElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmldListElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmldListElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmldListElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmldListElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmldListElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmldListElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmldListElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmldListElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmldListElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmldListElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmldListElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmldListElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmldListElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmldListElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmldListElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmldListElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmldListElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmldListElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmldListElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmldListElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmldListElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmldListElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmldListElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmldListElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmldListElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmldListElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmldListElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmldListElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmldListElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmldListElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmldListElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmldListElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmldListElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmldListElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmldListElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmldListElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmldListElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmldListElement +}) diff --git a/src/DOMAPI/HTMLDataElement.js b/src/DOMAPI/HTMLDataElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLDataElement.js +++ b/src/DOMAPI/HTMLDataElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDataElement.res b/src/DOMAPI/HTMLDataElement.res index c4ace30..a5274d7 100644 --- a/src/DOMAPI/HTMLDataElement.res +++ b/src/DOMAPI/HTMLDataElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlDataElement => htmlElement = "%identity" -external asElement: htmlDataElement => element = "%identity" -external asNode: htmlDataElement => node = "%identity" -external asEventTarget: htmlDataElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlDataElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlDataElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlDataElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlDataElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlDataElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlDataElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlDataElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlDataElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlDataElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlDataElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlDataElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlDataElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlDataElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlDataElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlDataElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlDataElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlDataElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlDataElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlDataElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlDataElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlDataElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlDataElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlDataElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlDataElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlDataElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlDataElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlDataElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlDataElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlDataElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlDataElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlDataElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlDataElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlDataElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlDataElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlDataElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlDataElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlDataElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlDataElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlDataElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlDataElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlDataElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlDataElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlDataElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlDataElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlDataElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlDataElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlDataElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlDataElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlDataElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlDataElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlDataElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlDataElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlDataElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlDataElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlDataElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlDataElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlDataElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlDataElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlDataElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlDataElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlDataElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlDataElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlDataElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlDataElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlDataElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlDataElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlDataElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlDataElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlDataElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlDataElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlDataElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlDataElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlDataElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlDataElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlDataElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlDataElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlDataElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlDataElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlDataElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlDataElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlDataElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlDataElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlDataElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlDataElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlDataElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlDataElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlDataElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlDataElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlDataElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlDataElement +}) diff --git a/src/DOMAPI/HTMLDataListElement.js b/src/DOMAPI/HTMLDataListElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLDataListElement.js +++ b/src/DOMAPI/HTMLDataListElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDataListElement.res b/src/DOMAPI/HTMLDataListElement.res index e842960..2ff33ed 100644 --- a/src/DOMAPI/HTMLDataListElement.res +++ b/src/DOMAPI/HTMLDataListElement.res @@ -1,697 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlDataListElement => htmlElement = "%identity" -external asElement: htmlDataListElement => element = "%identity" -external asNode: htmlDataListElement => node = "%identity" -external asEventTarget: htmlDataListElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlDataListElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlDataListElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlDataListElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlDataListElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlDataListElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlDataListElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlDataListElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlDataListElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlDataListElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlDataListElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlDataListElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlDataListElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlDataListElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlDataListElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlDataListElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlDataListElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlDataListElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlDataListElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlDataListElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlDataListElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlDataListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlDataListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlDataListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlDataListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlDataListElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlDataListElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlDataListElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlDataListElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlDataListElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlDataListElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlDataListElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlDataListElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlDataListElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlDataListElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlDataListElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlDataListElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlDataListElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlDataListElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlDataListElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlDataListElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlDataListElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlDataListElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlDataListElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlDataListElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlDataListElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlDataListElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlDataListElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlDataListElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlDataListElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlDataListElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlDataListElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlDataListElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlDataListElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlDataListElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlDataListElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlDataListElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlDataListElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlDataListElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlDataListElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlDataListElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlDataListElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlDataListElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlDataListElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlDataListElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlDataListElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlDataListElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlDataListElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlDataListElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlDataListElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlDataListElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlDataListElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlDataListElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlDataListElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlDataListElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlDataListElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlDataListElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlDataListElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlDataListElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlDataListElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlDataListElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlDataListElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlDataListElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlDataListElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlDataListElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlDataListElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlDataListElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlDataListElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlDataListElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlDataListElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlDataListElement +}) diff --git a/src/DOMAPI/HTMLDivElement.js b/src/DOMAPI/HTMLDivElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLDivElement.js +++ b/src/DOMAPI/HTMLDivElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDivElement.res b/src/DOMAPI/HTMLDivElement.res index cfc7b51..f3802c4 100644 --- a/src/DOMAPI/HTMLDivElement.res +++ b/src/DOMAPI/HTMLDivElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlDivElement => htmlElement = "%identity" -external asElement: htmlDivElement => element = "%identity" -external asNode: htmlDivElement => node = "%identity" -external asEventTarget: htmlDivElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlDivElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlDivElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlDivElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlDivElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlDivElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlDivElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlDivElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlDivElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlDivElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlDivElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlDivElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlDivElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlDivElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlDivElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlDivElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlDivElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlDivElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlDivElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlDivElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlDivElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlDivElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlDivElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlDivElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlDivElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlDivElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlDivElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlDivElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlDivElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlDivElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlDivElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlDivElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlDivElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlDivElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlDivElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlDivElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlDivElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlDivElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlDivElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlDivElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlDivElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlDivElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlDivElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlDivElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlDivElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlDivElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlDivElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlDivElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlDivElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlDivElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlDivElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlDivElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlDivElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlDivElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlDivElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlDivElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlDivElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlDivElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlDivElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlDivElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlDivElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlDivElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlDivElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlDivElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlDivElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlDivElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlDivElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlDivElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlDivElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlDivElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlDivElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlDivElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlDivElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlDivElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlDivElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlDivElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlDivElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlDivElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlDivElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlDivElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlDivElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlDivElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlDivElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlDivElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlDivElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlDivElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlDivElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlDivElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlDivElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlDivElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlDivElement +}) diff --git a/src/DOMAPI/HTMLElement.js b/src/DOMAPI/HTMLElement.js index c9fbea5..12e03b3 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/src/DOMAPI/HTMLElement.js @@ -7,7 +7,9 @@ function Impl(T) { return {}; } +Element$WebAPI.Impl({}); + export { Impl, } -/* Element-WebAPI Not a pure module */ +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLElement.res b/src/DOMAPI/HTMLElement.res index eca45dc..e636036 100644 --- a/src/DOMAPI/HTMLElement.res +++ b/src/DOMAPI/HTMLElement.res @@ -1,6 +1,4 @@ open DOMAPI -open Prelude -open EventAPI module Impl = ( T: { @@ -55,3 +53,7 @@ module Impl = ( @send external togglePopover: (T.t, ~force: bool=?) => bool = "togglePopover" } + +include Impl({ + type t = htmlElement +}) diff --git a/src/DOMAPI/HTMLFrameSetElement.js b/src/DOMAPI/HTMLFrameSetElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLFrameSetElement.js +++ b/src/DOMAPI/HTMLFrameSetElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLFrameSetElement.res b/src/DOMAPI/HTMLFrameSetElement.res index 7d7674f..7a7b53d 100644 --- a/src/DOMAPI/HTMLFrameSetElement.res +++ b/src/DOMAPI/HTMLFrameSetElement.res @@ -1,697 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlFrameSetElement => htmlElement = "%identity" -external asElement: htmlFrameSetElement => element = "%identity" -external asNode: htmlFrameSetElement => node = "%identity" -external asEventTarget: htmlFrameSetElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlFrameSetElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlFrameSetElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlFrameSetElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlFrameSetElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlFrameSetElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlFrameSetElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlFrameSetElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlFrameSetElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlFrameSetElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlFrameSetElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlFrameSetElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlFrameSetElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlFrameSetElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlFrameSetElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlFrameSetElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlFrameSetElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlFrameSetElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlFrameSetElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlFrameSetElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlFrameSetElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlFrameSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlFrameSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlFrameSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlFrameSetElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlFrameSetElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlFrameSetElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlFrameSetElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlFrameSetElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlFrameSetElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlFrameSetElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlFrameSetElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlFrameSetElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlFrameSetElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlFrameSetElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlFrameSetElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlFrameSetElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlFrameSetElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlFrameSetElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlFrameSetElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlFrameSetElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlFrameSetElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlFrameSetElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlFrameSetElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlFrameSetElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlFrameSetElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlFrameSetElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlFrameSetElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlFrameSetElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlFrameSetElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlFrameSetElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlFrameSetElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlFrameSetElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlFrameSetElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlFrameSetElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlFrameSetElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlFrameSetElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlFrameSetElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlFrameSetElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlFrameSetElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlFrameSetElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlFrameSetElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlFrameSetElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlFrameSetElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlFrameSetElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlFrameSetElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlFrameSetElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlFrameSetElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlFrameSetElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlFrameSetElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlFrameSetElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlFrameSetElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlFrameSetElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlFrameSetElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlFrameSetElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlFrameSetElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlFrameSetElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlFrameSetElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlFrameSetElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlFrameSetElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlFrameSetElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlFrameSetElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlFrameSetElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlFrameSetElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlFrameSetElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlFrameSetElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlFrameSetElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlFrameSetElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlFrameSetElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlFrameSetElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlFrameSetElement +}) diff --git a/src/DOMAPI/HTMLHRElement.js b/src/DOMAPI/HTMLHRElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLHRElement.js +++ b/src/DOMAPI/HTMLHRElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLHRElement.res b/src/DOMAPI/HTMLHRElement.res index 4169289..c745908 100644 --- a/src/DOMAPI/HTMLHRElement.res +++ b/src/DOMAPI/HTMLHRElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlhrElement => htmlElement = "%identity" -external asElement: htmlhrElement => element = "%identity" -external asNode: htmlhrElement => node = "%identity" -external asEventTarget: htmlhrElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlhrElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlhrElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlhrElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlhrElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlhrElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlhrElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlhrElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlhrElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlhrElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlhrElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlhrElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlhrElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlhrElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlhrElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlhrElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlhrElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlhrElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlhrElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlhrElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlhrElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlhrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlhrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlhrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlhrElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlhrElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlhrElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlhrElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlhrElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlhrElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlhrElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlhrElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlhrElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlhrElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlhrElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlhrElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlhrElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlhrElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlhrElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlhrElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlhrElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlhrElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlhrElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlhrElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlhrElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlhrElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlhrElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlhrElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlhrElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlhrElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlhrElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlhrElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlhrElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlhrElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlhrElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlhrElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlhrElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlhrElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlhrElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlhrElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlhrElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlhrElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlhrElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlhrElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlhrElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlhrElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlhrElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlhrElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlhrElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlhrElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlhrElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlhrElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlhrElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlhrElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlhrElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlhrElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlhrElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlhrElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlhrElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlhrElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlhrElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlhrElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlhrElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlhrElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlhrElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlhrElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlhrElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlhrElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlhrElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlhrElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlhrElement +}) diff --git a/src/DOMAPI/HTMLHeadElement.js b/src/DOMAPI/HTMLHeadElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLHeadElement.js +++ b/src/DOMAPI/HTMLHeadElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLHeadElement.res b/src/DOMAPI/HTMLHeadElement.res index 85659d1..ce2459d 100644 --- a/src/DOMAPI/HTMLHeadElement.res +++ b/src/DOMAPI/HTMLHeadElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlHeadElement => htmlElement = "%identity" -external asElement: htmlHeadElement => element = "%identity" -external asNode: htmlHeadElement => node = "%identity" -external asEventTarget: htmlHeadElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlHeadElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlHeadElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlHeadElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlHeadElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlHeadElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlHeadElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlHeadElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlHeadElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlHeadElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlHeadElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlHeadElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlHeadElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlHeadElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlHeadElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlHeadElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlHeadElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlHeadElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlHeadElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlHeadElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlHeadElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlHeadElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlHeadElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlHeadElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlHeadElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlHeadElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlHeadElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlHeadElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlHeadElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlHeadElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlHeadElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlHeadElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlHeadElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlHeadElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlHeadElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlHeadElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlHeadElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlHeadElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlHeadElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlHeadElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlHeadElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlHeadElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlHeadElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlHeadElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlHeadElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlHeadElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlHeadElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlHeadElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlHeadElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlHeadElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlHeadElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlHeadElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlHeadElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlHeadElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlHeadElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlHeadElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlHeadElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlHeadElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlHeadElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlHeadElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlHeadElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlHeadElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlHeadElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlHeadElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlHeadElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlHeadElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlHeadElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlHeadElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlHeadElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlHeadElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlHeadElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlHeadElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlHeadElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlHeadElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlHeadElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlHeadElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlHeadElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlHeadElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlHeadElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlHeadElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlHeadElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlHeadElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlHeadElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlHeadElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlHeadElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlHeadElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlHeadElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlHeadElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlHeadElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlHeadElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlHeadElement +}) diff --git a/src/DOMAPI/HTMLHeadingElement.js b/src/DOMAPI/HTMLHeadingElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLHeadingElement.js +++ b/src/DOMAPI/HTMLHeadingElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLHeadingElement.res b/src/DOMAPI/HTMLHeadingElement.res index 62f4b49..6fc967a 100644 --- a/src/DOMAPI/HTMLHeadingElement.res +++ b/src/DOMAPI/HTMLHeadingElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlHeadingElement => htmlElement = "%identity" -external asElement: htmlHeadingElement => element = "%identity" -external asNode: htmlHeadingElement => node = "%identity" -external asEventTarget: htmlHeadingElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlHeadingElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlHeadingElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlHeadingElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlHeadingElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlHeadingElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlHeadingElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlHeadingElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlHeadingElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlHeadingElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlHeadingElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlHeadingElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlHeadingElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlHeadingElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlHeadingElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlHeadingElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlHeadingElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlHeadingElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlHeadingElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlHeadingElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlHeadingElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlHeadingElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlHeadingElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlHeadingElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlHeadingElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlHeadingElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlHeadingElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlHeadingElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlHeadingElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlHeadingElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlHeadingElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlHeadingElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlHeadingElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlHeadingElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlHeadingElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlHeadingElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlHeadingElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlHeadingElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlHeadingElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlHeadingElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlHeadingElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlHeadingElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlHeadingElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlHeadingElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlHeadingElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlHeadingElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlHeadingElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlHeadingElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlHeadingElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlHeadingElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlHeadingElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlHeadingElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlHeadingElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlHeadingElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlHeadingElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlHeadingElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlHeadingElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlHeadingElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlHeadingElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlHeadingElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlHeadingElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlHeadingElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlHeadingElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlHeadingElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlHeadingElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlHeadingElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlHeadingElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlHeadingElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlHeadingElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlHeadingElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlHeadingElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlHeadingElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlHeadingElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlHeadingElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlHeadingElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlHeadingElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlHeadingElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlHeadingElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlHeadingElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlHeadingElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlHeadingElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlHeadingElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlHeadingElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlHeadingElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlHeadingElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlHeadingElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlHeadingElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlHeadingElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlHeadingElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlHeadingElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlHeadingElement +}) diff --git a/src/DOMAPI/HTMLHtmlElement.js b/src/DOMAPI/HTMLHtmlElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLHtmlElement.js +++ b/src/DOMAPI/HTMLHtmlElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLHtmlElement.res b/src/DOMAPI/HTMLHtmlElement.res index 66edc16..dd9ef11 100644 --- a/src/DOMAPI/HTMLHtmlElement.res +++ b/src/DOMAPI/HTMLHtmlElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlHtmlElement => htmlElement = "%identity" -external asElement: htmlHtmlElement => element = "%identity" -external asNode: htmlHtmlElement => node = "%identity" -external asEventTarget: htmlHtmlElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlHtmlElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlHtmlElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlHtmlElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlHtmlElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlHtmlElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlHtmlElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlHtmlElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlHtmlElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlHtmlElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlHtmlElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlHtmlElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlHtmlElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlHtmlElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlHtmlElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlHtmlElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlHtmlElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlHtmlElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlHtmlElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlHtmlElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlHtmlElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlHtmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlHtmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlHtmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlHtmlElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlHtmlElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlHtmlElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlHtmlElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlHtmlElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlHtmlElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlHtmlElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlHtmlElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlHtmlElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlHtmlElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlHtmlElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlHtmlElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlHtmlElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlHtmlElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlHtmlElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlHtmlElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlHtmlElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlHtmlElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlHtmlElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlHtmlElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlHtmlElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlHtmlElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlHtmlElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlHtmlElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlHtmlElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlHtmlElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlHtmlElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlHtmlElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlHtmlElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlHtmlElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlHtmlElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlHtmlElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlHtmlElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlHtmlElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlHtmlElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlHtmlElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlHtmlElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlHtmlElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlHtmlElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlHtmlElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlHtmlElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlHtmlElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlHtmlElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlHtmlElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlHtmlElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlHtmlElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlHtmlElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlHtmlElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlHtmlElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlHtmlElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlHtmlElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlHtmlElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlHtmlElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlHtmlElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlHtmlElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlHtmlElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlHtmlElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlHtmlElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlHtmlElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlHtmlElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlHtmlElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlHtmlElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlHtmlElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlHtmlElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlHtmlElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlHtmlElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlHtmlElement +}) diff --git a/src/DOMAPI/HTMLLIElement.js b/src/DOMAPI/HTMLLIElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLLIElement.js +++ b/src/DOMAPI/HTMLLIElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLLIElement.res b/src/DOMAPI/HTMLLIElement.res index 792ce2d..9dc16ac 100644 --- a/src/DOMAPI/HTMLLIElement.res +++ b/src/DOMAPI/HTMLLIElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlliElement => htmlElement = "%identity" -external asElement: htmlliElement => element = "%identity" -external asNode: htmlliElement => node = "%identity" -external asEventTarget: htmlliElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlliElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlliElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlliElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlliElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlliElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlliElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlliElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlliElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlliElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlliElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlliElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlliElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlliElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlliElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlliElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlliElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlliElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlliElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlliElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlliElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlliElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlliElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlliElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlliElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlliElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlliElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlliElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlliElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlliElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlliElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlliElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlliElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlliElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlliElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlliElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlliElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlliElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlliElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlliElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlliElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlliElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlliElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlliElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlliElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlliElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlliElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlliElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlliElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlliElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlliElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlliElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlliElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlliElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlliElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlliElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlliElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlliElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlliElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlliElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlliElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlliElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlliElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlliElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlliElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlliElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlliElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlliElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlliElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlliElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlliElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlliElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlliElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlliElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlliElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlliElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlliElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlliElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlliElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlliElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlliElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlliElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlliElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlliElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlliElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlliElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlliElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlliElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlliElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlliElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlliElement +}) diff --git a/src/DOMAPI/HTMLLabelElement.js b/src/DOMAPI/HTMLLabelElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLLabelElement.js +++ b/src/DOMAPI/HTMLLabelElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLLabelElement.res b/src/DOMAPI/HTMLLabelElement.res index a85a2a1..6bee81c 100644 --- a/src/DOMAPI/HTMLLabelElement.res +++ b/src/DOMAPI/HTMLLabelElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlLabelElement => htmlElement = "%identity" -external asElement: htmlLabelElement => element = "%identity" -external asNode: htmlLabelElement => node = "%identity" -external asEventTarget: htmlLabelElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlLabelElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlLabelElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlLabelElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlLabelElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlLabelElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlLabelElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlLabelElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlLabelElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlLabelElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlLabelElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlLabelElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlLabelElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlLabelElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlLabelElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlLabelElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlLabelElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlLabelElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlLabelElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlLabelElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlLabelElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlLabelElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlLabelElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlLabelElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlLabelElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlLabelElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlLabelElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlLabelElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlLabelElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlLabelElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlLabelElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlLabelElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlLabelElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlLabelElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlLabelElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlLabelElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlLabelElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlLabelElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlLabelElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlLabelElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlLabelElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlLabelElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlLabelElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlLabelElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlLabelElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlLabelElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlLabelElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlLabelElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlLabelElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlLabelElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlLabelElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlLabelElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlLabelElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlLabelElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlLabelElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlLabelElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlLabelElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlLabelElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlLabelElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlLabelElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlLabelElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlLabelElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlLabelElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlLabelElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlLabelElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlLabelElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlLabelElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlLabelElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlLabelElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlLabelElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlLabelElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlLabelElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlLabelElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlLabelElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlLabelElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlLabelElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlLabelElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlLabelElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlLabelElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlLabelElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlLabelElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlLabelElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlLabelElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlLabelElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlLabelElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlLabelElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlLabelElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlLabelElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlLabelElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlLabelElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlLabelElement +}) diff --git a/src/DOMAPI/HTMLLegendElement.js b/src/DOMAPI/HTMLLegendElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLLegendElement.js +++ b/src/DOMAPI/HTMLLegendElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLLegendElement.res b/src/DOMAPI/HTMLLegendElement.res index 3a37b8a..c7ce0e1 100644 --- a/src/DOMAPI/HTMLLegendElement.res +++ b/src/DOMAPI/HTMLLegendElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlLegendElement => htmlElement = "%identity" -external asElement: htmlLegendElement => element = "%identity" -external asNode: htmlLegendElement => node = "%identity" -external asEventTarget: htmlLegendElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlLegendElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlLegendElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlLegendElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlLegendElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlLegendElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlLegendElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlLegendElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlLegendElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlLegendElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlLegendElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlLegendElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlLegendElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlLegendElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlLegendElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlLegendElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlLegendElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlLegendElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlLegendElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlLegendElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlLegendElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlLegendElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlLegendElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlLegendElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlLegendElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlLegendElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlLegendElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlLegendElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlLegendElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlLegendElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlLegendElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlLegendElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlLegendElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlLegendElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlLegendElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlLegendElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlLegendElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlLegendElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlLegendElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlLegendElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlLegendElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlLegendElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlLegendElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlLegendElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlLegendElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlLegendElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlLegendElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlLegendElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlLegendElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlLegendElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlLegendElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlLegendElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlLegendElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlLegendElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlLegendElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlLegendElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlLegendElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlLegendElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlLegendElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlLegendElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlLegendElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlLegendElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlLegendElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlLegendElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlLegendElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlLegendElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlLegendElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlLegendElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlLegendElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlLegendElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlLegendElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlLegendElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlLegendElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlLegendElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlLegendElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlLegendElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlLegendElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlLegendElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlLegendElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlLegendElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlLegendElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlLegendElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlLegendElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlLegendElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlLegendElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlLegendElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlLegendElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlLegendElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlLegendElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlLegendElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlLegendElement +}) diff --git a/src/DOMAPI/HTMLLinkElement.js b/src/DOMAPI/HTMLLinkElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLLinkElement.js +++ b/src/DOMAPI/HTMLLinkElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLLinkElement.res b/src/DOMAPI/HTMLLinkElement.res index d937836..c41ec44 100644 --- a/src/DOMAPI/HTMLLinkElement.res +++ b/src/DOMAPI/HTMLLinkElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlLinkElement => htmlElement = "%identity" -external asElement: htmlLinkElement => element = "%identity" -external asNode: htmlLinkElement => node = "%identity" -external asEventTarget: htmlLinkElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlLinkElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlLinkElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlLinkElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlLinkElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlLinkElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlLinkElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlLinkElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlLinkElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlLinkElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlLinkElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlLinkElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlLinkElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlLinkElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlLinkElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlLinkElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlLinkElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlLinkElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlLinkElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlLinkElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlLinkElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlLinkElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlLinkElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlLinkElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlLinkElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlLinkElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlLinkElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlLinkElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlLinkElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlLinkElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlLinkElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlLinkElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlLinkElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlLinkElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlLinkElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlLinkElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlLinkElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlLinkElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlLinkElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlLinkElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlLinkElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlLinkElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlLinkElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlLinkElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlLinkElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlLinkElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlLinkElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlLinkElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlLinkElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlLinkElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlLinkElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlLinkElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlLinkElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlLinkElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlLinkElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlLinkElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlLinkElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlLinkElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlLinkElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlLinkElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlLinkElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlLinkElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlLinkElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlLinkElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlLinkElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlLinkElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlLinkElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlLinkElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlLinkElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlLinkElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlLinkElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlLinkElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlLinkElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlLinkElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlLinkElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlLinkElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlLinkElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlLinkElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlLinkElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlLinkElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlLinkElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlLinkElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlLinkElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlLinkElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlLinkElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlLinkElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlLinkElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlLinkElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlLinkElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlLinkElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlLinkElement +}) diff --git a/src/DOMAPI/HTMLMapElement.js b/src/DOMAPI/HTMLMapElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLMapElement.js +++ b/src/DOMAPI/HTMLMapElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMapElement.res b/src/DOMAPI/HTMLMapElement.res index 687165a..b60cdeb 100644 --- a/src/DOMAPI/HTMLMapElement.res +++ b/src/DOMAPI/HTMLMapElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlMapElement => htmlElement = "%identity" -external asElement: htmlMapElement => element = "%identity" -external asNode: htmlMapElement => node = "%identity" -external asEventTarget: htmlMapElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlMapElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlMapElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlMapElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlMapElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlMapElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlMapElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlMapElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlMapElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlMapElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlMapElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlMapElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlMapElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlMapElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlMapElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlMapElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlMapElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlMapElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlMapElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlMapElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlMapElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlMapElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlMapElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlMapElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlMapElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlMapElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlMapElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlMapElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlMapElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlMapElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlMapElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlMapElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlMapElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlMapElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlMapElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlMapElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlMapElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlMapElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlMapElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlMapElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlMapElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlMapElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlMapElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlMapElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlMapElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlMapElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlMapElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlMapElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlMapElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlMapElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlMapElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlMapElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlMapElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlMapElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlMapElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlMapElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlMapElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlMapElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlMapElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlMapElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlMapElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlMapElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlMapElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlMapElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlMapElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlMapElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlMapElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlMapElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlMapElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlMapElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlMapElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlMapElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlMapElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlMapElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlMapElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlMapElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlMapElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlMapElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlMapElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlMapElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlMapElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlMapElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlMapElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlMapElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlMapElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlMapElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlMapElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlMapElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlMapElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlMapElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlMapElement +}) diff --git a/src/DOMAPI/HTMLMediaElement.js b/src/DOMAPI/HTMLMediaElement.js index 1541b40..57eb26d 100644 --- a/src/DOMAPI/HTMLMediaElement.js +++ b/src/DOMAPI/HTMLMediaElement.js @@ -2,6 +2,14 @@ import * as HTMLElement$WebAPI from "./HTMLElement.js"; +function Impl(T) { + HTMLElement$WebAPI.Impl({}); + return {}; +} + HTMLElement$WebAPI.Impl({}); +export { + Impl, +} /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMediaElement.res b/src/DOMAPI/HTMLMediaElement.res index 0088928..8d6b40e 100644 --- a/src/DOMAPI/HTMLMediaElement.res +++ b/src/DOMAPI/HTMLMediaElement.res @@ -2,63 +2,75 @@ open DOMAPI open WebVTTAPI open EncryptedMediaExtensionsAPI -include HTMLElement.Impl({ - type t = htmlMediaElement -}) +module Impl = ( + T: { + type t + }, +) => { + include HTMLElement.Impl({ + type t = htmlMediaElement + }) -/** -Resets the audio or video object and loads a new media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/load) + external asHTMLMediaElement: T.t => htmlMediaElement = "%identity" + + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack) */ -@send -external load: htmlMediaElement => unit = "load" + @send + external addTextTrack: ( + T.t, + ~kind: textTrackKind, + ~label: string=?, + ~language: string=?, + ) => textTrack = "addTextTrack" -/** + /** Returns a string that specifies whether the client can play a given media resource type. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType) */ -@send -external canPlayType: (htmlMediaElement, string) => canPlayTypeResult = "canPlayType" + @send + external canPlayType: (T.t, string) => canPlayTypeResult = "canPlayType" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek) */ -@send -external fastSeek: (htmlMediaElement, float) => unit = "fastSeek" + @send + external fastSeek: (T.t, float) => unit = "fastSeek" -/** -Loads and starts playback of a media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play) + /** +Resets the audio or video object and loads a new media resource. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/load) */ -@send -external play: htmlMediaElement => Promise.t = "play" + @send + external load: T.t => unit = "load" -/** + /** Pauses the current playback and sets paused to TRUE. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause) */ -@send -external pause: htmlMediaElement => unit = "pause" + @send + external pause: T.t => unit = "pause" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack) + /** +Loads and starts playback of a media resource. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play) */ -@send -external addTextTrack: ( - htmlMediaElement, - ~kind: textTrackKind, - ~label: string=?, - ~language: string=?, -) => textTrack = "addTextTrack" + @send + external play: T.t => Promise.t = "play" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys) */ -@send -external setSinkId: (htmlMediaElement, string) => Promise.t = "setSinkId" + @send + external setMediaKeys: (T.t, mediaKeys) => Promise.t = "setMediaKeys" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys) + /** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId) */ -@send -external setMediaKeys: (htmlMediaElement, mediaKeys) => Promise.t = "setMediaKeys" + @send + external setSinkId: (T.t, string) => Promise.t = "setSinkId" +} + +include Impl({ + type t = htmlMediaElement +}) diff --git a/src/DOMAPI/HTMLMenuElement.js b/src/DOMAPI/HTMLMenuElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLMenuElement.js +++ b/src/DOMAPI/HTMLMenuElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMenuElement.res b/src/DOMAPI/HTMLMenuElement.res index a6af454..7d167eb 100644 --- a/src/DOMAPI/HTMLMenuElement.res +++ b/src/DOMAPI/HTMLMenuElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlMenuElement => htmlElement = "%identity" -external asElement: htmlMenuElement => element = "%identity" -external asNode: htmlMenuElement => node = "%identity" -external asEventTarget: htmlMenuElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlMenuElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlMenuElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlMenuElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlMenuElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlMenuElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlMenuElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlMenuElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlMenuElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlMenuElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlMenuElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlMenuElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlMenuElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlMenuElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlMenuElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlMenuElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlMenuElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlMenuElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlMenuElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlMenuElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlMenuElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlMenuElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlMenuElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlMenuElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlMenuElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlMenuElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlMenuElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlMenuElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlMenuElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlMenuElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlMenuElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlMenuElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlMenuElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlMenuElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlMenuElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlMenuElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlMenuElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlMenuElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlMenuElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlMenuElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlMenuElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlMenuElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlMenuElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlMenuElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlMenuElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlMenuElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlMenuElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlMenuElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlMenuElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlMenuElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlMenuElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlMenuElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlMenuElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlMenuElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlMenuElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlMenuElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlMenuElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlMenuElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlMenuElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlMenuElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlMenuElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlMenuElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlMenuElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlMenuElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlMenuElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlMenuElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlMenuElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlMenuElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlMenuElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlMenuElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlMenuElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlMenuElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlMenuElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlMenuElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlMenuElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlMenuElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlMenuElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlMenuElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlMenuElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlMenuElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlMenuElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlMenuElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlMenuElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlMenuElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlMenuElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlMenuElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlMenuElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlMenuElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlMenuElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlMenuElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlMenuElement +}) diff --git a/src/DOMAPI/HTMLMetaElement.js b/src/DOMAPI/HTMLMetaElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLMetaElement.js +++ b/src/DOMAPI/HTMLMetaElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMetaElement.res b/src/DOMAPI/HTMLMetaElement.res index 41c3868..53b7198 100644 --- a/src/DOMAPI/HTMLMetaElement.res +++ b/src/DOMAPI/HTMLMetaElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlMetaElement => htmlElement = "%identity" -external asElement: htmlMetaElement => element = "%identity" -external asNode: htmlMetaElement => node = "%identity" -external asEventTarget: htmlMetaElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlMetaElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlMetaElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlMetaElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlMetaElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlMetaElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlMetaElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlMetaElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlMetaElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlMetaElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlMetaElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlMetaElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlMetaElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlMetaElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlMetaElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlMetaElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlMetaElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlMetaElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlMetaElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlMetaElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlMetaElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlMetaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlMetaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlMetaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlMetaElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlMetaElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlMetaElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlMetaElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlMetaElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlMetaElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlMetaElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlMetaElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlMetaElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlMetaElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlMetaElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlMetaElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlMetaElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlMetaElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlMetaElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlMetaElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlMetaElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlMetaElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlMetaElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlMetaElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlMetaElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlMetaElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlMetaElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlMetaElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlMetaElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlMetaElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlMetaElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlMetaElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlMetaElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlMetaElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlMetaElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlMetaElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlMetaElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlMetaElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlMetaElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlMetaElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlMetaElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlMetaElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlMetaElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlMetaElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlMetaElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlMetaElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlMetaElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlMetaElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlMetaElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlMetaElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlMetaElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlMetaElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlMetaElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlMetaElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlMetaElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlMetaElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlMetaElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlMetaElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlMetaElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlMetaElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlMetaElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlMetaElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlMetaElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlMetaElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlMetaElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlMetaElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlMetaElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlMetaElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlMetaElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlMetaElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlMetaElement +}) diff --git a/src/DOMAPI/HTMLMeterElement.js b/src/DOMAPI/HTMLMeterElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLMeterElement.js +++ b/src/DOMAPI/HTMLMeterElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMeterElement.res b/src/DOMAPI/HTMLMeterElement.res index adf298d..90a7002 100644 --- a/src/DOMAPI/HTMLMeterElement.res +++ b/src/DOMAPI/HTMLMeterElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlMeterElement => htmlElement = "%identity" -external asElement: htmlMeterElement => element = "%identity" -external asNode: htmlMeterElement => node = "%identity" -external asEventTarget: htmlMeterElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlMeterElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlMeterElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlMeterElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlMeterElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlMeterElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlMeterElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlMeterElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlMeterElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlMeterElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlMeterElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlMeterElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlMeterElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlMeterElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlMeterElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlMeterElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlMeterElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlMeterElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlMeterElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlMeterElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlMeterElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlMeterElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlMeterElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlMeterElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlMeterElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlMeterElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlMeterElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlMeterElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlMeterElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlMeterElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlMeterElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlMeterElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlMeterElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlMeterElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlMeterElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlMeterElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlMeterElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlMeterElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlMeterElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlMeterElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlMeterElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlMeterElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlMeterElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlMeterElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlMeterElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlMeterElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlMeterElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlMeterElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlMeterElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlMeterElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlMeterElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlMeterElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlMeterElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlMeterElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlMeterElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlMeterElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlMeterElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlMeterElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlMeterElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlMeterElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlMeterElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlMeterElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlMeterElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlMeterElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlMeterElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlMeterElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlMeterElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlMeterElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlMeterElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlMeterElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlMeterElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlMeterElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlMeterElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlMeterElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlMeterElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlMeterElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlMeterElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlMeterElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlMeterElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlMeterElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlMeterElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlMeterElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlMeterElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlMeterElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlMeterElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlMeterElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlMeterElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlMeterElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlMeterElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlMeterElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlMeterElement +}) diff --git a/src/DOMAPI/HTMLModElement.js b/src/DOMAPI/HTMLModElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLModElement.js +++ b/src/DOMAPI/HTMLModElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLModElement.res b/src/DOMAPI/HTMLModElement.res index 49ace54..7ca5023 100644 --- a/src/DOMAPI/HTMLModElement.res +++ b/src/DOMAPI/HTMLModElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlModElement => htmlElement = "%identity" -external asElement: htmlModElement => element = "%identity" -external asNode: htmlModElement => node = "%identity" -external asEventTarget: htmlModElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlModElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlModElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlModElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlModElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlModElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlModElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlModElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlModElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlModElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlModElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlModElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlModElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlModElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlModElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlModElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlModElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlModElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlModElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlModElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlModElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlModElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlModElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlModElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlModElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlModElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlModElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlModElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlModElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlModElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlModElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlModElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlModElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlModElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlModElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlModElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlModElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlModElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlModElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlModElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlModElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlModElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlModElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlModElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlModElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlModElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlModElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlModElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlModElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlModElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlModElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlModElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlModElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlModElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlModElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlModElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlModElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlModElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlModElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlModElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlModElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlModElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlModElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlModElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlModElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlModElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlModElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlModElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlModElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlModElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlModElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlModElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlModElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlModElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlModElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlModElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlModElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlModElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlModElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlModElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlModElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlModElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlModElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlModElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlModElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlModElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlModElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlModElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlModElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlModElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlModElement +}) diff --git a/src/DOMAPI/HTMLOListElement.js b/src/DOMAPI/HTMLOListElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLOListElement.js +++ b/src/DOMAPI/HTMLOListElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLOListElement.res b/src/DOMAPI/HTMLOListElement.res index 5c3b560..449649a 100644 --- a/src/DOMAPI/HTMLOListElement.res +++ b/src/DOMAPI/HTMLOListElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmloListElement => htmlElement = "%identity" -external asElement: htmloListElement => element = "%identity" -external asNode: htmloListElement => node = "%identity" -external asEventTarget: htmloListElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmloListElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmloListElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmloListElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmloListElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmloListElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmloListElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmloListElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmloListElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmloListElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmloListElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmloListElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmloListElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmloListElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmloListElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmloListElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmloListElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmloListElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmloListElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmloListElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmloListElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmloListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmloListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmloListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmloListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmloListElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmloListElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmloListElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmloListElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmloListElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmloListElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmloListElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmloListElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmloListElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmloListElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmloListElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmloListElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmloListElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmloListElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmloListElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmloListElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmloListElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmloListElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmloListElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmloListElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmloListElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmloListElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmloListElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmloListElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmloListElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmloListElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmloListElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmloListElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmloListElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmloListElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmloListElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmloListElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmloListElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmloListElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmloListElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmloListElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmloListElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmloListElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmloListElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmloListElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmloListElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmloListElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmloListElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmloListElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmloListElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmloListElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmloListElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmloListElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmloListElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmloListElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmloListElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmloListElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmloListElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmloListElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmloListElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmloListElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmloListElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmloListElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmloListElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmloListElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmloListElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmloListElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmloListElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmloListElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmloListElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmloListElement +}) diff --git a/src/DOMAPI/HTMLOptGroupElement.js b/src/DOMAPI/HTMLOptGroupElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLOptGroupElement.js +++ b/src/DOMAPI/HTMLOptGroupElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLOptGroupElement.res b/src/DOMAPI/HTMLOptGroupElement.res index 3b6bd19..c79a8f9 100644 --- a/src/DOMAPI/HTMLOptGroupElement.res +++ b/src/DOMAPI/HTMLOptGroupElement.res @@ -1,697 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlOptGroupElement => htmlElement = "%identity" -external asElement: htmlOptGroupElement => element = "%identity" -external asNode: htmlOptGroupElement => node = "%identity" -external asEventTarget: htmlOptGroupElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlOptGroupElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlOptGroupElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlOptGroupElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlOptGroupElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlOptGroupElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlOptGroupElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlOptGroupElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlOptGroupElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlOptGroupElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlOptGroupElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlOptGroupElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlOptGroupElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlOptGroupElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlOptGroupElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlOptGroupElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlOptGroupElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlOptGroupElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlOptGroupElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlOptGroupElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlOptGroupElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlOptGroupElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlOptGroupElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlOptGroupElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlOptGroupElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlOptGroupElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlOptGroupElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlOptGroupElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlOptGroupElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlOptGroupElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlOptGroupElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlOptGroupElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlOptGroupElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlOptGroupElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlOptGroupElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlOptGroupElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlOptGroupElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlOptGroupElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlOptGroupElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlOptGroupElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlOptGroupElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlOptGroupElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlOptGroupElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlOptGroupElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlOptGroupElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlOptGroupElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlOptGroupElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlOptGroupElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlOptGroupElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlOptGroupElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlOptGroupElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlOptGroupElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlOptGroupElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlOptGroupElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlOptGroupElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlOptGroupElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlOptGroupElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlOptGroupElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlOptGroupElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlOptGroupElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlOptGroupElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlOptGroupElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlOptGroupElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlOptGroupElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlOptGroupElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlOptGroupElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlOptGroupElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlOptGroupElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlOptGroupElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlOptGroupElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlOptGroupElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlOptGroupElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlOptGroupElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlOptGroupElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlOptGroupElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlOptGroupElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlOptGroupElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlOptGroupElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlOptGroupElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlOptGroupElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlOptGroupElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlOptGroupElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlOptGroupElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlOptGroupElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlOptGroupElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlOptGroupElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlOptGroupElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlOptGroupElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlOptGroupElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlOptGroupElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlOptGroupElement +}) diff --git a/src/DOMAPI/HTMLOptionElement.js b/src/DOMAPI/HTMLOptionElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLOptionElement.js +++ b/src/DOMAPI/HTMLOptionElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLOptionElement.res b/src/DOMAPI/HTMLOptionElement.res index 45d5c44..d147c61 100644 --- a/src/DOMAPI/HTMLOptionElement.res +++ b/src/DOMAPI/HTMLOptionElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlOptionElement => htmlElement = "%identity" -external asElement: htmlOptionElement => element = "%identity" -external asNode: htmlOptionElement => node = "%identity" -external asEventTarget: htmlOptionElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlOptionElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlOptionElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlOptionElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlOptionElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlOptionElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlOptionElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlOptionElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlOptionElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlOptionElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlOptionElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlOptionElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlOptionElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlOptionElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlOptionElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlOptionElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlOptionElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlOptionElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlOptionElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlOptionElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlOptionElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlOptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlOptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlOptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlOptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlOptionElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlOptionElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlOptionElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlOptionElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlOptionElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlOptionElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlOptionElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlOptionElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlOptionElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlOptionElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlOptionElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlOptionElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlOptionElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlOptionElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlOptionElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlOptionElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlOptionElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlOptionElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlOptionElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlOptionElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlOptionElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlOptionElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlOptionElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlOptionElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlOptionElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlOptionElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlOptionElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlOptionElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlOptionElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlOptionElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlOptionElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlOptionElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlOptionElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlOptionElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlOptionElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlOptionElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlOptionElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlOptionElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlOptionElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlOptionElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlOptionElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlOptionElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlOptionElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlOptionElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlOptionElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlOptionElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlOptionElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlOptionElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlOptionElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlOptionElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlOptionElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlOptionElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlOptionElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlOptionElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlOptionElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlOptionElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlOptionElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlOptionElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlOptionElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlOptionElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlOptionElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlOptionElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlOptionElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlOptionElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlOptionElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlOptionElement +}) diff --git a/src/DOMAPI/HTMLParagraphElement.js b/src/DOMAPI/HTMLParagraphElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLParagraphElement.js +++ b/src/DOMAPI/HTMLParagraphElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLParagraphElement.res b/src/DOMAPI/HTMLParagraphElement.res index a3a42c5..1fa90a2 100644 --- a/src/DOMAPI/HTMLParagraphElement.res +++ b/src/DOMAPI/HTMLParagraphElement.res @@ -1,701 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlParagraphElement => htmlElement = "%identity" -external asElement: htmlParagraphElement => element = "%identity" -external asNode: htmlParagraphElement => node = "%identity" -external asEventTarget: htmlParagraphElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlParagraphElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlParagraphElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlParagraphElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlParagraphElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlParagraphElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlParagraphElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlParagraphElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlParagraphElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlParagraphElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlParagraphElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlParagraphElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlParagraphElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlParagraphElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlParagraphElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlParagraphElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlParagraphElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlParagraphElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlParagraphElement, ~keyframes: any, ~options: float=?) => animation = - "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlParagraphElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlParagraphElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlParagraphElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlParagraphElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlParagraphElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlParagraphElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlParagraphElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlParagraphElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlParagraphElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlParagraphElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlParagraphElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlParagraphElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlParagraphElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlParagraphElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlParagraphElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlParagraphElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlParagraphElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlParagraphElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlParagraphElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlParagraphElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlParagraphElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlParagraphElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlParagraphElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlParagraphElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlParagraphElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlParagraphElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlParagraphElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlParagraphElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlParagraphElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlParagraphElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlParagraphElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlParagraphElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlParagraphElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlParagraphElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: ( - htmlParagraphElement, - ~namespace: string, - ~localName: string, -) => attr = "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlParagraphElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlParagraphElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlParagraphElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlParagraphElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlParagraphElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlParagraphElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlParagraphElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlParagraphElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlParagraphElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlParagraphElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlParagraphElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlParagraphElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlParagraphElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlParagraphElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlParagraphElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlParagraphElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlParagraphElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlParagraphElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlParagraphElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlParagraphElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlParagraphElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlParagraphElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlParagraphElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlParagraphElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlParagraphElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlParagraphElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlParagraphElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlParagraphElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlParagraphElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlParagraphElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlParagraphElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlParagraphElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlParagraphElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlParagraphElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlParagraphElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlParagraphElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlParagraphElement +}) diff --git a/src/DOMAPI/HTMLPictureElement.js b/src/DOMAPI/HTMLPictureElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLPictureElement.js +++ b/src/DOMAPI/HTMLPictureElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLPictureElement.res b/src/DOMAPI/HTMLPictureElement.res index 50f77b1..a912c13 100644 --- a/src/DOMAPI/HTMLPictureElement.res +++ b/src/DOMAPI/HTMLPictureElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlPictureElement => htmlElement = "%identity" -external asElement: htmlPictureElement => element = "%identity" -external asNode: htmlPictureElement => node = "%identity" -external asEventTarget: htmlPictureElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlPictureElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlPictureElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlPictureElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlPictureElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlPictureElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlPictureElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlPictureElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlPictureElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlPictureElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlPictureElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlPictureElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlPictureElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlPictureElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlPictureElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlPictureElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlPictureElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlPictureElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlPictureElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlPictureElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlPictureElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlPictureElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlPictureElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlPictureElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlPictureElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlPictureElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlPictureElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlPictureElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlPictureElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlPictureElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlPictureElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlPictureElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlPictureElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlPictureElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlPictureElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlPictureElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlPictureElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlPictureElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlPictureElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlPictureElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlPictureElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlPictureElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlPictureElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlPictureElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlPictureElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlPictureElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlPictureElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlPictureElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlPictureElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlPictureElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlPictureElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlPictureElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlPictureElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlPictureElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlPictureElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlPictureElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlPictureElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlPictureElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlPictureElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlPictureElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlPictureElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlPictureElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlPictureElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlPictureElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlPictureElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlPictureElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlPictureElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlPictureElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlPictureElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlPictureElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlPictureElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlPictureElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlPictureElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlPictureElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlPictureElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlPictureElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlPictureElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlPictureElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlPictureElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlPictureElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlPictureElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlPictureElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlPictureElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlPictureElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlPictureElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlPictureElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlPictureElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlPictureElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlPictureElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlPictureElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlPictureElement +}) diff --git a/src/DOMAPI/HTMLPreElement.js b/src/DOMAPI/HTMLPreElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLPreElement.js +++ b/src/DOMAPI/HTMLPreElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLPreElement.res b/src/DOMAPI/HTMLPreElement.res index 6a4e537..64fb786 100644 --- a/src/DOMAPI/HTMLPreElement.res +++ b/src/DOMAPI/HTMLPreElement.res @@ -1,686 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlPreElement => htmlElement = "%identity" -external asElement: htmlPreElement => element = "%identity" -external asNode: htmlPreElement => node = "%identity" -external asEventTarget: htmlPreElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlPreElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlPreElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlPreElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlPreElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlPreElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlPreElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlPreElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlPreElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlPreElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlPreElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlPreElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlPreElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlPreElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlPreElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlPreElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlPreElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlPreElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlPreElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlPreElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlPreElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlPreElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlPreElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlPreElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlPreElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlPreElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlPreElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlPreElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlPreElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlPreElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlPreElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlPreElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlPreElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlPreElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlPreElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlPreElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlPreElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlPreElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlPreElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlPreElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlPreElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlPreElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlPreElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlPreElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlPreElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlPreElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlPreElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlPreElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlPreElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlPreElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlPreElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlPreElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlPreElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlPreElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlPreElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlPreElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlPreElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlPreElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlPreElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlPreElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlPreElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlPreElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlPreElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlPreElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlPreElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlPreElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlPreElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlPreElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlPreElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlPreElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlPreElement, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlPreElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlPreElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlPreElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlPreElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlPreElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlPreElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlPreElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlPreElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlPreElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlPreElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlPreElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlPreElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlPreElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlPreElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlPreElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlPreElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlPreElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlPreElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlPreElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlPreElement +}) diff --git a/src/DOMAPI/HTMLProgressElement.js b/src/DOMAPI/HTMLProgressElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLProgressElement.js +++ b/src/DOMAPI/HTMLProgressElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLProgressElement.res b/src/DOMAPI/HTMLProgressElement.res index a4d2ee7..50d44b4 100644 --- a/src/DOMAPI/HTMLProgressElement.res +++ b/src/DOMAPI/HTMLProgressElement.res @@ -1,697 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlProgressElement => htmlElement = "%identity" -external asElement: htmlProgressElement => element = "%identity" -external asNode: htmlProgressElement => node = "%identity" -external asEventTarget: htmlProgressElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlProgressElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlProgressElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlProgressElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlProgressElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlProgressElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlProgressElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlProgressElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlProgressElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlProgressElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlProgressElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlProgressElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlProgressElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlProgressElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlProgressElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlProgressElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlProgressElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlProgressElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlProgressElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlProgressElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlProgressElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlProgressElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlProgressElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlProgressElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlProgressElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlProgressElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlProgressElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlProgressElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlProgressElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlProgressElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlProgressElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlProgressElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlProgressElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlProgressElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlProgressElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlProgressElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlProgressElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlProgressElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlProgressElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlProgressElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlProgressElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlProgressElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlProgressElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlProgressElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlProgressElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlProgressElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlProgressElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlProgressElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlProgressElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlProgressElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlProgressElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlProgressElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlProgressElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlProgressElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlProgressElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlProgressElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlProgressElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlProgressElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlProgressElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlProgressElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlProgressElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlProgressElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlProgressElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlProgressElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlProgressElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlProgressElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlProgressElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlProgressElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlProgressElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlProgressElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlProgressElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlProgressElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlProgressElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlProgressElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlProgressElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlProgressElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlProgressElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlProgressElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlProgressElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlProgressElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlProgressElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlProgressElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlProgressElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlProgressElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlProgressElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlProgressElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlProgressElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlProgressElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlProgressElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlProgressElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlProgressElement +}) diff --git a/src/DOMAPI/HTMLQuoteElement.js b/src/DOMAPI/HTMLQuoteElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLQuoteElement.js +++ b/src/DOMAPI/HTMLQuoteElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLQuoteElement.res b/src/DOMAPI/HTMLQuoteElement.res index 50aae6b..2e142e3 100644 --- a/src/DOMAPI/HTMLQuoteElement.res +++ b/src/DOMAPI/HTMLQuoteElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlQuoteElement => htmlElement = "%identity" -external asElement: htmlQuoteElement => element = "%identity" -external asNode: htmlQuoteElement => node = "%identity" -external asEventTarget: htmlQuoteElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlQuoteElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlQuoteElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlQuoteElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlQuoteElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlQuoteElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlQuoteElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlQuoteElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlQuoteElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlQuoteElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlQuoteElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlQuoteElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlQuoteElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlQuoteElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlQuoteElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlQuoteElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlQuoteElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlQuoteElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlQuoteElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlQuoteElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlQuoteElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlQuoteElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlQuoteElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlQuoteElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlQuoteElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlQuoteElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlQuoteElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlQuoteElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlQuoteElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlQuoteElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlQuoteElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlQuoteElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlQuoteElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlQuoteElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlQuoteElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlQuoteElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlQuoteElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlQuoteElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlQuoteElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlQuoteElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlQuoteElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlQuoteElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlQuoteElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlQuoteElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlQuoteElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlQuoteElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlQuoteElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlQuoteElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlQuoteElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlQuoteElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlQuoteElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlQuoteElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlQuoteElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlQuoteElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlQuoteElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlQuoteElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlQuoteElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlQuoteElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlQuoteElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlQuoteElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlQuoteElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlQuoteElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlQuoteElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlQuoteElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlQuoteElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlQuoteElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlQuoteElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlQuoteElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlQuoteElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlQuoteElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlQuoteElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlQuoteElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlQuoteElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlQuoteElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlQuoteElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlQuoteElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlQuoteElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlQuoteElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlQuoteElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlQuoteElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlQuoteElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlQuoteElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlQuoteElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlQuoteElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlQuoteElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlQuoteElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlQuoteElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlQuoteElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlQuoteElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlQuoteElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlQuoteElement +}) diff --git a/src/DOMAPI/HTMLSelectElement.js b/src/DOMAPI/HTMLSelectElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLSelectElement.js +++ b/src/DOMAPI/HTMLSelectElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSelectElement.res b/src/DOMAPI/HTMLSelectElement.res index b4b1b80..11b4246 100644 --- a/src/DOMAPI/HTMLSelectElement.res +++ b/src/DOMAPI/HTMLSelectElement.res @@ -1,696 +1,4 @@ open DOMAPI -open Prelude -open EventAPI - -external asHTMLElement: htmlSelectElement => htmlElement = "%identity" -external asElement: htmlSelectElement => element = "%identity" -external asNode: htmlSelectElement => node = "%identity" -external asEventTarget: htmlSelectElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlSelectElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlSelectElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlSelectElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlSelectElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlSelectElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlSelectElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlSelectElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlSelectElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlSelectElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlSelectElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlSelectElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlSelectElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlSelectElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlSelectElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlSelectElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlSelectElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlSelectElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlSelectElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlSelectElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlSelectElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlSelectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlSelectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlSelectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlSelectElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlSelectElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlSelectElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlSelectElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlSelectElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlSelectElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlSelectElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlSelectElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlSelectElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlSelectElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlSelectElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlSelectElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlSelectElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlSelectElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlSelectElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlSelectElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlSelectElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlSelectElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlSelectElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlSelectElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlSelectElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlSelectElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlSelectElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlSelectElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlSelectElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlSelectElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlSelectElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlSelectElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlSelectElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlSelectElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlSelectElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlSelectElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlSelectElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlSelectElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlSelectElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlSelectElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlSelectElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlSelectElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlSelectElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlSelectElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlSelectElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlSelectElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlSelectElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlSelectElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlSelectElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlSelectElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlSelectElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlSelectElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlSelectElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlSelectElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlSelectElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlSelectElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlSelectElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlSelectElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlSelectElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlSelectElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlSelectElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlSelectElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlSelectElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlSelectElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlSelectElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlSelectElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlSelectElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlSelectElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlSelectElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlSelectElement, ~force: bool=?) => bool = "togglePopover" /** Retrieves a select object or an object from an options collection. @@ -760,3 +68,7 @@ external setCustomValidity: (htmlSelectElement, string) => unit = "setCustomVali */ @send external showPicker: htmlSelectElement => unit = "showPicker" + +include HTMLElement.Impl({ + type t = htmlSelectElement +}) diff --git a/src/DOMAPI/HTMLSourceElement.js b/src/DOMAPI/HTMLSourceElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLSourceElement.js +++ b/src/DOMAPI/HTMLSourceElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSourceElement.res b/src/DOMAPI/HTMLSourceElement.res index ab28aba..67ca678 100644 --- a/src/DOMAPI/HTMLSourceElement.res +++ b/src/DOMAPI/HTMLSourceElement.res @@ -1,693 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlSourceElement => htmlElement = "%identity" -external asElement: htmlSourceElement => element = "%identity" -external asNode: htmlSourceElement => node = "%identity" -external asEventTarget: htmlSourceElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlSourceElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlSourceElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlSourceElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlSourceElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlSourceElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlSourceElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlSourceElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlSourceElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlSourceElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlSourceElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlSourceElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlSourceElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlSourceElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlSourceElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlSourceElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlSourceElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlSourceElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlSourceElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlSourceElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlSourceElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlSourceElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlSourceElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlSourceElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlSourceElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlSourceElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlSourceElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlSourceElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlSourceElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlSourceElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlSourceElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlSourceElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlSourceElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlSourceElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlSourceElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlSourceElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlSourceElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlSourceElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlSourceElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlSourceElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlSourceElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlSourceElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlSourceElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlSourceElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlSourceElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlSourceElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlSourceElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlSourceElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlSourceElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlSourceElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlSourceElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlSourceElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlSourceElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlSourceElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlSourceElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlSourceElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlSourceElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlSourceElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlSourceElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlSourceElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlSourceElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlSourceElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlSourceElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlSourceElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlSourceElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlSourceElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlSourceElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlSourceElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlSourceElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlSourceElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlSourceElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlSourceElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlSourceElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlSourceElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlSourceElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlSourceElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlSourceElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlSourceElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlSourceElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlSourceElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlSourceElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlSourceElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlSourceElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlSourceElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlSourceElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlSourceElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlSourceElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlSourceElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlSourceElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlSourceElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlSourceElement +}) diff --git a/src/DOMAPI/HTMLSpanElement.js b/src/DOMAPI/HTMLSpanElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLSpanElement.js +++ b/src/DOMAPI/HTMLSpanElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSpanElement.res b/src/DOMAPI/HTMLSpanElement.res index 6a09cb0..cd5304f 100644 --- a/src/DOMAPI/HTMLSpanElement.res +++ b/src/DOMAPI/HTMLSpanElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlSpanElement => htmlElement = "%identity" -external asElement: htmlSpanElement => element = "%identity" -external asNode: htmlSpanElement => node = "%identity" -external asEventTarget: htmlSpanElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlSpanElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlSpanElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlSpanElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlSpanElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlSpanElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlSpanElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlSpanElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlSpanElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlSpanElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlSpanElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlSpanElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlSpanElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlSpanElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlSpanElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlSpanElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlSpanElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlSpanElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlSpanElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlSpanElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlSpanElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlSpanElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlSpanElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlSpanElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlSpanElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlSpanElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlSpanElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlSpanElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlSpanElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlSpanElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlSpanElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlSpanElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlSpanElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlSpanElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlSpanElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlSpanElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlSpanElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlSpanElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlSpanElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlSpanElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlSpanElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlSpanElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlSpanElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlSpanElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlSpanElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlSpanElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlSpanElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlSpanElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlSpanElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlSpanElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlSpanElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlSpanElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlSpanElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlSpanElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlSpanElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlSpanElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlSpanElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlSpanElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlSpanElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlSpanElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlSpanElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlSpanElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlSpanElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlSpanElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlSpanElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlSpanElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlSpanElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlSpanElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlSpanElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlSpanElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlSpanElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlSpanElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlSpanElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlSpanElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlSpanElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlSpanElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlSpanElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlSpanElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlSpanElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlSpanElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlSpanElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlSpanElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlSpanElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlSpanElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlSpanElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlSpanElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlSpanElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlSpanElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlSpanElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlSpanElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlSpanElement +}) diff --git a/src/DOMAPI/HTMLStyleElement.js b/src/DOMAPI/HTMLStyleElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLStyleElement.js +++ b/src/DOMAPI/HTMLStyleElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLStyleElement.res b/src/DOMAPI/HTMLStyleElement.res index c25fd46..f8394dc 100644 --- a/src/DOMAPI/HTMLStyleElement.res +++ b/src/DOMAPI/HTMLStyleElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlStyleElement => htmlElement = "%identity" -external asElement: htmlStyleElement => element = "%identity" -external asNode: htmlStyleElement => node = "%identity" -external asEventTarget: htmlStyleElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlStyleElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlStyleElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlStyleElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlStyleElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlStyleElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlStyleElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlStyleElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlStyleElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlStyleElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlStyleElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlStyleElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlStyleElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlStyleElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlStyleElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlStyleElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlStyleElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlStyleElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlStyleElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlStyleElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlStyleElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlStyleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlStyleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlStyleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlStyleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlStyleElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlStyleElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlStyleElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlStyleElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlStyleElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlStyleElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlStyleElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlStyleElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlStyleElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlStyleElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlStyleElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlStyleElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlStyleElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlStyleElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlStyleElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlStyleElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlStyleElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlStyleElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlStyleElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlStyleElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlStyleElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlStyleElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlStyleElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlStyleElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlStyleElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlStyleElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlStyleElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlStyleElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlStyleElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlStyleElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlStyleElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlStyleElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlStyleElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlStyleElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlStyleElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlStyleElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlStyleElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlStyleElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlStyleElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlStyleElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlStyleElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlStyleElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlStyleElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlStyleElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlStyleElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlStyleElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlStyleElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlStyleElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlStyleElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlStyleElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlStyleElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlStyleElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlStyleElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlStyleElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlStyleElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlStyleElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlStyleElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlStyleElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlStyleElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlStyleElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlStyleElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlStyleElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlStyleElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlStyleElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlStyleElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlStyleElement +}) diff --git a/src/DOMAPI/HTMLTableCaptionElement.js b/src/DOMAPI/HTMLTableCaptionElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTableCaptionElement.js +++ b/src/DOMAPI/HTMLTableCaptionElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableCaptionElement.res b/src/DOMAPI/HTMLTableCaptionElement.res index c11e780..4c86bad 100644 --- a/src/DOMAPI/HTMLTableCaptionElement.res +++ b/src/DOMAPI/HTMLTableCaptionElement.res @@ -1,714 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTableCaptionElement => htmlElement = "%identity" -external asElement: htmlTableCaptionElement => element = "%identity" -external asNode: htmlTableCaptionElement => node = "%identity" -external asEventTarget: htmlTableCaptionElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTableCaptionElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTableCaptionElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTableCaptionElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTableCaptionElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTableCaptionElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTableCaptionElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTableCaptionElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTableCaptionElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTableCaptionElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTableCaptionElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTableCaptionElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTableCaptionElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTableCaptionElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTableCaptionElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTableCaptionElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTableCaptionElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTableCaptionElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTableCaptionElement, ~keyframes: any, ~options: float=?) => animation = - "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTableCaptionElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTableCaptionElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTableCaptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTableCaptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTableCaptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTableCaptionElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTableCaptionElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTableCaptionElement, ~options: getRootNodeOptions=?) => node = - "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTableCaptionElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTableCaptionElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTableCaptionElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTableCaptionElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTableCaptionElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTableCaptionElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTableCaptionElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTableCaptionElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTableCaptionElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTableCaptionElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTableCaptionElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTableCaptionElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTableCaptionElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTableCaptionElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTableCaptionElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTableCaptionElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTableCaptionElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: ( - htmlTableCaptionElement, - ~namespace: string, - ~localName: string, -) => string = "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTableCaptionElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTableCaptionElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTableCaptionElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: ( - htmlTableCaptionElement, - ~namespace: string, - ~localName: string, -) => unit = "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: ( - htmlTableCaptionElement, - ~qualifiedName: string, - ~force: bool=?, -) => bool = "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTableCaptionElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTableCaptionElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTableCaptionElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: ( - htmlTableCaptionElement, - ~namespace: string, - ~localName: string, -) => attr = "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTableCaptionElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTableCaptionElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTableCaptionElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTableCaptionElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTableCaptionElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTableCaptionElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTableCaptionElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTableCaptionElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTableCaptionElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTableCaptionElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: ( - htmlTableCaptionElement, - ~where: insertPosition, - ~data: string, -) => unit = "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTableCaptionElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTableCaptionElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTableCaptionElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTableCaptionElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTableCaptionElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTableCaptionElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTableCaptionElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTableCaptionElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTableCaptionElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTableCaptionElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTableCaptionElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTableCaptionElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTableCaptionElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTableCaptionElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTableCaptionElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTableCaptionElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTableCaptionElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTableCaptionElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTableCaptionElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTableCaptionElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTableCaptionElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTableCaptionElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTableCaptionElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTableCaptionElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTableCaptionElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTableCaptionElement +}) diff --git a/src/DOMAPI/HTMLTableCellElement.js b/src/DOMAPI/HTMLTableCellElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTableCellElement.js +++ b/src/DOMAPI/HTMLTableCellElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableCellElement.res b/src/DOMAPI/HTMLTableCellElement.res index 2632a43..acfcc2b 100644 --- a/src/DOMAPI/HTMLTableCellElement.res +++ b/src/DOMAPI/HTMLTableCellElement.res @@ -1,701 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTableCellElement => htmlElement = "%identity" -external asElement: htmlTableCellElement => element = "%identity" -external asNode: htmlTableCellElement => node = "%identity" -external asEventTarget: htmlTableCellElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTableCellElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTableCellElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTableCellElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTableCellElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTableCellElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTableCellElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTableCellElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTableCellElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTableCellElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTableCellElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTableCellElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTableCellElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTableCellElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTableCellElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTableCellElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTableCellElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTableCellElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTableCellElement, ~keyframes: any, ~options: float=?) => animation = - "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTableCellElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTableCellElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTableCellElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTableCellElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTableCellElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTableCellElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTableCellElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTableCellElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTableCellElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTableCellElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTableCellElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTableCellElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTableCellElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTableCellElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTableCellElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTableCellElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTableCellElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTableCellElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTableCellElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTableCellElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTableCellElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTableCellElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTableCellElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTableCellElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTableCellElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTableCellElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTableCellElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTableCellElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTableCellElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTableCellElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTableCellElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTableCellElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTableCellElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTableCellElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: ( - htmlTableCellElement, - ~namespace: string, - ~localName: string, -) => attr = "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTableCellElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTableCellElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTableCellElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTableCellElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTableCellElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTableCellElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTableCellElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTableCellElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTableCellElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTableCellElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTableCellElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTableCellElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTableCellElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTableCellElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTableCellElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTableCellElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTableCellElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTableCellElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTableCellElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTableCellElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTableCellElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTableCellElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTableCellElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTableCellElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTableCellElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTableCellElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTableCellElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTableCellElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTableCellElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTableCellElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTableCellElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTableCellElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTableCellElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTableCellElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTableCellElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTableCellElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTableCellElement +}) diff --git a/src/DOMAPI/HTMLTemplateElement.js b/src/DOMAPI/HTMLTemplateElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTemplateElement.js +++ b/src/DOMAPI/HTMLTemplateElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTemplateElement.res b/src/DOMAPI/HTMLTemplateElement.res index 57f39c7..e6374df 100644 --- a/src/DOMAPI/HTMLTemplateElement.res +++ b/src/DOMAPI/HTMLTemplateElement.res @@ -1,697 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTemplateElement => htmlElement = "%identity" -external asElement: htmlTemplateElement => element = "%identity" -external asNode: htmlTemplateElement => node = "%identity" -external asEventTarget: htmlTemplateElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTemplateElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTemplateElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTemplateElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTemplateElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTemplateElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTemplateElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTemplateElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTemplateElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTemplateElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTemplateElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTemplateElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTemplateElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTemplateElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTemplateElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTemplateElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTemplateElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTemplateElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTemplateElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTemplateElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: ( - htmlTemplateElement, - ~options: getAnimationsOptions=?, -) => array = "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTemplateElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTemplateElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTemplateElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTemplateElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTemplateElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTemplateElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTemplateElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTemplateElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTemplateElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTemplateElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTemplateElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTemplateElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTemplateElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTemplateElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTemplateElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTemplateElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTemplateElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTemplateElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTemplateElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTemplateElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTemplateElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTemplateElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTemplateElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTemplateElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTemplateElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTemplateElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTemplateElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTemplateElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTemplateElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTemplateElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTemplateElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTemplateElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTemplateElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTemplateElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTemplateElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTemplateElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTemplateElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTemplateElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTemplateElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTemplateElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTemplateElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTemplateElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTemplateElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTemplateElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTemplateElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTemplateElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTemplateElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTemplateElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTemplateElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTemplateElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTemplateElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTemplateElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTemplateElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTemplateElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTemplateElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTemplateElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: ( - htmlTemplateElement, - ~options: fullscreenOptions=?, -) => Promise.t = "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTemplateElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTemplateElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTemplateElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTemplateElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTemplateElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTemplateElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - htmlTemplateElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTemplateElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTemplateElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTemplateElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTemplateElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTemplateElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTemplateElement +}) diff --git a/src/DOMAPI/HTMLTimeElement.js b/src/DOMAPI/HTMLTimeElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTimeElement.js +++ b/src/DOMAPI/HTMLTimeElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTimeElement.res b/src/DOMAPI/HTMLTimeElement.res index 618aacf..1722ab6 100644 --- a/src/DOMAPI/HTMLTimeElement.res +++ b/src/DOMAPI/HTMLTimeElement.res @@ -1,687 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTimeElement => htmlElement = "%identity" -external asElement: htmlTimeElement => element = "%identity" -external asNode: htmlTimeElement => node = "%identity" -external asEventTarget: htmlTimeElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTimeElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTimeElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTimeElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTimeElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTimeElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTimeElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTimeElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTimeElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTimeElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTimeElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTimeElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTimeElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTimeElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTimeElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTimeElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTimeElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTimeElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTimeElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTimeElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlTimeElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTimeElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTimeElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTimeElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTimeElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTimeElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTimeElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTimeElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTimeElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTimeElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTimeElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTimeElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTimeElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTimeElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTimeElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTimeElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTimeElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTimeElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTimeElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTimeElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTimeElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTimeElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTimeElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTimeElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTimeElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTimeElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTimeElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTimeElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTimeElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTimeElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTimeElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTimeElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTimeElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTimeElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTimeElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTimeElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTimeElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTimeElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTimeElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTimeElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTimeElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTimeElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTimeElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTimeElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTimeElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTimeElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTimeElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTimeElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTimeElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTimeElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTimeElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTimeElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTimeElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTimeElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTimeElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTimeElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTimeElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlTimeElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTimeElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTimeElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: (htmlTimeElement, ~position: insertPosition, ~string: string) => unit = - "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTimeElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTimeElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTimeElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlTimeElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTimeElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTimeElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTimeElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTimeElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTimeElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTimeElement +}) diff --git a/src/DOMAPI/HTMLTitleElement.js b/src/DOMAPI/HTMLTitleElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTitleElement.js +++ b/src/DOMAPI/HTMLTitleElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTitleElement.res b/src/DOMAPI/HTMLTitleElement.res index c46eb22..c61005f 100644 --- a/src/DOMAPI/HTMLTitleElement.res +++ b/src/DOMAPI/HTMLTitleElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTitleElement => htmlElement = "%identity" -external asElement: htmlTitleElement => element = "%identity" -external asNode: htmlTitleElement => node = "%identity" -external asEventTarget: htmlTitleElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTitleElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTitleElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTitleElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTitleElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTitleElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTitleElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTitleElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTitleElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTitleElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTitleElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTitleElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTitleElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTitleElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTitleElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTitleElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTitleElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTitleElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTitleElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTitleElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlTitleElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTitleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTitleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTitleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTitleElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTitleElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTitleElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTitleElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTitleElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTitleElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTitleElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTitleElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTitleElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTitleElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTitleElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTitleElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTitleElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTitleElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTitleElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTitleElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTitleElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTitleElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTitleElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTitleElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTitleElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTitleElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTitleElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTitleElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTitleElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTitleElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTitleElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTitleElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTitleElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTitleElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTitleElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTitleElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTitleElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTitleElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTitleElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTitleElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTitleElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTitleElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTitleElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTitleElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTitleElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTitleElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTitleElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTitleElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTitleElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTitleElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTitleElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTitleElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTitleElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTitleElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTitleElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTitleElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTitleElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlTitleElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTitleElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTitleElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTitleElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTitleElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTitleElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTitleElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlTitleElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTitleElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTitleElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTitleElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTitleElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTitleElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTitleElement +}) diff --git a/src/DOMAPI/HTMLTrackElement.js b/src/DOMAPI/HTMLTrackElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLTrackElement.js +++ b/src/DOMAPI/HTMLTrackElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTrackElement.res b/src/DOMAPI/HTMLTrackElement.res index 0c451b6..ebcde17 100644 --- a/src/DOMAPI/HTMLTrackElement.res +++ b/src/DOMAPI/HTMLTrackElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmlTrackElement => htmlElement = "%identity" -external asElement: htmlTrackElement => element = "%identity" -external asNode: htmlTrackElement => node = "%identity" -external asEventTarget: htmlTrackElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlTrackElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlTrackElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlTrackElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlTrackElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlTrackElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlTrackElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlTrackElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlTrackElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlTrackElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlTrackElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlTrackElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlTrackElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlTrackElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlTrackElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlTrackElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlTrackElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlTrackElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlTrackElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlTrackElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlTrackElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlTrackElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlTrackElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlTrackElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlTrackElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlTrackElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlTrackElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlTrackElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlTrackElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlTrackElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlTrackElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlTrackElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlTrackElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlTrackElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlTrackElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlTrackElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlTrackElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlTrackElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlTrackElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlTrackElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlTrackElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlTrackElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlTrackElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlTrackElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlTrackElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlTrackElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlTrackElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlTrackElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlTrackElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlTrackElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlTrackElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlTrackElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlTrackElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlTrackElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlTrackElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlTrackElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlTrackElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlTrackElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlTrackElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlTrackElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlTrackElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlTrackElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlTrackElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlTrackElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlTrackElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlTrackElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlTrackElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlTrackElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlTrackElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlTrackElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlTrackElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlTrackElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlTrackElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlTrackElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlTrackElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlTrackElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlTrackElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlTrackElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlTrackElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlTrackElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlTrackElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlTrackElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlTrackElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlTrackElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlTrackElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlTrackElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlTrackElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlTrackElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlTrackElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlTrackElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmlTrackElement +}) diff --git a/src/DOMAPI/HTMLUListElement.js b/src/DOMAPI/HTMLUListElement.js index d856702..1541b40 100644 --- a/src/DOMAPI/HTMLUListElement.js +++ b/src/DOMAPI/HTMLUListElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLElement$WebAPI from "./HTMLElement.js"; + +HTMLElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLUListElement.res b/src/DOMAPI/HTMLUListElement.res index 569ffe3..a653787 100644 --- a/src/DOMAPI/HTMLUListElement.res +++ b/src/DOMAPI/HTMLUListElement.res @@ -1,690 +1,5 @@ open DOMAPI -open Prelude -open EventAPI -external asHTMLElement: htmluListElement => htmlElement = "%identity" -external asElement: htmluListElement => element = "%identity" -external asNode: htmluListElement => node = "%identity" -external asEventTarget: htmluListElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmluListElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmluListElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmluListElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmluListElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmluListElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmluListElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmluListElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmluListElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmluListElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmluListElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmluListElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmluListElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmluListElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmluListElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmluListElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmluListElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmluListElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmluListElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmluListElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmluListElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmluListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmluListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmluListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmluListElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmluListElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmluListElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmluListElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmluListElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmluListElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmluListElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmluListElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmluListElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmluListElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmluListElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmluListElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmluListElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmluListElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmluListElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmluListElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmluListElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmluListElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmluListElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmluListElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmluListElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmluListElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmluListElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmluListElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmluListElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmluListElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmluListElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmluListElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmluListElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmluListElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmluListElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmluListElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmluListElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmluListElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmluListElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmluListElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmluListElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmluListElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmluListElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmluListElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmluListElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmluListElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmluListElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmluListElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmluListElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmluListElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmluListElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmluListElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmluListElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmluListElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmluListElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmluListElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmluListElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmluListElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmluListElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmluListElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmluListElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmluListElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmluListElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmluListElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmluListElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmluListElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmluListElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmluListElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmluListElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmluListElement, ~force: bool=?) => bool = "togglePopover" +include HTMLElement.Impl({ + type t = htmluListElement +}) diff --git a/src/DOMAPI/HTMLVideoElement.js b/src/DOMAPI/HTMLVideoElement.js index d856702..7937791 100644 --- a/src/DOMAPI/HTMLVideoElement.js +++ b/src/DOMAPI/HTMLVideoElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as HTMLMediaElement$WebAPI from "./HTMLMediaElement.js"; + +HTMLMediaElement$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLVideoElement.res b/src/DOMAPI/HTMLVideoElement.res index f75bcec..4cd6db4 100644 --- a/src/DOMAPI/HTMLVideoElement.res +++ b/src/DOMAPI/HTMLVideoElement.res @@ -1,754 +1,9 @@ open DOMAPI -open Prelude -open EventAPI -open WebVTTAPI -open EncryptedMediaExtensionsAPI open PictureInPictureAPI -external asHTMLMediaElement: htmlVideoElement => htmlMediaElement = "%identity" -external asHTMLElement: htmlVideoElement => htmlElement = "%identity" -external asElement: htmlVideoElement => element = "%identity" -external asNode: htmlVideoElement => node = "%identity" -external asEventTarget: htmlVideoElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (htmlVideoElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: htmlVideoElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (htmlVideoElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (htmlVideoElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (htmlVideoElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (htmlVideoElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (htmlVideoElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (htmlVideoElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (htmlVideoElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (htmlVideoElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (htmlVideoElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (htmlVideoElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (htmlVideoElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (htmlVideoElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (htmlVideoElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (htmlVideoElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: htmlVideoElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (htmlVideoElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - htmlVideoElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (htmlVideoElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - htmlVideoElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - htmlVideoElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - htmlVideoElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - htmlVideoElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (htmlVideoElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (htmlVideoElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: htmlVideoElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: htmlVideoElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (htmlVideoElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (htmlVideoElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (htmlVideoElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (htmlVideoElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (htmlVideoElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (htmlVideoElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (htmlVideoElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (htmlVideoElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (htmlVideoElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (htmlVideoElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (htmlVideoElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (htmlVideoElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: htmlVideoElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: htmlVideoElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (htmlVideoElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (htmlVideoElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (htmlVideoElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" - -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - htmlVideoElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (htmlVideoElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (htmlVideoElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (htmlVideoElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (htmlVideoElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (htmlVideoElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (htmlVideoElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (htmlVideoElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (htmlVideoElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (htmlVideoElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (htmlVideoElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (htmlVideoElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (htmlVideoElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (htmlVideoElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (htmlVideoElement, string) => htmlCollection = "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - htmlVideoElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (htmlVideoElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - htmlVideoElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (htmlVideoElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: htmlVideoElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: htmlVideoElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: htmlVideoElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (htmlVideoElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (htmlVideoElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (htmlVideoElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (htmlVideoElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (htmlVideoElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (htmlVideoElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (htmlVideoElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (htmlVideoElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (htmlVideoElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (htmlVideoElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (htmlVideoElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (htmlVideoElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - htmlVideoElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (htmlVideoElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (htmlVideoElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (htmlVideoElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: (htmlVideoElement, ~options: pointerLockOptions=?) => Promise.t = - "requestPointerLock" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/click) -*/ -@send -external click: htmlVideoElement => unit = "click" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) -*/ -@send -external attachInternals: htmlVideoElement => elementInternals = "attachInternals" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/showPopover) -*/ -@send -external showPopover: htmlVideoElement => unit = "showPopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) -*/ -@send -external hidePopover: htmlVideoElement => unit = "hidePopover" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/togglePopover) -*/ -@send -external togglePopover: (htmlVideoElement, ~force: bool=?) => bool = "togglePopover" - -/** -Resets the audio or video object and loads a new media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/load) -*/ -@send -external load: htmlVideoElement => unit = "load" - -/** -Returns a string that specifies whether the client can play a given media resource type. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType) -*/ -@send -external canPlayType: (htmlVideoElement, string) => canPlayTypeResult = "canPlayType" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek) -*/ -@send -external fastSeek: (htmlVideoElement, float) => unit = "fastSeek" - -/** -Loads and starts playback of a media resource. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play) -*/ -@send -external play: htmlVideoElement => Promise.t = "play" - -/** -Pauses the current playback and sets paused to TRUE. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause) -*/ -@send -external pause: htmlVideoElement => unit = "pause" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack) -*/ -@send -external addTextTrack: ( - htmlVideoElement, - ~kind: textTrackKind, - ~label: string=?, - ~language: string=?, -) => textTrack = "addTextTrack" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId) -*/ -@send -external setSinkId: (htmlVideoElement, string) => Promise.t = "setSinkId" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys) -*/ -@send -external setMediaKeys: (htmlVideoElement, mediaKeys) => Promise.t = "setMediaKeys" +include HTMLMediaElement.Impl({ + type t = htmlVideoElement +}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/getVideoPlaybackQuality) From b94aa00b38cc81faa5269bea5bea0d83abaf5483 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 15:08:49 +0100 Subject: [PATCH 10/13] AudioNode --- src/DOMAPI/SVGGraphicsElement.js | 7 +- src/DOMAPI/SVGGraphicsElement.res | 664 +----------------- src/WebAudioAPI/AnalyserNode.js | 7 +- src/WebAudioAPI/AnalyserNode.res | 152 +--- src/WebAudioAPI/AudioBufferSourceNode.js | 7 +- src/WebAudioAPI/AudioBufferSourceNode.res | 166 +---- src/WebAudioAPI/AudioContext.js | 7 +- src/WebAudioAPI/AudioContext.res | 216 +----- src/WebAudioAPI/AudioNode.js | 10 +- src/WebAudioAPI/AudioNode.res | 77 +- src/WebAudioAPI/AudioScheduledSourceNode.js | 15 +- src/WebAudioAPI/AudioScheduledSourceNode.res | 182 +---- src/WebAudioAPI/AudioWorkletNode.js | 7 +- src/WebAudioAPI/AudioWorkletNode.res | 153 +--- src/WebAudioAPI/BaseAudioContext.js | 10 +- src/WebAudioAPI/BaseAudioContext.res | 167 ++--- src/WebAudioAPI/BiquadFilterNode.js | 7 +- src/WebAudioAPI/BiquadFilterNode.res | 153 +--- src/WebAudioAPI/ChannelMergerNode.js | 7 +- src/WebAudioAPI/ChannelMergerNode.res | 153 +--- src/WebAudioAPI/ChannelSplitterNode.js | 7 +- src/WebAudioAPI/ChannelSplitterNode.res | 153 +--- src/WebAudioAPI/ConstantSourceNode.js | 7 +- src/WebAudioAPI/ConstantSourceNode.res | 166 +---- src/WebAudioAPI/ConvolverNode.js | 7 +- src/WebAudioAPI/ConvolverNode.res | 153 +--- src/WebAudioAPI/DelayNode.js | 7 +- src/WebAudioAPI/DelayNode.res | 147 +--- src/WebAudioAPI/DynamicsCompressorNode.js | 7 +- src/WebAudioAPI/DynamicsCompressorNode.res | 156 +--- src/WebAudioAPI/GainNode.js | 7 +- src/WebAudioAPI/GainNode.res | 146 +--- src/WebAudioAPI/IIRFilterNode.js | 7 +- src/WebAudioAPI/IIRFilterNode.res | 153 +--- .../MediaElementAudioSourceNode.js | 7 +- .../MediaElementAudioSourceNode.res | 162 +---- .../MediaStreamAudioDestinationNode.js | 7 +- .../MediaStreamAudioDestinationNode.res | 162 +---- src/WebAudioAPI/MediaStreamAudioSourceNode.js | 7 +- .../MediaStreamAudioSourceNode.res | 162 +---- src/WebAudioAPI/OfflineAudioContext.js | 7 +- src/WebAudioAPI/OfflineAudioContext.res | 218 +----- src/WebAudioAPI/OscillatorNode.js | 7 +- src/WebAudioAPI/OscillatorNode.res | 166 +---- src/WebAudioAPI/PannerNode.js | 7 +- src/WebAudioAPI/PannerNode.res | 147 +--- src/WebAudioAPI/StereoPannerNode.js | 7 +- src/WebAudioAPI/StereoPannerNode.res | 153 +--- src/WebAudioAPI/WaveShaperNode.js | 7 +- src/WebAudioAPI/WaveShaperNode.res | 153 +--- src/WebSpeechAPI/SpeechSynthesisUtterance.js | 7 +- src/WebSpeechAPI/SpeechSynthesisUtterance.res | 85 +-- 52 files changed, 407 insertions(+), 4354 deletions(-) diff --git a/src/DOMAPI/SVGGraphicsElement.js b/src/DOMAPI/SVGGraphicsElement.js index d856702..c4f0687 100644 --- a/src/DOMAPI/SVGGraphicsElement.js +++ b/src/DOMAPI/SVGGraphicsElement.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Element$WebAPI from "./Element.js"; + +Element$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/SVGGraphicsElement.res b/src/DOMAPI/SVGGraphicsElement.res index 3321352..bb3b533 100644 --- a/src/DOMAPI/SVGGraphicsElement.res +++ b/src/DOMAPI/SVGGraphicsElement.res @@ -1,666 +1,10 @@ open DOMAPI -open Prelude -open EventAPI -external asSVGElement: svgGraphicsElement => svgElement = "%identity" -external asElement: svgGraphicsElement => element = "%identity" -external asNode: svgGraphicsElement => node = "%identity" -external asEventTarget: svgGraphicsElement => eventTarget = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) -*/ -@send -external focus: (svgGraphicsElement, ~options: focusOptions=?) => unit = "focus" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) -*/ -@send -external blur: svgGraphicsElement => unit = "blur" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend: (svgGraphicsElement, node) => unit = "prepend" - -/** -Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) -*/ -@send -external prepend2: (svgGraphicsElement, string) => unit = "prepend" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append: (svgGraphicsElement, node) => unit = "append" - -/** -Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) -*/ -@send -external append2: (svgGraphicsElement, string) => unit = "append" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren: (svgGraphicsElement, node) => unit = "replaceChildren" - -/** -Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) -*/ -@send -external replaceChildren2: (svgGraphicsElement, string) => unit = "replaceChildren" - -/** -Returns the first element that is a descendant of node that matches selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) -*/ -@send -external querySelector: (svgGraphicsElement, string) => element = "querySelector" - -/** -Returns all element descendants of node that match selectors. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) -*/ -@send -external querySelectorAll: (svgGraphicsElement, string) => nodeList = "querySelectorAll" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before: (svgGraphicsElement, node) => unit = "before" - -/** -Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) -*/ -@send -external before2: (svgGraphicsElement, string) => unit = "before" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after: (svgGraphicsElement, node) => unit = "after" - -/** -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) -*/ -@send -external after2: (svgGraphicsElement, string) => unit = "after" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith: (svgGraphicsElement, node) => unit = "replaceWith" - -/** -Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) -*/ -@send -external replaceWith2: (svgGraphicsElement, string) => unit = "replaceWith" - -/** -Removes node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) -*/ -@send -external remove: svgGraphicsElement => unit = "remove" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate: (svgGraphicsElement, ~keyframes: any, ~options: float=?) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) -*/ -@send -external animate2: ( - svgGraphicsElement, - ~keyframes: any, - ~options: keyframeAnimationOptions=?, -) => animation = "animate" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) -*/ -@send -external getAnimations: (svgGraphicsElement, ~options: getAnimationsOptions=?) => array = - "getAnimations" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - svgGraphicsElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - svgGraphicsElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - svgGraphicsElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - svgGraphicsElement, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (svgGraphicsElement, event) => bool = "dispatchEvent" - -/** -Returns node's root. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) -*/ -@send -external getRootNode: (svgGraphicsElement, ~options: getRootNodeOptions=?) => node = "getRootNode" - -/** -Returns whether node has children. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes) -*/ -@send -external hasChildNodes: svgGraphicsElement => bool = "hasChildNodes" - -/** -Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/normalize) -*/ -@send -external normalize: svgGraphicsElement => unit = "normalize" - -/** -Returns a copy of node. If deep is true, the copy also includes the node's descendants. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/cloneNode) -*/ -@send -external cloneNode: (svgGraphicsElement, ~deep: bool=?) => node = "cloneNode" - -/** -Returns whether node and otherNode have the same properties. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) -*/ -@send -external isEqualNode: (svgGraphicsElement, node) => bool = "isEqualNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) -*/ -@send -external isSameNode: (svgGraphicsElement, node) => bool = "isSameNode" - -/** -Returns a bitmask indicating the position of other relative to node. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) -*/ -@send -external compareDocumentPosition: (svgGraphicsElement, node) => int = "compareDocumentPosition" - -/** -Returns true if other is an inclusive descendant of node, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) -*/ -@send -external contains: (svgGraphicsElement, node) => bool = "contains" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) -*/ -@send -external lookupPrefix: (svgGraphicsElement, string) => string = "lookupPrefix" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI) -*/ -@send -external lookupNamespaceURI: (svgGraphicsElement, string) => string = "lookupNamespaceURI" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace) -*/ -@send -external isDefaultNamespace: (svgGraphicsElement, string) => bool = "isDefaultNamespace" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) -*/ -@send -external insertBefore: (svgGraphicsElement, 't, ~child: node) => 't = "insertBefore" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) -*/ -@send -external appendChild: (svgGraphicsElement, 't) => 't = "appendChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) -*/ -@send -external replaceChild: (svgGraphicsElement, ~node: node, 't) => 't = "replaceChild" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) -*/ -@send -external removeChild: (svgGraphicsElement, 't) => 't = "removeChild" - -/** -Returns true if element has attributes, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) -*/ -@send -external hasAttributes: svgGraphicsElement => bool = "hasAttributes" - -/** -Returns the qualified names of all element's attributes. Can contain duplicates. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) -*/ -@send -external getAttributeNames: svgGraphicsElement => array = "getAttributeNames" - -/** -Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) -*/ -@send -external getAttribute: (svgGraphicsElement, string) => string = "getAttribute" - -/** -Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) -*/ -@send -external getAttributeNS: (svgGraphicsElement, ~namespace: string, ~localName: string) => string = - "getAttributeNS" - -/** -Sets the value of element's first attribute whose qualified name is qualifiedName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) -*/ -@send -external setAttribute: (svgGraphicsElement, ~qualifiedName: string, ~value: string) => unit = - "setAttribute" +include Element.Impl({ + type t = svgGraphicsElement +}) -/** -Sets the value of element's attribute whose namespace is namespace and local name is localName to value. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) -*/ -@send -external setAttributeNS: ( - svgGraphicsElement, - ~namespace: string, - ~qualifiedName: string, - ~value: string, -) => unit = "setAttributeNS" - -/** -Removes element's first attribute whose qualified name is qualifiedName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) -*/ -@send -external removeAttribute: (svgGraphicsElement, string) => unit = "removeAttribute" - -/** -Removes element's attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) -*/ -@send -external removeAttributeNS: (svgGraphicsElement, ~namespace: string, ~localName: string) => unit = - "removeAttributeNS" - -/** -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. - -Returns true if qualifiedName is now present, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) -*/ -@send -external toggleAttribute: (svgGraphicsElement, ~qualifiedName: string, ~force: bool=?) => bool = - "toggleAttribute" - -/** -Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) -*/ -@send -external hasAttribute: (svgGraphicsElement, string) => bool = "hasAttribute" - -/** -Returns true if element has an attribute whose namespace is namespace and local name is localName. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) -*/ -@send -external hasAttributeNS: (svgGraphicsElement, ~namespace: string, ~localName: string) => bool = - "hasAttributeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) -*/ -@send -external getAttributeNode: (svgGraphicsElement, string) => attr = "getAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) -*/ -@send -external getAttributeNodeNS: (svgGraphicsElement, ~namespace: string, ~localName: string) => attr = - "getAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) -*/ -@send -external setAttributeNode: (svgGraphicsElement, attr) => attr = "setAttributeNode" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) -*/ -@send -external setAttributeNodeNS: (svgGraphicsElement, attr) => attr = "setAttributeNodeNS" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) -*/ -@send -external removeAttributeNode: (svgGraphicsElement, attr) => attr = "removeAttributeNode" - -/** -Creates a shadow root for element and returns it. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) -*/ -@send -external attachShadow: (svgGraphicsElement, shadowRootInit) => shadowRoot = "attachShadow" - -/** -Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/closest) -*/ -@send -external closest: (svgGraphicsElement, string) => 'e = "closest" - -/** -Returns true if matching selectors against element's root yields element, and false otherwise. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/matches) -*/ -@send -external matches: (svgGraphicsElement, string) => bool = "matches" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) -*/ -@send -external getElementsByTagName: (svgGraphicsElement, string) => htmlCollection = - "getElementsByTagName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) -*/ -@send -external getElementsByTagNameNS: ( - svgGraphicsElement, - ~namespace: string, - ~localName: string, -) => htmlCollectionOf = "getElementsByTagNameNS" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) -*/ -@send -external getElementsByClassName: (svgGraphicsElement, string) => htmlCollectionOf = - "getElementsByClassName" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) -*/ -@send -external insertAdjacentElement: ( - svgGraphicsElement, - ~where: insertPosition, - ~element: element, -) => element = "insertAdjacentElement" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) -*/ -@send -external insertAdjacentText: (svgGraphicsElement, ~where: insertPosition, ~data: string) => unit = - "insertAdjacentText" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) -*/ -@send -external computedStyleMap: svgGraphicsElement => stylePropertyMapReadOnly = "computedStyleMap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) -*/ -@send -external getClientRects: svgGraphicsElement => domRectList = "getClientRects" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) -*/ -@send -external getBoundingClientRect: svgGraphicsElement => domRect = "getBoundingClientRect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) -*/ -@send -external checkVisibility: (svgGraphicsElement, ~options: checkVisibilityOptions=?) => bool = - "checkVisibility" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView: (svgGraphicsElement, ~arg: bool=?) => unit = "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) -*/ -@send -external scrollIntoView2: (svgGraphicsElement, ~arg: scrollIntoViewOptions=?) => unit = - "scrollIntoView" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll: (svgGraphicsElement, ~options: scrollToOptions=?) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) -*/ -@send -external scroll2: (svgGraphicsElement, ~x: float, ~y: float) => unit = "scroll" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo: (svgGraphicsElement, ~options: scrollToOptions=?) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) -*/ -@send -external scrollTo2: (svgGraphicsElement, ~x: float, ~y: float) => unit = "scrollTo" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy: (svgGraphicsElement, ~options: scrollToOptions=?) => unit = "scrollBy" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) -*/ -@send -external scrollBy2: (svgGraphicsElement, ~x: float, ~y: float) => unit = "scrollBy" - -/** -Displays element fullscreen and resolves promise when done. - -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) -*/ -@send -external requestFullscreen: (svgGraphicsElement, ~options: fullscreenOptions=?) => Promise.t = - "requestFullscreen" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setHTMLUnsafe) -*/ -@send -external setHTMLUnsafe: (svgGraphicsElement, string) => unit = "setHTMLUnsafe" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) -*/ -@send -external getHTML: (svgGraphicsElement, ~options: getHTMLOptions=?) => string = "getHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) -*/ -@send -external insertAdjacentHTML: ( - svgGraphicsElement, - ~position: insertPosition, - ~string: string, -) => unit = "insertAdjacentHTML" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) -*/ -@send -external setPointerCapture: (svgGraphicsElement, int) => unit = "setPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) -*/ -@send -external releasePointerCapture: (svgGraphicsElement, int) => unit = "releasePointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) -*/ -@send -external hasPointerCapture: (svgGraphicsElement, int) => bool = "hasPointerCapture" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) -*/ -@send -external requestPointerLock: ( - svgGraphicsElement, - ~options: pointerLockOptions=?, -) => Promise.t = "requestPointerLock" +external asSVGElement: svgGraphicsElement => svgElement = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SVGGraphicsElement/getBBox) diff --git a/src/WebAudioAPI/AnalyserNode.js b/src/WebAudioAPI/AnalyserNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/AnalyserNode.js +++ b/src/WebAudioAPI/AnalyserNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AnalyserNode.res b/src/WebAudioAPI/AnalyserNode.res index 75426f6..6eb2535 100644 --- a/src/WebAudioAPI/AnalyserNode.res +++ b/src/WebAudioAPI/AnalyserNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = analyserNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnalyserNode) */ @@ -8,153 +11,6 @@ open WebAudioAPI external make: (~context: baseAudioContext, ~options: analyserOptions=?) => analyserNode = "AnalyserNode" -external asAudioNode: analyserNode => audioNode = "%identity" -external asEventTarget: analyserNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - analyserNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - analyserNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - analyserNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - analyserNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (analyserNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - analyserNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (analyserNode, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: analyserNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (analyserNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (analyserNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (analyserNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - analyserNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (analyserNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (analyserNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatFrequencyData) */ diff --git a/src/WebAudioAPI/AudioBufferSourceNode.js b/src/WebAudioAPI/AudioBufferSourceNode.js index d856702..253d12c 100644 --- a/src/WebAudioAPI/AudioBufferSourceNode.js +++ b/src/WebAudioAPI/AudioBufferSourceNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; + +AudioScheduledSourceNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioBufferSourceNode.res b/src/WebAudioAPI/AudioBufferSourceNode.res index 80946dc..67ba1e2 100644 --- a/src/WebAudioAPI/AudioBufferSourceNode.res +++ b/src/WebAudioAPI/AudioBufferSourceNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioScheduledSourceNode.Impl({ + type t = audioBufferSourceNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode) */ @@ -10,167 +13,6 @@ external make: ( ~options: audioBufferSourceOptions=?, ) => audioBufferSourceNode = "AudioBufferSourceNode" -external asAudioScheduledSourceNode: audioBufferSourceNode => audioScheduledSourceNode = "%identity" -external asAudioNode: audioBufferSourceNode => audioNode = "%identity" -external asEventTarget: audioBufferSourceNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - audioBufferSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - audioBufferSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - audioBufferSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - audioBufferSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (audioBufferSourceNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - audioBufferSourceNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (audioBufferSourceNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: audioBufferSourceNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (audioBufferSourceNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (audioBufferSourceNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (audioBufferSourceNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - audioBufferSourceNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (audioBufferSourceNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (audioBufferSourceNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) -*/ -@send -external start: (audioBufferSourceNode, ~when_: float=?) => unit = "start" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) -*/ -@send -external stop: (audioBufferSourceNode, ~when_: float=?) => unit = "stop" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/start) */ diff --git a/src/WebAudioAPI/AudioContext.js b/src/WebAudioAPI/AudioContext.js index d856702..9c85ca7 100644 --- a/src/WebAudioAPI/AudioContext.js +++ b/src/WebAudioAPI/AudioContext.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as BaseAudioContext$WebAPI from "./BaseAudioContext.js"; + +BaseAudioContext$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioContext.res b/src/WebAudioAPI/AudioContext.res index 5534cbd..d577540 100644 --- a/src/WebAudioAPI/AudioContext.res +++ b/src/WebAudioAPI/AudioContext.res @@ -1,225 +1,17 @@ -open EventAPI open WebAudioAPI open DOMAPI open MediaCaptureAndStreamsAPI +include BaseAudioContext.Impl({ + type t = audioContext +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext) */ @new external make: (~contextOptions: audioContextOptions=?) => audioContext = "AudioContext" -external asBaseAudioContext: audioContext => baseAudioContext = "%identity" -external asEventTarget: audioContext => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - audioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - audioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - audioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - audioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (audioContext, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) -*/ -@send -external createAnalyser: audioContext => analyserNode = "createAnalyser" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBiquadFilter) -*/ -@send -external createBiquadFilter: audioContext => biquadFilterNode = "createBiquadFilter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBuffer) -*/ -@send -external createBuffer: ( - audioContext, - ~numberOfChannels: int, - ~length: int, - ~sampleRate: float, -) => audioBuffer = "createBuffer" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBufferSource) -*/ -@send -external createBufferSource: audioContext => audioBufferSourceNode = "createBufferSource" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelMerger) -*/ -@send -external createChannelMerger: (audioContext, ~numberOfInputs: int=?) => channelMergerNode = - "createChannelMerger" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelSplitter) -*/ -@send -external createChannelSplitter: (audioContext, ~numberOfOutputs: int=?) => channelSplitterNode = - "createChannelSplitter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConstantSource) -*/ -@send -external createConstantSource: audioContext => constantSourceNode = "createConstantSource" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConvolver) -*/ -@send -external createConvolver: audioContext => convolverNode = "createConvolver" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDelay) -*/ -@send -external createDelay: (audioContext, ~maxDelayTime: float=?) => delayNode = "createDelay" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDynamicsCompressor) -*/ -@send -external createDynamicsCompressor: audioContext => dynamicsCompressorNode = - "createDynamicsCompressor" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createGain) -*/ -@send -external createGain: audioContext => gainNode = "createGain" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) -*/ -@send -external createIIRFilter: ( - audioContext, - ~feedforward: array, - ~feedback: array, -) => iirFilterNode = "createIIRFilter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createOscillator) -*/ -@send -external createOscillator: audioContext => oscillatorNode = "createOscillator" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPanner) -*/ -@send -external createPanner: audioContext => pannerNode = "createPanner" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) -*/ -@send -external createPeriodicWave: ( - audioContext, - ~real: array, - ~imag: array, - ~constraints: periodicWaveConstraints=?, -) => periodicWave = "createPeriodicWave" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createStereoPanner) -*/ -@send -external createStereoPanner: audioContext => stereoPannerNode = "createStereoPanner" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createWaveShaper) -*/ -@send -external createWaveShaper: audioContext => waveShaperNode = "createWaveShaper" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/decodeAudioData) -*/ -@send -external decodeAudioData: ( - audioContext, - ~audioData: ArrayBuffer.t, - ~successCallback: decodeSuccessCallback=?, - ~errorCallback: decodeErrorCallback=?, -) => Promise.t = "decodeAudioData" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioContext/getOutputTimestamp) */ diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index dbf8d92..41ad089 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -2,6 +2,12 @@ import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +function Impl(T) { + EventTarget$WebAPI.Impl({}); + return {}; +} -/* Not a pure module */ +export { + Impl, +} +/* No side effect */ diff --git a/src/WebAudioAPI/AudioNode.res b/src/WebAudioAPI/AudioNode.res index a83e674..ab84045 100644 --- a/src/WebAudioAPI/AudioNode.res +++ b/src/WebAudioAPI/AudioNode.res @@ -1,66 +1,69 @@ open WebAudioAPI -include EventTarget.Impl({ - type t = audioNode -}) +module Impl = ( + T: { + type t + }, +) => { + include EventTarget.Impl({ + type t = T.t + }) -/** + external asAudioNode: T.t => audioNode = "%identity" + + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) */ -@send -external connect: ( - audioNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" + @send + external connect: (T.t, ~destinationNode: audioNode, ~output: int=?, ~input: int=?) => audioNode = + "connect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) */ -@send -external connect2: (audioNode, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" + @send + external connect2: (T.t, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect: audioNode => unit = "disconnect" + @send + external disconnect: T.t => unit = "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect2: (audioNode, int) => unit = "disconnect" + @send + external disconnect2: (T.t, int) => unit = "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect3: (audioNode, audioNode) => unit = "disconnect" + @send + external disconnect3: (T.t, audioNode) => unit = "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect4: (audioNode, ~destinationNode: audioNode, ~output: int) => unit = "disconnect" + @send + external disconnect4: (T.t, ~destinationNode: audioNode, ~output: int) => unit = "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect5: (audioNode, ~destinationNode: audioNode, ~output: int, ~input: int) => unit = - "disconnect" + @send + external disconnect5: (T.t, ~destinationNode: audioNode, ~output: int, ~input: int) => unit = + "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect6: (audioNode, audioParam) => unit = "disconnect" + @send + external disconnect6: (T.t, audioParam) => unit = "disconnect" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ -@send -external disconnect7: (audioNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" + @send + external disconnect7: (T.t, ~destinationParam: audioParam, ~output: int) => unit = "disconnect" +} diff --git a/src/WebAudioAPI/AudioScheduledSourceNode.js b/src/WebAudioAPI/AudioScheduledSourceNode.js index d856702..9427c21 100644 --- a/src/WebAudioAPI/AudioScheduledSourceNode.js +++ b/src/WebAudioAPI/AudioScheduledSourceNode.js @@ -1,2 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +function Impl(T) { + AudioNode$WebAPI.Impl({}); + return {}; +} + +AudioNode$WebAPI.Impl({}); + +export { + Impl, +} +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioScheduledSourceNode.res b/src/WebAudioAPI/AudioScheduledSourceNode.res index b3b9909..036db7b 100644 --- a/src/WebAudioAPI/AudioScheduledSourceNode.res +++ b/src/WebAudioAPI/AudioScheduledSourceNode.res @@ -1,171 +1,29 @@ -open EventAPI open WebAudioAPI -external asAudioNode: audioScheduledSourceNode => audioNode = "%identity" -external asEventTarget: audioScheduledSourceNode => eventTarget = "%identity" -/** -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. +module Impl = ( + T: { + type t + }, +) => { + include AudioNode.Impl({ + type t = audioScheduledSourceNode + }) -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. + external asAudioScheduledSourceNode: T.t => audioScheduledSourceNode = "%identity" -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - audioScheduledSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - audioScheduledSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - audioScheduledSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - audioScheduledSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (audioScheduledSourceNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - audioScheduledSourceNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: ( - audioScheduledSourceNode, - ~destinationParam: audioParam, - ~output: int=?, -) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: audioScheduledSourceNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (audioScheduledSourceNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (audioScheduledSourceNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: ( - audioScheduledSourceNode, - ~destinationNode: audioNode, - ~output: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - audioScheduledSourceNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (audioScheduledSourceNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: ( - audioScheduledSourceNode, - ~destinationParam: audioParam, - ~output: int, -) => unit = "disconnect" - -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) */ -@send -external start: (audioScheduledSourceNode, ~when_: float=?) => unit = "start" + @send + external start: (T.t, ~when_: float=?) => unit = "start" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) */ -@send -external stop: (audioScheduledSourceNode, ~when_: float=?) => unit = "stop" + @send + external stop: (T.t, ~when_: float=?) => unit = "stop" +} + +include Impl({ + type t = audioScheduledSourceNode +}) diff --git a/src/WebAudioAPI/AudioWorkletNode.js b/src/WebAudioAPI/AudioWorkletNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/AudioWorkletNode.js +++ b/src/WebAudioAPI/AudioWorkletNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioWorkletNode.res b/src/WebAudioAPI/AudioWorkletNode.res index 5635b1f..5675e85 100644 --- a/src/WebAudioAPI/AudioWorkletNode.res +++ b/src/WebAudioAPI/AudioWorkletNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = audioWorkletNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode) */ @@ -10,151 +13,3 @@ external make: ( ~name: string, ~options: audioWorkletNodeOptions=?, ) => audioWorkletNode = "AudioWorkletNode" - -external asAudioNode: audioWorkletNode => audioNode = "%identity" -external asEventTarget: audioWorkletNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - audioWorkletNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - audioWorkletNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - audioWorkletNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - audioWorkletNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (audioWorkletNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - audioWorkletNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (audioWorkletNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: audioWorkletNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (audioWorkletNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (audioWorkletNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (audioWorkletNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - audioWorkletNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (audioWorkletNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (audioWorkletNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index dbf8d92..41ad089 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -2,6 +2,12 @@ import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +function Impl(T) { + EventTarget$WebAPI.Impl({}); + return {}; +} -/* Not a pure module */ +export { + Impl, +} +/* No side effect */ diff --git a/src/WebAudioAPI/BaseAudioContext.res b/src/WebAudioAPI/BaseAudioContext.res index 8e794b8..351291b 100644 --- a/src/WebAudioAPI/BaseAudioContext.res +++ b/src/WebAudioAPI/BaseAudioContext.res @@ -1,135 +1,142 @@ open WebAudioAPI -include EventTarget.Impl({ - type t = baseAudioContext -}) - -/** +module Impl = ( + T: { + type t + }, +) => { + include EventTarget.Impl({ + type t = T.t + }) + + external asBaseAudioContext: T.t => baseAudioContext = "%identity" + + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) */ -@send -external createAnalyser: baseAudioContext => analyserNode = "createAnalyser" + @send + external createAnalyser: T.t => analyserNode = "createAnalyser" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBiquadFilter) */ -@send -external createBiquadFilter: baseAudioContext => biquadFilterNode = "createBiquadFilter" + @send + external createBiquadFilter: T.t => biquadFilterNode = "createBiquadFilter" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBuffer) */ -@send -external createBuffer: ( - baseAudioContext, - ~numberOfChannels: int, - ~length: int, - ~sampleRate: float, -) => audioBuffer = "createBuffer" + @send + external createBuffer: ( + T.t, + ~numberOfChannels: int, + ~length: int, + ~sampleRate: float, + ) => audioBuffer = "createBuffer" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBufferSource) */ -@send -external createBufferSource: baseAudioContext => audioBufferSourceNode = "createBufferSource" + @send + external createBufferSource: T.t => audioBufferSourceNode = "createBufferSource" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelMerger) */ -@send -external createChannelMerger: (baseAudioContext, ~numberOfInputs: int=?) => channelMergerNode = - "createChannelMerger" + @send + external createChannelMerger: (T.t, ~numberOfInputs: int=?) => channelMergerNode = + "createChannelMerger" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelSplitter) */ -@send -external createChannelSplitter: (baseAudioContext, ~numberOfOutputs: int=?) => channelSplitterNode = - "createChannelSplitter" + @send + external createChannelSplitter: (T.t, ~numberOfOutputs: int=?) => channelSplitterNode = + "createChannelSplitter" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConstantSource) */ -@send -external createConstantSource: baseAudioContext => constantSourceNode = "createConstantSource" + @send + external createConstantSource: T.t => constantSourceNode = "createConstantSource" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConvolver) */ -@send -external createConvolver: baseAudioContext => convolverNode = "createConvolver" + @send + external createConvolver: T.t => convolverNode = "createConvolver" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDelay) */ -@send -external createDelay: (baseAudioContext, ~maxDelayTime: float=?) => delayNode = "createDelay" + @send + external createDelay: (T.t, ~maxDelayTime: float=?) => delayNode = "createDelay" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDynamicsCompressor) */ -@send -external createDynamicsCompressor: baseAudioContext => dynamicsCompressorNode = - "createDynamicsCompressor" + @send + external createDynamicsCompressor: T.t => dynamicsCompressorNode = "createDynamicsCompressor" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createGain) */ -@send -external createGain: baseAudioContext => gainNode = "createGain" + @send + external createGain: T.t => gainNode = "createGain" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) */ -@send -external createIIRFilter: ( - baseAudioContext, - ~feedforward: array, - ~feedback: array, -) => iirFilterNode = "createIIRFilter" + @send + external createIIRFilter: ( + T.t, + ~feedforward: array, + ~feedback: array, + ) => iirFilterNode = "createIIRFilter" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createOscillator) */ -@send -external createOscillator: baseAudioContext => oscillatorNode = "createOscillator" + @send + external createOscillator: T.t => oscillatorNode = "createOscillator" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPanner) */ -@send -external createPanner: baseAudioContext => pannerNode = "createPanner" + @send + external createPanner: T.t => pannerNode = "createPanner" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) */ -@send -external createPeriodicWave: ( - baseAudioContext, - ~real: array, - ~imag: array, - ~constraints: periodicWaveConstraints=?, -) => periodicWave = "createPeriodicWave" + @send + external createPeriodicWave: ( + T.t, + ~real: array, + ~imag: array, + ~constraints: periodicWaveConstraints=?, + ) => periodicWave = "createPeriodicWave" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createStereoPanner) */ -@send -external createStereoPanner: baseAudioContext => stereoPannerNode = "createStereoPanner" + @send + external createStereoPanner: T.t => stereoPannerNode = "createStereoPanner" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createWaveShaper) */ -@send -external createWaveShaper: baseAudioContext => waveShaperNode = "createWaveShaper" + @send + external createWaveShaper: T.t => waveShaperNode = "createWaveShaper" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/decodeAudioData) */ -@send -external decodeAudioData: ( - baseAudioContext, - ~audioData: ArrayBuffer.t, - ~successCallback: decodeSuccessCallback=?, - ~errorCallback: decodeErrorCallback=?, -) => Promise.t = "decodeAudioData" + @send + external decodeAudioData: ( + T.t, + ~audioData: ArrayBuffer.t, + ~successCallback: decodeSuccessCallback=?, + ~errorCallback: decodeErrorCallback=?, + ) => Promise.t = "decodeAudioData" +} diff --git a/src/WebAudioAPI/BiquadFilterNode.js b/src/WebAudioAPI/BiquadFilterNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/BiquadFilterNode.js +++ b/src/WebAudioAPI/BiquadFilterNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/BiquadFilterNode.res b/src/WebAudioAPI/BiquadFilterNode.res index 690ff3e..b9c62d0 100644 --- a/src/WebAudioAPI/BiquadFilterNode.res +++ b/src/WebAudioAPI/BiquadFilterNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = biquadFilterNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode) */ @@ -8,154 +11,6 @@ open WebAudioAPI external make: (~context: baseAudioContext, ~options: biquadFilterOptions=?) => biquadFilterNode = "BiquadFilterNode" -external asAudioNode: biquadFilterNode => audioNode = "%identity" -external asEventTarget: biquadFilterNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - biquadFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - biquadFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - biquadFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - biquadFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (biquadFilterNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - biquadFilterNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (biquadFilterNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: biquadFilterNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (biquadFilterNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (biquadFilterNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (biquadFilterNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - biquadFilterNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (biquadFilterNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (biquadFilterNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/getFrequencyResponse) */ diff --git a/src/WebAudioAPI/ChannelMergerNode.js b/src/WebAudioAPI/ChannelMergerNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/ChannelMergerNode.js +++ b/src/WebAudioAPI/ChannelMergerNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/ChannelMergerNode.res b/src/WebAudioAPI/ChannelMergerNode.res index 7e16bad..983ac02 100644 --- a/src/WebAudioAPI/ChannelMergerNode.res +++ b/src/WebAudioAPI/ChannelMergerNode.res @@ -1,157 +1,12 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = channelMergerNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ChannelMergerNode) */ @new external make: (~context: baseAudioContext, ~options: channelMergerOptions=?) => channelMergerNode = "ChannelMergerNode" - -external asAudioNode: channelMergerNode => audioNode = "%identity" -external asEventTarget: channelMergerNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - channelMergerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - channelMergerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - channelMergerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - channelMergerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (channelMergerNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - channelMergerNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (channelMergerNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: channelMergerNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (channelMergerNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (channelMergerNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (channelMergerNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - channelMergerNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (channelMergerNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (channelMergerNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/ChannelSplitterNode.js b/src/WebAudioAPI/ChannelSplitterNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/ChannelSplitterNode.js +++ b/src/WebAudioAPI/ChannelSplitterNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/ChannelSplitterNode.res b/src/WebAudioAPI/ChannelSplitterNode.res index f4f9780..c2c5d08 100644 --- a/src/WebAudioAPI/ChannelSplitterNode.res +++ b/src/WebAudioAPI/ChannelSplitterNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = channelSplitterNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ChannelSplitterNode) */ @@ -9,151 +12,3 @@ external make: ( ~context: baseAudioContext, ~options: channelSplitterOptions=?, ) => channelSplitterNode = "ChannelSplitterNode" - -external asAudioNode: channelSplitterNode => audioNode = "%identity" -external asEventTarget: channelSplitterNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - channelSplitterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - channelSplitterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - channelSplitterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - channelSplitterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (channelSplitterNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - channelSplitterNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (channelSplitterNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: channelSplitterNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (channelSplitterNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (channelSplitterNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (channelSplitterNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - channelSplitterNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (channelSplitterNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (channelSplitterNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/ConstantSourceNode.js b/src/WebAudioAPI/ConstantSourceNode.js index d856702..253d12c 100644 --- a/src/WebAudioAPI/ConstantSourceNode.js +++ b/src/WebAudioAPI/ConstantSourceNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; + +AudioScheduledSourceNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/ConstantSourceNode.res b/src/WebAudioAPI/ConstantSourceNode.res index 6d114ff..343d7bd 100644 --- a/src/WebAudioAPI/ConstantSourceNode.res +++ b/src/WebAudioAPI/ConstantSourceNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioScheduledSourceNode.Impl({ + type t = constantSourceNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ConstantSourceNode) */ @@ -9,164 +12,3 @@ external make: ( ~context: baseAudioContext, ~options: constantSourceOptions=?, ) => constantSourceNode = "ConstantSourceNode" - -external asAudioScheduledSourceNode: constantSourceNode => audioScheduledSourceNode = "%identity" -external asAudioNode: constantSourceNode => audioNode = "%identity" -external asEventTarget: constantSourceNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - constantSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - constantSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - constantSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - constantSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (constantSourceNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - constantSourceNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (constantSourceNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: constantSourceNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (constantSourceNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (constantSourceNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (constantSourceNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - constantSourceNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (constantSourceNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (constantSourceNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) -*/ -@send -external start: (constantSourceNode, ~when_: float=?) => unit = "start" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) -*/ -@send -external stop: (constantSourceNode, ~when_: float=?) => unit = "stop" diff --git a/src/WebAudioAPI/ConvolverNode.js b/src/WebAudioAPI/ConvolverNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/ConvolverNode.js +++ b/src/WebAudioAPI/ConvolverNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/ConvolverNode.res b/src/WebAudioAPI/ConvolverNode.res index cebc924..48a6157 100644 --- a/src/WebAudioAPI/ConvolverNode.res +++ b/src/WebAudioAPI/ConvolverNode.res @@ -1,157 +1,12 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = convolverNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ConvolverNode) */ @new external make: (~context: baseAudioContext, ~options: convolverOptions=?) => convolverNode = "ConvolverNode" - -external asAudioNode: convolverNode => audioNode = "%identity" -external asEventTarget: convolverNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - convolverNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - convolverNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - convolverNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - convolverNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (convolverNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - convolverNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (convolverNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: convolverNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (convolverNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (convolverNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (convolverNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - convolverNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (convolverNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (convolverNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/DelayNode.js b/src/WebAudioAPI/DelayNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/DelayNode.js +++ b/src/WebAudioAPI/DelayNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/DelayNode.res b/src/WebAudioAPI/DelayNode.res index d662983..7a58aa7 100644 --- a/src/WebAudioAPI/DelayNode.res +++ b/src/WebAudioAPI/DelayNode.res @@ -1,150 +1,11 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = delayNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DelayNode) */ @new external make: (~context: baseAudioContext, ~options: delayOptions=?) => delayNode = "DelayNode" - -external asAudioNode: delayNode => audioNode = "%identity" -external asEventTarget: delayNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - delayNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - delayNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - delayNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - delayNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (delayNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - delayNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (delayNode, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: delayNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (delayNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (delayNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (delayNode, ~destinationNode: audioNode, ~output: int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: (delayNode, ~destinationNode: audioNode, ~output: int, ~input: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (delayNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (delayNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/DynamicsCompressorNode.js b/src/WebAudioAPI/DynamicsCompressorNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/DynamicsCompressorNode.js +++ b/src/WebAudioAPI/DynamicsCompressorNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/DynamicsCompressorNode.res b/src/WebAudioAPI/DynamicsCompressorNode.res index 8ed83ae..849ff5b 100644 --- a/src/WebAudioAPI/DynamicsCompressorNode.res +++ b/src/WebAudioAPI/DynamicsCompressorNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = dynamicsCompressorNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode) */ @@ -9,154 +12,3 @@ external make: ( ~context: baseAudioContext, ~options: dynamicsCompressorOptions=?, ) => dynamicsCompressorNode = "DynamicsCompressorNode" - -external asAudioNode: dynamicsCompressorNode => audioNode = "%identity" -external asEventTarget: dynamicsCompressorNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - dynamicsCompressorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - dynamicsCompressorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - dynamicsCompressorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - dynamicsCompressorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (dynamicsCompressorNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - dynamicsCompressorNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (dynamicsCompressorNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: dynamicsCompressorNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (dynamicsCompressorNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (dynamicsCompressorNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (dynamicsCompressorNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - dynamicsCompressorNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (dynamicsCompressorNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: ( - dynamicsCompressorNode, - ~destinationParam: audioParam, - ~output: int, -) => unit = "disconnect" diff --git a/src/WebAudioAPI/GainNode.js b/src/WebAudioAPI/GainNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/GainNode.js +++ b/src/WebAudioAPI/GainNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/GainNode.res b/src/WebAudioAPI/GainNode.res index c443682..1920c1a 100644 --- a/src/WebAudioAPI/GainNode.res +++ b/src/WebAudioAPI/GainNode.res @@ -1,149 +1,11 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = gainNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/GainNode) */ @new external make: (~context: baseAudioContext, ~options: gainOptions=?) => gainNode = "GainNode" - -external asAudioNode: gainNode => audioNode = "%identity" -external asEventTarget: gainNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - gainNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - gainNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - gainNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - gainNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (gainNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - gainNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (gainNode, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: gainNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (gainNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (gainNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (gainNode, ~destinationNode: audioNode, ~output: int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: (gainNode, ~destinationNode: audioNode, ~output: int, ~input: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (gainNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (gainNode, ~destinationParam: audioParam, ~output: int) => unit = "disconnect" diff --git a/src/WebAudioAPI/IIRFilterNode.js b/src/WebAudioAPI/IIRFilterNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/IIRFilterNode.js +++ b/src/WebAudioAPI/IIRFilterNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/IIRFilterNode.res b/src/WebAudioAPI/IIRFilterNode.res index f8e7a00..785a09e 100644 --- a/src/WebAudioAPI/IIRFilterNode.res +++ b/src/WebAudioAPI/IIRFilterNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = iirFilterNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IIRFilterNode) */ @@ -8,154 +11,6 @@ open WebAudioAPI external make: (~context: baseAudioContext, ~options: iirFilterOptions) => iirFilterNode = "IIRFilterNode" -external asAudioNode: iirFilterNode => audioNode = "%identity" -external asEventTarget: iirFilterNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - iirFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - iirFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - iirFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - iirFilterNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (iirFilterNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - iirFilterNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (iirFilterNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: iirFilterNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (iirFilterNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (iirFilterNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (iirFilterNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - iirFilterNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (iirFilterNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (iirFilterNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IIRFilterNode/getFrequencyResponse) */ diff --git a/src/WebAudioAPI/MediaElementAudioSourceNode.js b/src/WebAudioAPI/MediaElementAudioSourceNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/MediaElementAudioSourceNode.js +++ b/src/WebAudioAPI/MediaElementAudioSourceNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/MediaElementAudioSourceNode.res b/src/WebAudioAPI/MediaElementAudioSourceNode.res index e8fd1b4..f9bb2b1 100644 --- a/src/WebAudioAPI/MediaElementAudioSourceNode.res +++ b/src/WebAudioAPI/MediaElementAudioSourceNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = mediaElementAudioSourceNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaElementAudioSourceNode) */ @@ -9,160 +12,3 @@ external make: ( ~context: audioContext, ~options: mediaElementAudioSourceOptions, ) => mediaElementAudioSourceNode = "MediaElementAudioSourceNode" - -external asAudioNode: mediaElementAudioSourceNode => audioNode = "%identity" -external asEventTarget: mediaElementAudioSourceNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaElementAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaElementAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaElementAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaElementAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaElementAudioSourceNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - mediaElementAudioSourceNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: ( - mediaElementAudioSourceNode, - ~destinationParam: audioParam, - ~output: int=?, -) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: mediaElementAudioSourceNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (mediaElementAudioSourceNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (mediaElementAudioSourceNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: ( - mediaElementAudioSourceNode, - ~destinationNode: audioNode, - ~output: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - mediaElementAudioSourceNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (mediaElementAudioSourceNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: ( - mediaElementAudioSourceNode, - ~destinationParam: audioParam, - ~output: int, -) => unit = "disconnect" diff --git a/src/WebAudioAPI/MediaStreamAudioDestinationNode.js b/src/WebAudioAPI/MediaStreamAudioDestinationNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/MediaStreamAudioDestinationNode.js +++ b/src/WebAudioAPI/MediaStreamAudioDestinationNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/MediaStreamAudioDestinationNode.res b/src/WebAudioAPI/MediaStreamAudioDestinationNode.res index f4ac6d0..8743eba 100644 --- a/src/WebAudioAPI/MediaStreamAudioDestinationNode.res +++ b/src/WebAudioAPI/MediaStreamAudioDestinationNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = mediaStreamAudioDestinationNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStreamAudioDestinationNode) */ @@ -9,160 +12,3 @@ external make: ( ~context: audioContext, ~options: audioNodeOptions=?, ) => mediaStreamAudioDestinationNode = "MediaStreamAudioDestinationNode" - -external asAudioNode: mediaStreamAudioDestinationNode => audioNode = "%identity" -external asEventTarget: mediaStreamAudioDestinationNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaStreamAudioDestinationNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaStreamAudioDestinationNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaStreamAudioDestinationNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaStreamAudioDestinationNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaStreamAudioDestinationNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - mediaStreamAudioDestinationNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: ( - mediaStreamAudioDestinationNode, - ~destinationParam: audioParam, - ~output: int=?, -) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: mediaStreamAudioDestinationNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (mediaStreamAudioDestinationNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (mediaStreamAudioDestinationNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: ( - mediaStreamAudioDestinationNode, - ~destinationNode: audioNode, - ~output: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - mediaStreamAudioDestinationNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (mediaStreamAudioDestinationNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: ( - mediaStreamAudioDestinationNode, - ~destinationParam: audioParam, - ~output: int, -) => unit = "disconnect" diff --git a/src/WebAudioAPI/MediaStreamAudioSourceNode.js b/src/WebAudioAPI/MediaStreamAudioSourceNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/MediaStreamAudioSourceNode.js +++ b/src/WebAudioAPI/MediaStreamAudioSourceNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/MediaStreamAudioSourceNode.res b/src/WebAudioAPI/MediaStreamAudioSourceNode.res index fe3f122..107605f 100644 --- a/src/WebAudioAPI/MediaStreamAudioSourceNode.res +++ b/src/WebAudioAPI/MediaStreamAudioSourceNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = mediaStreamAudioSourceNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaStreamAudioSourceNode) */ @@ -9,160 +12,3 @@ external make: ( ~context: audioContext, ~options: mediaStreamAudioSourceOptions, ) => mediaStreamAudioSourceNode = "MediaStreamAudioSourceNode" - -external asAudioNode: mediaStreamAudioSourceNode => audioNode = "%identity" -external asEventTarget: mediaStreamAudioSourceNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - mediaStreamAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - mediaStreamAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - mediaStreamAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - mediaStreamAudioSourceNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (mediaStreamAudioSourceNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - mediaStreamAudioSourceNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: ( - mediaStreamAudioSourceNode, - ~destinationParam: audioParam, - ~output: int=?, -) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: mediaStreamAudioSourceNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (mediaStreamAudioSourceNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (mediaStreamAudioSourceNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: ( - mediaStreamAudioSourceNode, - ~destinationNode: audioNode, - ~output: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - mediaStreamAudioSourceNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (mediaStreamAudioSourceNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: ( - mediaStreamAudioSourceNode, - ~destinationParam: audioParam, - ~output: int, -) => unit = "disconnect" diff --git a/src/WebAudioAPI/OfflineAudioContext.js b/src/WebAudioAPI/OfflineAudioContext.js index d856702..9c85ca7 100644 --- a/src/WebAudioAPI/OfflineAudioContext.js +++ b/src/WebAudioAPI/OfflineAudioContext.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as BaseAudioContext$WebAPI from "./BaseAudioContext.js"; + +BaseAudioContext$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/OfflineAudioContext.res b/src/WebAudioAPI/OfflineAudioContext.res index d34b11d..de73a56 100644 --- a/src/WebAudioAPI/OfflineAudioContext.res +++ b/src/WebAudioAPI/OfflineAudioContext.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include BaseAudioContext.Impl({ + type t = offlineAudioContext +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext) */ @@ -14,219 +17,6 @@ external make: offlineAudioContextOptions => offlineAudioContext = "OfflineAudio external make2: (~numberOfChannels: int, ~length: int, ~sampleRate: float) => offlineAudioContext = "OfflineAudioContext" -external asBaseAudioContext: offlineAudioContext => baseAudioContext = "%identity" -external asEventTarget: offlineAudioContext => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - offlineAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - offlineAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - offlineAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - offlineAudioContext, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (offlineAudioContext, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) -*/ -@send -external createAnalyser: offlineAudioContext => analyserNode = "createAnalyser" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBiquadFilter) -*/ -@send -external createBiquadFilter: offlineAudioContext => biquadFilterNode = "createBiquadFilter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBuffer) -*/ -@send -external createBuffer: ( - offlineAudioContext, - ~numberOfChannels: int, - ~length: int, - ~sampleRate: float, -) => audioBuffer = "createBuffer" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBufferSource) -*/ -@send -external createBufferSource: offlineAudioContext => audioBufferSourceNode = "createBufferSource" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelMerger) -*/ -@send -external createChannelMerger: (offlineAudioContext, ~numberOfInputs: int=?) => channelMergerNode = - "createChannelMerger" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelSplitter) -*/ -@send -external createChannelSplitter: ( - offlineAudioContext, - ~numberOfOutputs: int=?, -) => channelSplitterNode = "createChannelSplitter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConstantSource) -*/ -@send -external createConstantSource: offlineAudioContext => constantSourceNode = "createConstantSource" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConvolver) -*/ -@send -external createConvolver: offlineAudioContext => convolverNode = "createConvolver" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDelay) -*/ -@send -external createDelay: (offlineAudioContext, ~maxDelayTime: float=?) => delayNode = "createDelay" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDynamicsCompressor) -*/ -@send -external createDynamicsCompressor: offlineAudioContext => dynamicsCompressorNode = - "createDynamicsCompressor" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createGain) -*/ -@send -external createGain: offlineAudioContext => gainNode = "createGain" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) -*/ -@send -external createIIRFilter: ( - offlineAudioContext, - ~feedforward: array, - ~feedback: array, -) => iirFilterNode = "createIIRFilter" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createOscillator) -*/ -@send -external createOscillator: offlineAudioContext => oscillatorNode = "createOscillator" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPanner) -*/ -@send -external createPanner: offlineAudioContext => pannerNode = "createPanner" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) -*/ -@send -external createPeriodicWave: ( - offlineAudioContext, - ~real: array, - ~imag: array, - ~constraints: periodicWaveConstraints=?, -) => periodicWave = "createPeriodicWave" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createStereoPanner) -*/ -@send -external createStereoPanner: offlineAudioContext => stereoPannerNode = "createStereoPanner" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createWaveShaper) -*/ -@send -external createWaveShaper: offlineAudioContext => waveShaperNode = "createWaveShaper" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/decodeAudioData) -*/ -@send -external decodeAudioData: ( - offlineAudioContext, - ~audioData: ArrayBuffer.t, - ~successCallback: decodeSuccessCallback=?, - ~errorCallback: decodeErrorCallback=?, -) => Promise.t = "decodeAudioData" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/startRendering) */ diff --git a/src/WebAudioAPI/OscillatorNode.js b/src/WebAudioAPI/OscillatorNode.js index d856702..253d12c 100644 --- a/src/WebAudioAPI/OscillatorNode.js +++ b/src/WebAudioAPI/OscillatorNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; + +AudioScheduledSourceNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/OscillatorNode.res b/src/WebAudioAPI/OscillatorNode.res index 70b89a6..52333c2 100644 --- a/src/WebAudioAPI/OscillatorNode.res +++ b/src/WebAudioAPI/OscillatorNode.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include AudioScheduledSourceNode.Impl({ + type t = oscillatorNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OscillatorNode) */ @@ -8,167 +11,6 @@ open WebAudioAPI external make: (~context: baseAudioContext, ~options: oscillatorOptions=?) => oscillatorNode = "OscillatorNode" -external asAudioScheduledSourceNode: oscillatorNode => audioScheduledSourceNode = "%identity" -external asAudioNode: oscillatorNode => audioNode = "%identity" -external asEventTarget: oscillatorNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - oscillatorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - oscillatorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - oscillatorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - oscillatorNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (oscillatorNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - oscillatorNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (oscillatorNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: oscillatorNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (oscillatorNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (oscillatorNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (oscillatorNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - oscillatorNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (oscillatorNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (oscillatorNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) -*/ -@send -external start: (oscillatorNode, ~when_: float=?) => unit = "start" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) -*/ -@send -external stop: (oscillatorNode, ~when_: float=?) => unit = "stop" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OscillatorNode/setPeriodicWave) */ diff --git a/src/WebAudioAPI/PannerNode.js b/src/WebAudioAPI/PannerNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/PannerNode.js +++ b/src/WebAudioAPI/PannerNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/PannerNode.res b/src/WebAudioAPI/PannerNode.res index 6f70f9a..cdcfca5 100644 --- a/src/WebAudioAPI/PannerNode.res +++ b/src/WebAudioAPI/PannerNode.res @@ -1,150 +1,11 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = pannerNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PannerNode) */ @new external make: (~context: baseAudioContext, ~options: pannerOptions=?) => pannerNode = "PannerNode" - -external asAudioNode: pannerNode => audioNode = "%identity" -external asEventTarget: pannerNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - pannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - pannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - pannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - pannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (pannerNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - pannerNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (pannerNode, ~destinationParam: audioParam, ~output: int=?) => unit = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: pannerNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (pannerNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (pannerNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (pannerNode, ~destinationNode: audioNode, ~output: int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: (pannerNode, ~destinationNode: audioNode, ~output: int, ~input: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (pannerNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (pannerNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/StereoPannerNode.js b/src/WebAudioAPI/StereoPannerNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/StereoPannerNode.js +++ b/src/WebAudioAPI/StereoPannerNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/StereoPannerNode.res b/src/WebAudioAPI/StereoPannerNode.res index f86ef22..f42256d 100644 --- a/src/WebAudioAPI/StereoPannerNode.res +++ b/src/WebAudioAPI/StereoPannerNode.res @@ -1,157 +1,12 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = stereoPannerNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StereoPannerNode) */ @new external make: (~context: baseAudioContext, ~options: stereoPannerOptions=?) => stereoPannerNode = "StereoPannerNode" - -external asAudioNode: stereoPannerNode => audioNode = "%identity" -external asEventTarget: stereoPannerNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - stereoPannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - stereoPannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - stereoPannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - stereoPannerNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (stereoPannerNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - stereoPannerNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (stereoPannerNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: stereoPannerNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (stereoPannerNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (stereoPannerNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (stereoPannerNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - stereoPannerNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (stereoPannerNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (stereoPannerNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebAudioAPI/WaveShaperNode.js b/src/WebAudioAPI/WaveShaperNode.js index d856702..22c59b6 100644 --- a/src/WebAudioAPI/WaveShaperNode.js +++ b/src/WebAudioAPI/WaveShaperNode.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as AudioNode$WebAPI from "./AudioNode.js"; + +AudioNode$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/WaveShaperNode.res b/src/WebAudioAPI/WaveShaperNode.res index a4df649..4f1cf03 100644 --- a/src/WebAudioAPI/WaveShaperNode.res +++ b/src/WebAudioAPI/WaveShaperNode.res @@ -1,157 +1,12 @@ -open EventAPI open WebAudioAPI +include AudioNode.Impl({ + type t = waveShaperNode +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WaveShaperNode) */ @new external make: (~context: baseAudioContext, ~options: waveShaperOptions=?) => waveShaperNode = "WaveShaperNode" - -external asAudioNode: waveShaperNode => audioNode = "%identity" -external asEventTarget: waveShaperNode => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - waveShaperNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - waveShaperNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - waveShaperNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - waveShaperNode, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (waveShaperNode, event) => bool = "dispatchEvent" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect: ( - waveShaperNode, - ~destinationNode: audioNode, - ~output: int=?, - ~input: int=?, -) => audioNode = "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) -*/ -@send -external connect2: (waveShaperNode, ~destinationParam: audioParam, ~output: int=?) => unit = - "connect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect: waveShaperNode => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect2: (waveShaperNode, int) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect3: (waveShaperNode, audioNode) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect4: (waveShaperNode, ~destinationNode: audioNode, ~output: int) => unit = - "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect5: ( - waveShaperNode, - ~destinationNode: audioNode, - ~output: int, - ~input: int, -) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect6: (waveShaperNode, audioParam) => unit = "disconnect" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) -*/ -@send -external disconnect7: (waveShaperNode, ~destinationParam: audioParam, ~output: int) => unit = - "disconnect" diff --git a/src/WebSpeechAPI/SpeechSynthesisUtterance.js b/src/WebSpeechAPI/SpeechSynthesisUtterance.js index d856702..dbf8d92 100644 --- a/src/WebSpeechAPI/SpeechSynthesisUtterance.js +++ b/src/WebSpeechAPI/SpeechSynthesisUtterance.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; + +EventTarget$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesisUtterance.res b/src/WebSpeechAPI/SpeechSynthesisUtterance.res index 67f6ff5..1eb97c8 100644 --- a/src/WebSpeechAPI/SpeechSynthesisUtterance.res +++ b/src/WebSpeechAPI/SpeechSynthesisUtterance.res @@ -1,88 +1,11 @@ -open EventAPI open WebSpeechAPI +include EventTarget.Impl({ + type t = speechSynthesisUtterance +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisUtterance) */ @new external make: (~text: string=?) => speechSynthesisUtterance = "SpeechSynthesisUtterance" - -external asEventTarget: speechSynthesisUtterance => eventTarget = "%identity" -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener: ( - speechSynthesisUtterance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: addEventListenerOptions=?, -) => unit = "addEventListener" - -/** -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. - -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. - -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. - -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. - -When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - -If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - -The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) -*/ -@send -external addEventListener2: ( - speechSynthesisUtterance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "addEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener: ( - speechSynthesisUtterance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: eventListenerOptions=?, -) => unit = "removeEventListener" - -/** -Removes the event listener in target's event listener list with the same type, callback, and options. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) -*/ -@send -external removeEventListener2: ( - speechSynthesisUtterance, - ~type_: eventType, - ~callback: eventListener<'event>, - ~options: bool=?, -) => unit = "removeEventListener" - -/** -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. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) -*/ -@send -external dispatchEvent: (speechSynthesisUtterance, event) => bool = "dispatchEvent" From 4aefb8c2175a5d6a31645e22e601745d9e38ff09 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 15:16:58 +0100 Subject: [PATCH 11/13] Extract Event --- src/CSSFontLoadingAPI/FontFaceSet.js | 4 +- src/CanvasAPI/OffscreenCanvas.js | 4 +- src/ChannelMessagingAPI/MessagePort.js | 4 +- src/ClipboardAPI/Clipboard.js | 4 +- src/DOMAPI/Animation.js | 4 +- src/DOMAPI/CharacterData.js | 6 +-- src/DOMAPI/Comment.js | 4 +- src/DOMAPI/Document.js | 4 +- src/DOMAPI/DocumentFragment.js | 6 +-- src/DOMAPI/Element.js | 6 +-- src/DOMAPI/FillStyle.js | 8 ++-- src/DOMAPI/HTMLAnchorElement.js | 4 +- src/DOMAPI/HTMLAreaElement.js | 4 +- src/DOMAPI/HTMLAudioElement.js | 4 +- src/DOMAPI/HTMLBRElement.js | 4 +- src/DOMAPI/HTMLBaseElement.js | 4 +- src/DOMAPI/HTMLBodyElement.js | 4 +- src/DOMAPI/HTMLButtonElement.js | 4 +- src/DOMAPI/HTMLCanvasElement.js | 4 +- src/DOMAPI/HTMLDListElement.js | 4 +- src/DOMAPI/HTMLDataElement.js | 4 +- src/DOMAPI/HTMLDataListElement.js | 4 +- src/DOMAPI/HTMLDialogElement.js | 4 +- src/DOMAPI/HTMLDivElement.js | 4 +- src/DOMAPI/HTMLElement.js | 6 +-- src/DOMAPI/HTMLEmbedElement.js | 4 +- src/DOMAPI/HTMLFieldSetElement.js | 4 +- src/DOMAPI/HTMLFormElement.js | 4 +- src/DOMAPI/HTMLFrameSetElement.js | 4 +- src/DOMAPI/HTMLHRElement.js | 4 +- src/DOMAPI/HTMLHeadElement.js | 4 +- src/DOMAPI/HTMLHeadingElement.js | 4 +- src/DOMAPI/HTMLHtmlElement.js | 4 +- src/DOMAPI/HTMLIFrameElement.js | 4 +- src/DOMAPI/HTMLImageElement.js | 4 +- src/DOMAPI/HTMLInputElement.js | 4 +- src/DOMAPI/HTMLLIElement.js | 4 +- src/DOMAPI/HTMLLabelElement.js | 4 +- src/DOMAPI/HTMLLegendElement.js | 4 +- src/DOMAPI/HTMLLinkElement.js | 4 +- src/DOMAPI/HTMLMapElement.js | 4 +- src/DOMAPI/HTMLMediaElement.js | 6 +-- src/DOMAPI/HTMLMenuElement.js | 4 +- src/DOMAPI/HTMLMetaElement.js | 4 +- src/DOMAPI/HTMLMeterElement.js | 4 +- src/DOMAPI/HTMLModElement.js | 4 +- src/DOMAPI/HTMLOListElement.js | 4 +- src/DOMAPI/HTMLObjectElement.js | 4 +- src/DOMAPI/HTMLOptGroupElement.js | 4 +- src/DOMAPI/HTMLOptionElement.js | 4 +- src/DOMAPI/HTMLOutputElement.js | 4 +- src/DOMAPI/HTMLParagraphElement.js | 4 +- src/DOMAPI/HTMLPictureElement.js | 4 +- src/DOMAPI/HTMLPreElement.js | 4 +- src/DOMAPI/HTMLProgressElement.js | 4 +- src/DOMAPI/HTMLQuoteElement.js | 4 +- src/DOMAPI/HTMLScriptElement.js | 4 +- src/DOMAPI/HTMLSelectElement.js | 4 +- src/DOMAPI/HTMLSlotElement.js | 4 +- src/DOMAPI/HTMLSourceElement.js | 4 +- src/DOMAPI/HTMLSpanElement.js | 4 +- src/DOMAPI/HTMLStyleElement.js | 4 +- src/DOMAPI/HTMLTableCaptionElement.js | 4 +- src/DOMAPI/HTMLTableCellElement.js | 4 +- src/DOMAPI/HTMLTableElement.js | 4 +- src/DOMAPI/HTMLTableRowElement.js | 4 +- src/DOMAPI/HTMLTableSectionElement.js | 4 +- src/DOMAPI/HTMLTemplateElement.js | 4 +- src/DOMAPI/HTMLTextAreaElement.js | 4 +- src/DOMAPI/HTMLTimeElement.js | 4 +- src/DOMAPI/HTMLTitleElement.js | 4 +- src/DOMAPI/HTMLTrackElement.js | 4 +- src/DOMAPI/HTMLUListElement.js | 4 +- src/DOMAPI/HTMLVideoElement.js | 4 +- src/DOMAPI/MediaQueryList.js | 4 +- src/DOMAPI/Node.js | 6 +-- src/DOMAPI/SVGGraphicsElement.js | 4 +- src/DOMAPI/ScreenOrientation.js | 4 +- src/DOMAPI/ShadowRoot.js | 4 +- src/DOMAPI/Text.js | 4 +- src/DOMAPI/TextTrackList.js | 4 +- src/DOMAPI/Window.js | 4 +- .../MediaKeySession.js | 4 +- src/EventAPI/AbortSignal.js | 4 +- src/EventAPI/Event.js | 11 ++++- src/EventAPI/Event.res | 44 ++++++++++++------- src/IndexedDBAPI/IDBDatabase.js | 4 +- src/IndexedDBAPI/IDBTransaction.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaDevices.js | 4 +- src/MediaCaptureAndStreamsAPI/MediaStream.js | 4 +- .../MediaStreamTrack.js | 4 +- src/NotificationAPI/Notification.js | 4 +- src/PerformanceAPI/Performance.js | 4 +- src/RemotePlaybackAPI/RemotePlayback.js | 4 +- src/ScreenWakeLockAPI/WakeLockSentinel.js | 4 +- src/ServiceWorkerAPI/ServiceWorker.js | 4 +- .../ServiceWorkerContainer.js | 4 +- .../ServiceWorkerRegistration.js | 4 +- src/WebAudioAPI/AnalyserNode.js | 4 +- src/WebAudioAPI/AudioBufferSourceNode.js | 4 +- src/WebAudioAPI/AudioContext.js | 4 +- src/WebAudioAPI/AudioNode.js | 4 +- src/WebAudioAPI/AudioProcessingEvent.js | 7 ++- src/WebAudioAPI/AudioProcessingEvent.res | 34 ++------------ src/WebAudioAPI/AudioScheduledSourceNode.js | 6 +-- src/WebAudioAPI/AudioWorkletNode.js | 4 +- src/WebAudioAPI/BaseAudioContext.js | 4 +- src/WebAudioAPI/BiquadFilterNode.js | 4 +- src/WebAudioAPI/ChannelMergerNode.js | 4 +- src/WebAudioAPI/ChannelSplitterNode.js | 4 +- src/WebAudioAPI/ConstantSourceNode.js | 4 +- src/WebAudioAPI/ConvolverNode.js | 4 +- src/WebAudioAPI/DelayNode.js | 4 +- src/WebAudioAPI/DynamicsCompressorNode.js | 4 +- src/WebAudioAPI/GainNode.js | 4 +- src/WebAudioAPI/IIRFilterNode.js | 4 +- .../MediaElementAudioSourceNode.js | 4 +- .../MediaStreamAudioDestinationNode.js | 4 +- src/WebAudioAPI/MediaStreamAudioSourceNode.js | 4 +- .../OfflineAudioCompletionEvent.js | 7 ++- .../OfflineAudioCompletionEvent.res | 34 ++------------ src/WebAudioAPI/OfflineAudioContext.js | 4 +- src/WebAudioAPI/OscillatorNode.js | 4 +- src/WebAudioAPI/PannerNode.js | 4 +- src/WebAudioAPI/StereoPannerNode.js | 4 +- src/WebAudioAPI/WaveShaperNode.js | 4 +- src/WebSocketsAPI/CloseEvent.js | 7 ++- src/WebSocketsAPI/CloseEvent.res | 34 ++------------ src/WebSocketsAPI/WebSocket.js | 4 +- src/WebSpeechAPI/SpeechSynthesis.js | 4 +- src/WebSpeechAPI/SpeechSynthesisUtterance.js | 4 +- src/WebStorageAPI/StorageEvent.js | 7 ++- src/WebStorageAPI/StorageEvent.res | 34 ++------------ src/WebVTTAPI/TextTrack.js | 4 +- 134 files changed, 335 insertions(+), 398 deletions(-) diff --git a/src/CSSFontLoadingAPI/FontFaceSet.js b/src/CSSFontLoadingAPI/FontFaceSet.js index dbf8d92..977be07 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.js +++ b/src/CSSFontLoadingAPI/FontFaceSet.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.js b/src/CanvasAPI/OffscreenCanvas.js index dbf8d92..977be07 100644 --- a/src/CanvasAPI/OffscreenCanvas.js +++ b/src/CanvasAPI/OffscreenCanvas.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.js b/src/ChannelMessagingAPI/MessagePort.js index dbf8d92..977be07 100644 --- a/src/ChannelMessagingAPI/MessagePort.js +++ b/src/ChannelMessagingAPI/MessagePort.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.js b/src/ClipboardAPI/Clipboard.js index dbf8d92..977be07 100644 --- a/src/ClipboardAPI/Clipboard.js +++ b/src/ClipboardAPI/Clipboard.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Animation.js b/src/DOMAPI/Animation.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/Animation.js +++ b/src/DOMAPI/Animation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/CharacterData.js b/src/DOMAPI/CharacterData.js index d7d93d7..5c41d3b 100644 --- a/src/DOMAPI/CharacterData.js +++ b/src/DOMAPI/CharacterData.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$WebApi.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/Comment.js b/src/DOMAPI/Comment.js index 4670387..bcfb8d8 100644 --- a/src/DOMAPI/Comment.js +++ b/src/DOMAPI/Comment.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CharacterData$WebAPI from "./CharacterData.js"; +import * as CharacterData$WebApi from "./CharacterData.js"; -CharacterData$WebAPI.Impl({}); +CharacterData$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Document.js b/src/DOMAPI/Document.js index e6a3a30..2fbb7a8 100644 --- a/src/DOMAPI/Document.js +++ b/src/DOMAPI/Document.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/DocumentFragment.js b/src/DOMAPI/DocumentFragment.js index d7d93d7..5c41d3b 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/src/DOMAPI/DocumentFragment.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$WebApi.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/Element.js b/src/DOMAPI/Element.js index d7d93d7..5c41d3b 100644 --- a/src/DOMAPI/Element.js +++ b/src/DOMAPI/Element.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$WebApi from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$WebApi.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/FillStyle.js b/src/DOMAPI/FillStyle.js index d12dfc1..1e79cc4 100644 --- a/src/DOMAPI/FillStyle.js +++ b/src/DOMAPI/FillStyle.js @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebAPI from "../CanvasAPI/CanvasPattern.js"; -import * as CanvasGradient$WebAPI from "../CanvasAPI/CanvasGradient.js"; +import * as CanvasPattern$WebApi from "../CanvasAPI/CanvasPattern.js"; +import * as CanvasGradient$WebApi from "../CanvasAPI/CanvasGradient.js"; function decode(t) { - if (CanvasGradient$WebAPI.isInstanceOf(t)) { + if (CanvasGradient$WebApi.isInstanceOf(t)) { return { TAG: "CanvasGradient", _0: t }; - } else if (CanvasPattern$WebAPI.isInstanceOf(t)) { + } else if (CanvasPattern$WebApi.isInstanceOf(t)) { return { TAG: "CanvasPattern", _0: t diff --git a/src/DOMAPI/HTMLAnchorElement.js b/src/DOMAPI/HTMLAnchorElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLAnchorElement.js +++ b/src/DOMAPI/HTMLAnchorElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLAreaElement.js b/src/DOMAPI/HTMLAreaElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLAreaElement.js +++ b/src/DOMAPI/HTMLAreaElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLAudioElement.js b/src/DOMAPI/HTMLAudioElement.js index 7937791..bc5bb6d 100644 --- a/src/DOMAPI/HTMLAudioElement.js +++ b/src/DOMAPI/HTMLAudioElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLMediaElement$WebAPI from "./HTMLMediaElement.js"; +import * as HTMLMediaElement$WebApi from "./HTMLMediaElement.js"; -HTMLMediaElement$WebAPI.Impl({}); +HTMLMediaElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLBRElement.js b/src/DOMAPI/HTMLBRElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLBRElement.js +++ b/src/DOMAPI/HTMLBRElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLBaseElement.js b/src/DOMAPI/HTMLBaseElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLBaseElement.js +++ b/src/DOMAPI/HTMLBaseElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLBodyElement.js b/src/DOMAPI/HTMLBodyElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLBodyElement.js +++ b/src/DOMAPI/HTMLBodyElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLButtonElement.js b/src/DOMAPI/HTMLButtonElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLButtonElement.js +++ b/src/DOMAPI/HTMLButtonElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLCanvasElement.js b/src/DOMAPI/HTMLCanvasElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLCanvasElement.js +++ b/src/DOMAPI/HTMLCanvasElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDListElement.js b/src/DOMAPI/HTMLDListElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLDListElement.js +++ b/src/DOMAPI/HTMLDListElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDataElement.js b/src/DOMAPI/HTMLDataElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLDataElement.js +++ b/src/DOMAPI/HTMLDataElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDataListElement.js b/src/DOMAPI/HTMLDataListElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLDataListElement.js +++ b/src/DOMAPI/HTMLDataListElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDialogElement.js b/src/DOMAPI/HTMLDialogElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLDialogElement.js +++ b/src/DOMAPI/HTMLDialogElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLDivElement.js b/src/DOMAPI/HTMLDivElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLDivElement.js +++ b/src/DOMAPI/HTMLDivElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLElement.js b/src/DOMAPI/HTMLElement.js index 12e03b3..ccf9abf 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/src/DOMAPI/HTMLElement.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebAPI from "./Element.js"; +import * as Element$WebApi from "./Element.js"; function Impl(T) { - Element$WebAPI.Impl({}); + Element$WebApi.Impl({}); return {}; } -Element$WebAPI.Impl({}); +Element$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/HTMLEmbedElement.js b/src/DOMAPI/HTMLEmbedElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLEmbedElement.js +++ b/src/DOMAPI/HTMLEmbedElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLFieldSetElement.js b/src/DOMAPI/HTMLFieldSetElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLFieldSetElement.js +++ b/src/DOMAPI/HTMLFieldSetElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLFormElement.js b/src/DOMAPI/HTMLFormElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLFormElement.js +++ b/src/DOMAPI/HTMLFormElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLFrameSetElement.js b/src/DOMAPI/HTMLFrameSetElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLFrameSetElement.js +++ b/src/DOMAPI/HTMLFrameSetElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLHRElement.js b/src/DOMAPI/HTMLHRElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLHRElement.js +++ b/src/DOMAPI/HTMLHRElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLHeadElement.js b/src/DOMAPI/HTMLHeadElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLHeadElement.js +++ b/src/DOMAPI/HTMLHeadElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLHeadingElement.js b/src/DOMAPI/HTMLHeadingElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLHeadingElement.js +++ b/src/DOMAPI/HTMLHeadingElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLHtmlElement.js b/src/DOMAPI/HTMLHtmlElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLHtmlElement.js +++ b/src/DOMAPI/HTMLHtmlElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLIFrameElement.js b/src/DOMAPI/HTMLIFrameElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLIFrameElement.js +++ b/src/DOMAPI/HTMLIFrameElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLImageElement.js b/src/DOMAPI/HTMLImageElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLImageElement.js +++ b/src/DOMAPI/HTMLImageElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLInputElement.js b/src/DOMAPI/HTMLInputElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLInputElement.js +++ b/src/DOMAPI/HTMLInputElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLLIElement.js b/src/DOMAPI/HTMLLIElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLLIElement.js +++ b/src/DOMAPI/HTMLLIElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLLabelElement.js b/src/DOMAPI/HTMLLabelElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLLabelElement.js +++ b/src/DOMAPI/HTMLLabelElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLLegendElement.js b/src/DOMAPI/HTMLLegendElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLLegendElement.js +++ b/src/DOMAPI/HTMLLegendElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLLinkElement.js b/src/DOMAPI/HTMLLinkElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLLinkElement.js +++ b/src/DOMAPI/HTMLLinkElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMapElement.js b/src/DOMAPI/HTMLMapElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLMapElement.js +++ b/src/DOMAPI/HTMLMapElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMediaElement.js b/src/DOMAPI/HTMLMediaElement.js index 57eb26d..dbb5c97 100644 --- a/src/DOMAPI/HTMLMediaElement.js +++ b/src/DOMAPI/HTMLMediaElement.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; function Impl(T) { - HTMLElement$WebAPI.Impl({}); + HTMLElement$WebApi.Impl({}); return {}; } -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/HTMLMenuElement.js b/src/DOMAPI/HTMLMenuElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLMenuElement.js +++ b/src/DOMAPI/HTMLMenuElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMetaElement.js b/src/DOMAPI/HTMLMetaElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLMetaElement.js +++ b/src/DOMAPI/HTMLMetaElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLMeterElement.js b/src/DOMAPI/HTMLMeterElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLMeterElement.js +++ b/src/DOMAPI/HTMLMeterElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLModElement.js b/src/DOMAPI/HTMLModElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLModElement.js +++ b/src/DOMAPI/HTMLModElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLOListElement.js b/src/DOMAPI/HTMLOListElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLOListElement.js +++ b/src/DOMAPI/HTMLOListElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLObjectElement.js b/src/DOMAPI/HTMLObjectElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLObjectElement.js +++ b/src/DOMAPI/HTMLObjectElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLOptGroupElement.js b/src/DOMAPI/HTMLOptGroupElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLOptGroupElement.js +++ b/src/DOMAPI/HTMLOptGroupElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLOptionElement.js b/src/DOMAPI/HTMLOptionElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLOptionElement.js +++ b/src/DOMAPI/HTMLOptionElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLOutputElement.js b/src/DOMAPI/HTMLOutputElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLOutputElement.js +++ b/src/DOMAPI/HTMLOutputElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLParagraphElement.js b/src/DOMAPI/HTMLParagraphElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLParagraphElement.js +++ b/src/DOMAPI/HTMLParagraphElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLPictureElement.js b/src/DOMAPI/HTMLPictureElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLPictureElement.js +++ b/src/DOMAPI/HTMLPictureElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLPreElement.js b/src/DOMAPI/HTMLPreElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLPreElement.js +++ b/src/DOMAPI/HTMLPreElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLProgressElement.js b/src/DOMAPI/HTMLProgressElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLProgressElement.js +++ b/src/DOMAPI/HTMLProgressElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLQuoteElement.js b/src/DOMAPI/HTMLQuoteElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLQuoteElement.js +++ b/src/DOMAPI/HTMLQuoteElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLScriptElement.js b/src/DOMAPI/HTMLScriptElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLScriptElement.js +++ b/src/DOMAPI/HTMLScriptElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLSelectElement.js b/src/DOMAPI/HTMLSelectElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLSelectElement.js +++ b/src/DOMAPI/HTMLSelectElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLSlotElement.js b/src/DOMAPI/HTMLSlotElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLSlotElement.js +++ b/src/DOMAPI/HTMLSlotElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLSourceElement.js b/src/DOMAPI/HTMLSourceElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLSourceElement.js +++ b/src/DOMAPI/HTMLSourceElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLSpanElement.js b/src/DOMAPI/HTMLSpanElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLSpanElement.js +++ b/src/DOMAPI/HTMLSpanElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLStyleElement.js b/src/DOMAPI/HTMLStyleElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLStyleElement.js +++ b/src/DOMAPI/HTMLStyleElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableCaptionElement.js b/src/DOMAPI/HTMLTableCaptionElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTableCaptionElement.js +++ b/src/DOMAPI/HTMLTableCaptionElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableCellElement.js b/src/DOMAPI/HTMLTableCellElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTableCellElement.js +++ b/src/DOMAPI/HTMLTableCellElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableElement.js b/src/DOMAPI/HTMLTableElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTableElement.js +++ b/src/DOMAPI/HTMLTableElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableRowElement.js b/src/DOMAPI/HTMLTableRowElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTableRowElement.js +++ b/src/DOMAPI/HTMLTableRowElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableSectionElement.js b/src/DOMAPI/HTMLTableSectionElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTableSectionElement.js +++ b/src/DOMAPI/HTMLTableSectionElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTemplateElement.js b/src/DOMAPI/HTMLTemplateElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTemplateElement.js +++ b/src/DOMAPI/HTMLTemplateElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTextAreaElement.js b/src/DOMAPI/HTMLTextAreaElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTextAreaElement.js +++ b/src/DOMAPI/HTMLTextAreaElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTimeElement.js b/src/DOMAPI/HTMLTimeElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTimeElement.js +++ b/src/DOMAPI/HTMLTimeElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTitleElement.js b/src/DOMAPI/HTMLTitleElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTitleElement.js +++ b/src/DOMAPI/HTMLTitleElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLTrackElement.js b/src/DOMAPI/HTMLTrackElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLTrackElement.js +++ b/src/DOMAPI/HTMLTrackElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLUListElement.js b/src/DOMAPI/HTMLUListElement.js index 1541b40..816311b 100644 --- a/src/DOMAPI/HTMLUListElement.js +++ b/src/DOMAPI/HTMLUListElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLElement$WebAPI from "./HTMLElement.js"; +import * as HTMLElement$WebApi from "./HTMLElement.js"; -HTMLElement$WebAPI.Impl({}); +HTMLElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/HTMLVideoElement.js b/src/DOMAPI/HTMLVideoElement.js index 7937791..bc5bb6d 100644 --- a/src/DOMAPI/HTMLVideoElement.js +++ b/src/DOMAPI/HTMLVideoElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as HTMLMediaElement$WebAPI from "./HTMLMediaElement.js"; +import * as HTMLMediaElement$WebApi from "./HTMLMediaElement.js"; -HTMLMediaElement$WebAPI.Impl({}); +HTMLMediaElement$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/MediaQueryList.js b/src/DOMAPI/MediaQueryList.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/MediaQueryList.js +++ b/src/DOMAPI/MediaQueryList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Node.js b/src/DOMAPI/Node.js index d309b02..0fd239b 100644 --- a/src/DOMAPI/Node.js +++ b/src/DOMAPI/Node.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebAPI.Impl({}); + EventTarget$WebApi.Impl({}); return {}; } -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); export { Impl, diff --git a/src/DOMAPI/SVGGraphicsElement.js b/src/DOMAPI/SVGGraphicsElement.js index c4f0687..25c778a 100644 --- a/src/DOMAPI/SVGGraphicsElement.js +++ b/src/DOMAPI/SVGGraphicsElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebAPI from "./Element.js"; +import * as Element$WebApi from "./Element.js"; -Element$WebAPI.Impl({}); +Element$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/ScreenOrientation.js b/src/DOMAPI/ScreenOrientation.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/ScreenOrientation.js +++ b/src/DOMAPI/ScreenOrientation.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/ShadowRoot.js b/src/DOMAPI/ShadowRoot.js index 360355a..e655826 100644 --- a/src/DOMAPI/ShadowRoot.js +++ b/src/DOMAPI/ShadowRoot.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as DocumentFragment$WebAPI from "./DocumentFragment.js"; +import * as DocumentFragment$WebApi from "./DocumentFragment.js"; -DocumentFragment$WebAPI.Impl({}); +DocumentFragment$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Text.js b/src/DOMAPI/Text.js index 4670387..bcfb8d8 100644 --- a/src/DOMAPI/Text.js +++ b/src/DOMAPI/Text.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CharacterData$WebAPI from "./CharacterData.js"; +import * as CharacterData$WebApi from "./CharacterData.js"; -CharacterData$WebAPI.Impl({}); +CharacterData$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/TextTrackList.js b/src/DOMAPI/TextTrackList.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/TextTrackList.js +++ b/src/DOMAPI/TextTrackList.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/DOMAPI/Window.js b/src/DOMAPI/Window.js index dbf8d92..977be07 100644 --- a/src/DOMAPI/Window.js +++ b/src/DOMAPI/Window.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js index dbf8d92..977be07 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeySession.js +++ b/src/EncryptedMediaExtensionsAPI/MediaKeySession.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/EventAPI/AbortSignal.js b/src/EventAPI/AbortSignal.js index b228e27..e8afbf4 100644 --- a/src/EventAPI/AbortSignal.js +++ b/src/EventAPI/AbortSignal.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "./EventTarget.js"; +import * as EventTarget$WebApi from "./EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/EventAPI/Event.js b/src/EventAPI/Event.js index d856702..3af64bd 100644 --- a/src/EventAPI/Event.js +++ b/src/EventAPI/Event.js @@ -1,2 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + + +function Impl(T) { + return {}; +} + +export { + Impl, +} +/* No side effect */ diff --git a/src/EventAPI/Event.res b/src/EventAPI/Event.res index 1a3fd07..288aec3 100644 --- a/src/EventAPI/Event.res +++ b/src/EventAPI/Event.res @@ -6,30 +6,42 @@ open EventAPI @new external make: (~type_: string, ~eventInitDict: eventInit=?) => event = "Event" -/** +module Impl = ( + T: { + type t + }, +) => { + external asEvent: T.t => event = "%identity" + + /** Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath) */ -@send -external composedPath: event => array = "composedPath" + @send + external composedPath: T.t => array = "composedPath" -/** -When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) + /** +If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) */ -@send -external stopPropagation: event => unit = "stopPropagation" + @send + external preventDefault: T.t => unit = "preventDefault" -/** + /** Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) */ -@send -external stopImmediatePropagation: event => unit = "stopImmediatePropagation" + @send + external stopImmediatePropagation: T.t => unit = "stopImmediatePropagation" -/** -If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) + /** +When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) */ -@send -external preventDefault: event => unit = "preventDefault" + @send + external stopPropagation: T.t => unit = "stopPropagation" +} + +include Impl({ + type t = event +}) diff --git a/src/IndexedDBAPI/IDBDatabase.js b/src/IndexedDBAPI/IDBDatabase.js index dbf8d92..977be07 100644 --- a/src/IndexedDBAPI/IDBDatabase.js +++ b/src/IndexedDBAPI/IDBDatabase.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/IndexedDBAPI/IDBTransaction.js b/src/IndexedDBAPI/IDBTransaction.js index dbf8d92..977be07 100644 --- a/src/IndexedDBAPI/IDBTransaction.js +++ b/src/IndexedDBAPI/IDBTransaction.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaDevices.js b/src/MediaCaptureAndStreamsAPI/MediaDevices.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaDevices.js +++ b/src/MediaCaptureAndStreamsAPI/MediaDevices.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStream.js b/src/MediaCaptureAndStreamsAPI/MediaStream.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStream.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStream.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js index dbf8d92..977be07 100644 --- a/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js +++ b/src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/NotificationAPI/Notification.js b/src/NotificationAPI/Notification.js index dbf8d92..977be07 100644 --- a/src/NotificationAPI/Notification.js +++ b/src/NotificationAPI/Notification.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/PerformanceAPI/Performance.js b/src/PerformanceAPI/Performance.js index dbf8d92..977be07 100644 --- a/src/PerformanceAPI/Performance.js +++ b/src/PerformanceAPI/Performance.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/RemotePlaybackAPI/RemotePlayback.js b/src/RemotePlaybackAPI/RemotePlayback.js index dbf8d92..977be07 100644 --- a/src/RemotePlaybackAPI/RemotePlayback.js +++ b/src/RemotePlaybackAPI/RemotePlayback.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ScreenWakeLockAPI/WakeLockSentinel.js b/src/ScreenWakeLockAPI/WakeLockSentinel.js index dbf8d92..977be07 100644 --- a/src/ScreenWakeLockAPI/WakeLockSentinel.js +++ b/src/ScreenWakeLockAPI/WakeLockSentinel.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorker.js b/src/ServiceWorkerAPI/ServiceWorker.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorker.js +++ b/src/ServiceWorkerAPI/ServiceWorker.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerContainer.js b/src/ServiceWorkerAPI/ServiceWorkerContainer.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerContainer.js +++ b/src/ServiceWorkerAPI/ServiceWorkerContainer.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js index dbf8d92..977be07 100644 --- a/src/ServiceWorkerAPI/ServiceWorkerRegistration.js +++ b/src/ServiceWorkerAPI/ServiceWorkerRegistration.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AnalyserNode.js b/src/WebAudioAPI/AnalyserNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/AnalyserNode.js +++ b/src/WebAudioAPI/AnalyserNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioBufferSourceNode.js b/src/WebAudioAPI/AudioBufferSourceNode.js index 253d12c..8bd4ed5 100644 --- a/src/WebAudioAPI/AudioBufferSourceNode.js +++ b/src/WebAudioAPI/AudioBufferSourceNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; +import * as AudioScheduledSourceNode$WebApi from "./AudioScheduledSourceNode.js"; -AudioScheduledSourceNode$WebAPI.Impl({}); +AudioScheduledSourceNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioContext.js b/src/WebAudioAPI/AudioContext.js index 9c85ca7..9d0d74d 100644 --- a/src/WebAudioAPI/AudioContext.js +++ b/src/WebAudioAPI/AudioContext.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as BaseAudioContext$WebAPI from "./BaseAudioContext.js"; +import * as BaseAudioContext$WebApi from "./BaseAudioContext.js"; -BaseAudioContext$WebAPI.Impl({}); +BaseAudioContext$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/AudioNode.js b/src/WebAudioAPI/AudioNode.js index 41ad089..0500a81 100644 --- a/src/WebAudioAPI/AudioNode.js +++ b/src/WebAudioAPI/AudioNode.js @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebAPI.Impl({}); + EventTarget$WebApi.Impl({}); return {}; } diff --git a/src/WebAudioAPI/AudioProcessingEvent.js b/src/WebAudioAPI/AudioProcessingEvent.js index d856702..efa8e09 100644 --- a/src/WebAudioAPI/AudioProcessingEvent.js +++ b/src/WebAudioAPI/AudioProcessingEvent.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Event$WebApi from "../EventAPI/Event.js"; + +Event$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/AudioProcessingEvent.res b/src/WebAudioAPI/AudioProcessingEvent.res index 7d1e17f..96951e5 100644 --- a/src/WebAudioAPI/AudioProcessingEvent.res +++ b/src/WebAudioAPI/AudioProcessingEvent.res @@ -1,38 +1,12 @@ -open EventAPI open WebAudioAPI +include Event.Impl({ + type t = audioProcessingEvent +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent) */ @new external make: (~type_: string, ~eventInitDict: audioProcessingEventInit) => audioProcessingEvent = "AudioProcessingEvent" - -external asEvent: audioProcessingEvent => event = "%identity" -/** -Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath) -*/ -@send -external composedPath: audioProcessingEvent => array = "composedPath" - -/** -When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) -*/ -@send -external stopPropagation: audioProcessingEvent => unit = "stopPropagation" - -/** -Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) -*/ -@send -external stopImmediatePropagation: audioProcessingEvent => unit = "stopImmediatePropagation" - -/** -If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) -*/ -@send -external preventDefault: audioProcessingEvent => unit = "preventDefault" diff --git a/src/WebAudioAPI/AudioScheduledSourceNode.js b/src/WebAudioAPI/AudioScheduledSourceNode.js index 9427c21..f1ed040 100644 --- a/src/WebAudioAPI/AudioScheduledSourceNode.js +++ b/src/WebAudioAPI/AudioScheduledSourceNode.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; function Impl(T) { - AudioNode$WebAPI.Impl({}); + AudioNode$WebApi.Impl({}); return {}; } -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); export { Impl, diff --git a/src/WebAudioAPI/AudioWorkletNode.js b/src/WebAudioAPI/AudioWorkletNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/AudioWorkletNode.js +++ b/src/WebAudioAPI/AudioWorkletNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/BaseAudioContext.js b/src/WebAudioAPI/BaseAudioContext.js index 41ad089..0500a81 100644 --- a/src/WebAudioAPI/BaseAudioContext.js +++ b/src/WebAudioAPI/BaseAudioContext.js @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; function Impl(T) { - EventTarget$WebAPI.Impl({}); + EventTarget$WebApi.Impl({}); return {}; } diff --git a/src/WebAudioAPI/BiquadFilterNode.js b/src/WebAudioAPI/BiquadFilterNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/BiquadFilterNode.js +++ b/src/WebAudioAPI/BiquadFilterNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/ChannelMergerNode.js b/src/WebAudioAPI/ChannelMergerNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/ChannelMergerNode.js +++ b/src/WebAudioAPI/ChannelMergerNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/ChannelSplitterNode.js b/src/WebAudioAPI/ChannelSplitterNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/ChannelSplitterNode.js +++ b/src/WebAudioAPI/ChannelSplitterNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/ConstantSourceNode.js b/src/WebAudioAPI/ConstantSourceNode.js index 253d12c..8bd4ed5 100644 --- a/src/WebAudioAPI/ConstantSourceNode.js +++ b/src/WebAudioAPI/ConstantSourceNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; +import * as AudioScheduledSourceNode$WebApi from "./AudioScheduledSourceNode.js"; -AudioScheduledSourceNode$WebAPI.Impl({}); +AudioScheduledSourceNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/ConvolverNode.js b/src/WebAudioAPI/ConvolverNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/ConvolverNode.js +++ b/src/WebAudioAPI/ConvolverNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/DelayNode.js b/src/WebAudioAPI/DelayNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/DelayNode.js +++ b/src/WebAudioAPI/DelayNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/DynamicsCompressorNode.js b/src/WebAudioAPI/DynamicsCompressorNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/DynamicsCompressorNode.js +++ b/src/WebAudioAPI/DynamicsCompressorNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/GainNode.js b/src/WebAudioAPI/GainNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/GainNode.js +++ b/src/WebAudioAPI/GainNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/IIRFilterNode.js b/src/WebAudioAPI/IIRFilterNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/IIRFilterNode.js +++ b/src/WebAudioAPI/IIRFilterNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/MediaElementAudioSourceNode.js b/src/WebAudioAPI/MediaElementAudioSourceNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/MediaElementAudioSourceNode.js +++ b/src/WebAudioAPI/MediaElementAudioSourceNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/MediaStreamAudioDestinationNode.js b/src/WebAudioAPI/MediaStreamAudioDestinationNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/MediaStreamAudioDestinationNode.js +++ b/src/WebAudioAPI/MediaStreamAudioDestinationNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/MediaStreamAudioSourceNode.js b/src/WebAudioAPI/MediaStreamAudioSourceNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/MediaStreamAudioSourceNode.js +++ b/src/WebAudioAPI/MediaStreamAudioSourceNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/OfflineAudioCompletionEvent.js b/src/WebAudioAPI/OfflineAudioCompletionEvent.js index d856702..efa8e09 100644 --- a/src/WebAudioAPI/OfflineAudioCompletionEvent.js +++ b/src/WebAudioAPI/OfflineAudioCompletionEvent.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Event$WebApi from "../EventAPI/Event.js"; + +Event$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebAudioAPI/OfflineAudioCompletionEvent.res b/src/WebAudioAPI/OfflineAudioCompletionEvent.res index 3c98608..c9f6479 100644 --- a/src/WebAudioAPI/OfflineAudioCompletionEvent.res +++ b/src/WebAudioAPI/OfflineAudioCompletionEvent.res @@ -1,6 +1,9 @@ -open EventAPI open WebAudioAPI +include Event.Impl({ + type t = offlineAudioCompletionEvent +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioCompletionEvent) */ @@ -9,32 +12,3 @@ external make: ( ~type_: string, ~eventInitDict: offlineAudioCompletionEventInit, ) => offlineAudioCompletionEvent = "OfflineAudioCompletionEvent" - -external asEvent: offlineAudioCompletionEvent => event = "%identity" -/** -Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath) -*/ -@send -external composedPath: offlineAudioCompletionEvent => array = "composedPath" - -/** -When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) -*/ -@send -external stopPropagation: offlineAudioCompletionEvent => unit = "stopPropagation" - -/** -Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) -*/ -@send -external stopImmediatePropagation: offlineAudioCompletionEvent => unit = "stopImmediatePropagation" - -/** -If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) -*/ -@send -external preventDefault: offlineAudioCompletionEvent => unit = "preventDefault" diff --git a/src/WebAudioAPI/OfflineAudioContext.js b/src/WebAudioAPI/OfflineAudioContext.js index 9c85ca7..9d0d74d 100644 --- a/src/WebAudioAPI/OfflineAudioContext.js +++ b/src/WebAudioAPI/OfflineAudioContext.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as BaseAudioContext$WebAPI from "./BaseAudioContext.js"; +import * as BaseAudioContext$WebApi from "./BaseAudioContext.js"; -BaseAudioContext$WebAPI.Impl({}); +BaseAudioContext$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/OscillatorNode.js b/src/WebAudioAPI/OscillatorNode.js index 253d12c..8bd4ed5 100644 --- a/src/WebAudioAPI/OscillatorNode.js +++ b/src/WebAudioAPI/OscillatorNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioScheduledSourceNode$WebAPI from "./AudioScheduledSourceNode.js"; +import * as AudioScheduledSourceNode$WebApi from "./AudioScheduledSourceNode.js"; -AudioScheduledSourceNode$WebAPI.Impl({}); +AudioScheduledSourceNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/PannerNode.js b/src/WebAudioAPI/PannerNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/PannerNode.js +++ b/src/WebAudioAPI/PannerNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/StereoPannerNode.js b/src/WebAudioAPI/StereoPannerNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/StereoPannerNode.js +++ b/src/WebAudioAPI/StereoPannerNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebAudioAPI/WaveShaperNode.js b/src/WebAudioAPI/WaveShaperNode.js index 22c59b6..51b85fe 100644 --- a/src/WebAudioAPI/WaveShaperNode.js +++ b/src/WebAudioAPI/WaveShaperNode.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as AudioNode$WebAPI from "./AudioNode.js"; +import * as AudioNode$WebApi from "./AudioNode.js"; -AudioNode$WebAPI.Impl({}); +AudioNode$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebSocketsAPI/CloseEvent.js b/src/WebSocketsAPI/CloseEvent.js index d856702..efa8e09 100644 --- a/src/WebSocketsAPI/CloseEvent.js +++ b/src/WebSocketsAPI/CloseEvent.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Event$WebApi from "../EventAPI/Event.js"; + +Event$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebSocketsAPI/CloseEvent.res b/src/WebSocketsAPI/CloseEvent.res index 78df9cb..e5ba376 100644 --- a/src/WebSocketsAPI/CloseEvent.res +++ b/src/WebSocketsAPI/CloseEvent.res @@ -1,37 +1,11 @@ -open EventAPI open WebSocketsAPI +include Event.Impl({ + type t = closeEvent +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CloseEvent) */ @new external make: (~type_: string, ~eventInitDict: closeEventInit=?) => closeEvent = "CloseEvent" - -external asEvent: closeEvent => event = "%identity" -/** -Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath) -*/ -@send -external composedPath: closeEvent => array = "composedPath" - -/** -When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) -*/ -@send -external stopPropagation: closeEvent => unit = "stopPropagation" - -/** -Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) -*/ -@send -external stopImmediatePropagation: closeEvent => unit = "stopImmediatePropagation" - -/** -If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) -*/ -@send -external preventDefault: closeEvent => unit = "preventDefault" diff --git a/src/WebSocketsAPI/WebSocket.js b/src/WebSocketsAPI/WebSocket.js index dbf8d92..977be07 100644 --- a/src/WebSocketsAPI/WebSocket.js +++ b/src/WebSocketsAPI/WebSocket.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesis.js b/src/WebSpeechAPI/SpeechSynthesis.js index dbf8d92..977be07 100644 --- a/src/WebSpeechAPI/SpeechSynthesis.js +++ b/src/WebSpeechAPI/SpeechSynthesis.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebSpeechAPI/SpeechSynthesisUtterance.js b/src/WebSpeechAPI/SpeechSynthesisUtterance.js index dbf8d92..977be07 100644 --- a/src/WebSpeechAPI/SpeechSynthesisUtterance.js +++ b/src/WebSpeechAPI/SpeechSynthesisUtterance.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ diff --git a/src/WebStorageAPI/StorageEvent.js b/src/WebStorageAPI/StorageEvent.js index d856702..efa8e09 100644 --- a/src/WebStorageAPI/StorageEvent.js +++ b/src/WebStorageAPI/StorageEvent.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Event$WebApi from "../EventAPI/Event.js"; + +Event$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/WebStorageAPI/StorageEvent.res b/src/WebStorageAPI/StorageEvent.res index 8c697ed..dfa348a 100644 --- a/src/WebStorageAPI/StorageEvent.res +++ b/src/WebStorageAPI/StorageEvent.res @@ -1,37 +1,11 @@ -open EventAPI open WebStorageAPI +include Event.Impl({ + type t = storageEvent +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StorageEvent) */ @new external make: (~type_: string, ~eventInitDict: storageEventInit=?) => storageEvent = "StorageEvent" - -external asEvent: storageEvent => event = "%identity" -/** -Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath) -*/ -@send -external composedPath: storageEvent => array = "composedPath" - -/** -When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) -*/ -@send -external stopPropagation: storageEvent => unit = "stopPropagation" - -/** -Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) -*/ -@send -external stopImmediatePropagation: storageEvent => unit = "stopImmediatePropagation" - -/** -If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) -*/ -@send -external preventDefault: storageEvent => unit = "preventDefault" diff --git a/src/WebVTTAPI/TextTrack.js b/src/WebVTTAPI/TextTrack.js index dbf8d92..977be07 100644 --- a/src/WebVTTAPI/TextTrack.js +++ b/src/WebVTTAPI/TextTrack.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as EventTarget$WebAPI from "../EventAPI/EventTarget.js"; +import * as EventTarget$WebApi from "../EventAPI/EventTarget.js"; -EventTarget$WebAPI.Impl({}); +EventTarget$WebApi.Impl({}); /* Not a pure module */ From 58b539047f03666cd32d8ef78ac654a701868617 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 15:29:27 +0100 Subject: [PATCH 12/13] Extract Blob --- src/FileAPI/Blob.js | 11 ++++++++++- src/FileAPI/Blob.res | 41 ++++++++++++++++++++++++++--------------- src/FileAPI/File.js | 7 ++++++- src/FileAPI/File.res | 35 ++++------------------------------- 4 files changed, 46 insertions(+), 48 deletions(-) diff --git a/src/FileAPI/Blob.js b/src/FileAPI/Blob.js index d856702..3af64bd 100644 --- a/src/FileAPI/Blob.js +++ b/src/FileAPI/Blob.js @@ -1,2 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + + +function Impl(T) { + return {}; +} + +export { + Impl, +} +/* No side effect */ diff --git a/src/FileAPI/Blob.res b/src/FileAPI/Blob.res index 7138cb2..ced64e5 100644 --- a/src/FileAPI/Blob.res +++ b/src/FileAPI/Blob.res @@ -6,32 +6,43 @@ open FileAPI @new external make: (~blobParts: array=?, ~options: blobPropertyBag=?) => blob = "Blob" -/** +module Impl = ( + T: { + type t + }, +) => { + external asBlob: T.t => blob = "%identity" + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/slice) */ -@send -external slice: (blob, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice" + @send + external slice: (T.t, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/stream) */ -@send -external stream: blob => readableStream> = "stream" + @send + external stream: T.t => readableStream> = "stream" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/text) */ -@send -external text: blob => Promise.t = "text" + @send + external text: T.t => Promise.t = "text" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */ -@send -external arrayBuffer: blob => Promise.t = "arrayBuffer" + @send + external arrayBuffer: T.t => Promise.t = "arrayBuffer" -/** + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */ -@send -external bytes: blob => Promise.t> = "bytes" + @send + external bytes: T.t => Promise.t> = "bytes" +} + +include Impl({ + type t = blob +}) diff --git a/src/FileAPI/File.js b/src/FileAPI/File.js index d856702..d009e8b 100644 --- a/src/FileAPI/File.js +++ b/src/FileAPI/File.js @@ -1,2 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + +import * as Blob$WebApi from "./Blob.js"; + +Blob$WebApi.Impl({}); + +/* Not a pure module */ diff --git a/src/FileAPI/File.res b/src/FileAPI/File.res index 4b3c83e..55777f6 100644 --- a/src/FileAPI/File.res +++ b/src/FileAPI/File.res @@ -1,5 +1,9 @@ open FileAPI +include Blob.Impl({ + type t = file +}) + /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/File) */ @@ -9,34 +13,3 @@ external make: ( ~fileName: string, ~options: filePropertyBag=?, ) => file = "File" - -external asBlob: file => blob = "%identity" -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/slice) -*/ -@send -external slice: (file, ~start: int=?, ~end: int=?, ~contentType: string=?) => blob = "slice" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/stream) -*/ -@send -external stream: file => readableStream> = "stream" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/text) -*/ -@send -external text: file => Promise.t = "text" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) -*/ -@send -external arrayBuffer: file => Promise.t = "arrayBuffer" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Blob/bytes) -*/ -@send -external bytes: file => Promise.t> = "bytes" From 55e32d68bc4184562c3942422278922760e0414e Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 19 Nov 2024 17:50:20 +0100 Subject: [PATCH 13/13] Add Module Type Structure --- .../docs/contributing/api-modelling.mdx | 2 +- ...structure.mdx => api-module-structure.mdx} | 6 +- .../docs/contributing/code-generation.mdx | 2 +- .../docs/contributing/documentation.mdx | 2 +- .../contributing/module-type-structure.mdx | 86 +++++++++++++++++++ docs/content/docs/contributing/testing.mdx | 2 +- 6 files changed, 93 insertions(+), 7 deletions(-) rename docs/content/docs/contributing/{module-structure.mdx => api-module-structure.mdx} (94%) create mode 100644 docs/content/docs/contributing/module-type-structure.mdx diff --git a/docs/content/docs/contributing/api-modelling.mdx b/docs/content/docs/contributing/api-modelling.mdx index 7b8fe79..4b70ade 100644 --- a/docs/content/docs/contributing/api-modelling.mdx +++ b/docs/content/docs/contributing/api-modelling.mdx @@ -1,7 +1,7 @@ --- title: API Modelling description: Learn more about the API modelling process of @rescript/webapi. -slug: "04-api-modelling" +slug: "05-api-modelling" --- import { Aside, Code, Icon } from "@astrojs/starlight/components"; diff --git a/docs/content/docs/contributing/module-structure.mdx b/docs/content/docs/contributing/api-module-structure.mdx similarity index 94% rename from docs/content/docs/contributing/module-structure.mdx rename to docs/content/docs/contributing/api-module-structure.mdx index e7bdcfa..d872494 100644 --- a/docs/content/docs/contributing/module-structure.mdx +++ b/docs/content/docs/contributing/api-module-structure.mdx @@ -1,7 +1,7 @@ --- -title: Module Structure -description: Learn more about the module structure of @rescript/webapi. -slug: "02-module-structure" +title: API Module Structure +description: Learn more about the API module structure of @rescript/webapi. +slug: "02-api-module-structure" --- import { Aside } from "@astrojs/starlight/components"; diff --git a/docs/content/docs/contributing/code-generation.mdx b/docs/content/docs/contributing/code-generation.mdx index 37ead83..952e0ca 100644 --- a/docs/content/docs/contributing/code-generation.mdx +++ b/docs/content/docs/contributing/code-generation.mdx @@ -1,7 +1,7 @@ --- title: Code Generation description: Learn more about the code generation process for @rescript/webapi. -slug: "03-code-generation" +slug: "04-code-generation" --- The original bindings were generated using a modified version of [TypeScript-DOM-lib-generator](https://github.com/microsoft/TypeScript-DOM-lib-generator). diff --git a/docs/content/docs/contributing/documentation.mdx b/docs/content/docs/contributing/documentation.mdx index 5f27194..e4a5986 100644 --- a/docs/content/docs/contributing/documentation.mdx +++ b/docs/content/docs/contributing/documentation.mdx @@ -1,7 +1,7 @@ --- title: "Documentation" description: Learn more about the relevance of adding documentation to @rescript/webapi. -slug: "06-documentation" +slug: "07-documentation" --- After the bindings are generated, all you got was a link to the MDN documentation. diff --git a/docs/content/docs/contributing/module-type-structure.mdx b/docs/content/docs/contributing/module-type-structure.mdx new file mode 100644 index 0000000..904696d --- /dev/null +++ b/docs/content/docs/contributing/module-type-structure.mdx @@ -0,0 +1,86 @@ +--- +title: Module Type Structure +description: Learn more about the module structure of @rescript/webapi. +slug: "03-module-type-structure" +--- + +import { Aside, FileTree, Code } from "@astrojs/starlight/components"; + +Every interface in a Web API module can potentially contain methods. These methods are modeled in a separate module named after the interface. + +The primary reason for this separation is to handle method overloads. +As explained in the [Design Philosophy](../design-philosophy) section, ReScript does not permit records to define the same properties more than once. +Therefore, methods with overloads cannot be modeled within the same record type. + +## Bindings + +Another advantage of having a separate file is that these bindings can utilize all types defined in the API module. +Under normal circumstances, the type module only contains `@send` bindings where the type is the first parameter. + + + +- DOMAPI + - HTMLButtonElement.res + + + +```ReScript +/** +Returns whether a form will validate when it is submitted, without having to submit it. +[Read more on MDN]( + https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/checkValidity) +*/ +@send +external checkValidity: htmlButtonElement => bool = "checkValidity" +``` + +## Inheritance + +When an interface inherits from another interface, the base interface methods can be [included](https://rescript-lang.org/syntax-lookup#include) into the inheriting interface. +All methods from [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement#instance_methods) should also be available on [HTMLButtonElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement#instance_methods). + +export const htmlElementModule = ` +open DOMAPI + +// A concrete type for \`T.t\` is passed later using the \`include\` keyword. +module Impl = (T: { type t }) => { + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) +*/ +@send +external focus: (T.t, ~options: focusOptions=?) => unit = "focus" + +} + +include Impl({ type t = htmlElement }) +`; + + + +export const buttonModule = ` +open DOMAPI + +// Include all the methods from HTMLElement +include HTMLElement.Impl({ type t = htmlButtonElement }) + +// Add additional methods specific to HTMLButtonElement: + +/** +Returns whether a form will validate when it is submitted, without having to submit it. +[Read more on MDN]( + https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/checkValidity) +*/ +@send +external checkValidity: htmlButtonElement => bool = "checkValidity" +`; + + diff --git a/docs/content/docs/contributing/testing.mdx b/docs/content/docs/contributing/testing.mdx index 97e9cb6..d5c61a2 100644 --- a/docs/content/docs/contributing/testing.mdx +++ b/docs/content/docs/contributing/testing.mdx @@ -1,7 +1,7 @@ --- title: Testing description: Learn more about testing the bindings for @rescript/webapi. -slug: "05-testing" +slug: "06-testing" --- import { Aside, FileTree } from "@astrojs/starlight/components";