Skip to content

Add URL API #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/CSSFontLoadingAPI.res
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ type rec fontFace = {
/**
[See FontFaceSet on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet)
*/
@editor.completeFrom(FontFace)
@editor.completeFrom(FontFaceSet)
type rec fontFaceSet = {
...eventTarget,
Expand Down
4 changes: 1 addition & 3 deletions src/CSSFontLoadingAPI/FontFaceSet.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open CSSFontLoadingAPI

include EventTarget.Impl({
type t = fontFaceSet
})
include EventTarget.Impl({type t = fontFaceSet})

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/add)
Expand Down
4 changes: 1 addition & 3 deletions src/CanvasAPI/OffscreenCanvas.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ open FileAPI
@new
external make: (~width: int, ~height: int) => offscreenCanvas = "OffscreenCanvas"

include EventTarget.Impl({
type t = offscreenCanvas
})
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.
Expand Down
4 changes: 1 addition & 3 deletions src/ChannelMessagingAPI/MessagePort.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open ChannelMessagingAPI

include EventTarget.Impl({
type t = messagePort
})
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.
Expand Down
4 changes: 1 addition & 3 deletions src/ClipboardAPI/Clipboard.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open ClipboardAPI

include EventTarget.Impl({
type t = clipboard
})
include EventTarget.Impl({type t = clipboard})

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read)
Expand Down
105 changes: 35 additions & 70 deletions src/DOMAPI.res

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/DOMAPI/Animation.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ open DOMAPI
external make: (~effect: animationEffect=?, ~timeline: animationTimeline=?) => animation =
"Animation"

include EventTarget.Impl({
type t = animation
})
include EventTarget.Impl({type t = animation})

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/cancel)
Expand Down
8 changes: 2 additions & 6 deletions src/DOMAPI/CharacterData.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module Impl = (
type t
},
) => {
include Node.Impl({
type t = T.t
})
include Node.Impl({type t = T.t})

external asCharacterData: T.t => characterData = "%identity"

Expand Down Expand Up @@ -103,6 +101,4 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData"
}

include Impl({
type t = characterData
})
include Impl({type t = characterData})
4 changes: 1 addition & 3 deletions src/DOMAPI/Comment.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include CharacterData.Impl({
type t = comment
})
include CharacterData.Impl({type t = comment})

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Comment)
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/Document.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ open ViewTransitionsAPI
@new
external make: unit => document = "Document"

include Node.Impl({
type t = document
})
include Node.Impl({type t = document})

/**
Returns the first element within node's descendants whose ID is elementId.
Expand Down
8 changes: 2 additions & 6 deletions src/DOMAPI/DocumentFragment.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ module Impl = (
type t
},
) => {
include Node.Impl({
type t = T.t
})
include Node.Impl({type t = T.t})

external asDocumentFragment: T.t => documentFragment = "%identity"

Expand Down Expand Up @@ -93,6 +91,4 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre
external replaceChildren2: (T.t, string) => unit = "replaceChildren"
}

include Impl({
type t = documentFragment
})
include Impl({type t = documentFragment})
8 changes: 2 additions & 6 deletions src/DOMAPI/Element.res
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ module Impl = (
type t
},
) => {
include Node.Impl({
type t = T.t
})
include Node.Impl({type t = T.t})

external asElement: T.t => element = "%identity"

Expand Down Expand Up @@ -495,8 +493,6 @@ Returns true if qualifiedName is now present, and false otherwise.
"toggleAttribute"
}

include Impl({
type t = element
})
include Impl({type t = element})

let isInstanceOf = (_: 't): bool => %raw(`param instanceof Element`)
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLAnchorElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlAnchorElement
})
include HTMLElement.Impl({type t = htmlAnchorElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLAreaElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlAreaElement
})
include HTMLElement.Impl({type t = htmlAreaElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLAudioElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLMediaElement.Impl({
type t = htmlAudioElement
})
include HTMLMediaElement.Impl({type t = htmlAudioElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLBRElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlbrElement
})
include HTMLElement.Impl({type t = htmlbrElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLBaseElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlBaseElement
})
include HTMLElement.Impl({type t = htmlBaseElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLBodyElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlBodyElement
})
include HTMLElement.Impl({type t = htmlBodyElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLButtonElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlButtonElement
})
include HTMLElement.Impl({type t = htmlButtonElement})

/**
Returns whether a form will validate when it is submitted, without having to submit it.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLCanvasElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ open DOMAPI
open CanvasAPI
open MediaCaptureAndStreamsAPI

include HTMLElement.Impl({
type t = htmlCanvasElement
})
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.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLDListElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmldListElement
})
include HTMLElement.Impl({type t = htmldListElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLDataElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlDataElement
})
include HTMLElement.Impl({type t = htmlDataElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLDataListElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlDataListElement
})
include HTMLElement.Impl({type t = htmlDataListElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLDialogElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlDialogElement
})
include HTMLElement.Impl({type t = htmlDialogElement})

/**
Displays the dialog element.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLDivElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlDivElement
})
include HTMLElement.Impl({type t = htmlDivElement})
8 changes: 2 additions & 6 deletions src/DOMAPI/HTMLElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module Impl = (
type t
},
) => {
include Element.Impl({
type t = T.t
})
include Element.Impl({type t = T.t})

external asHTMLElement: T.t => htmlElement = "%identity"

Expand Down Expand Up @@ -54,6 +52,4 @@ module Impl = (
external togglePopover: (T.t, ~force: bool=?) => bool = "togglePopover"
}

include Impl({
type t = htmlElement
})
include Impl({type t = htmlElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLEmbedElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlEmbedElement
})
include HTMLElement.Impl({type t = htmlEmbedElement})

@send
external getSVGDocument: htmlEmbedElement => document = "getSVGDocument"
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLFieldSetElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlFieldSetElement
})
include HTMLElement.Impl({type t = htmlFieldSetElement})

/**
Returns whether a form will validate when it is submitted, without having to submit it.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLFormElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlFormElement
})
include HTMLElement.Impl({type t = htmlFormElement})

/**
Fires when a FORM is about to be submitted.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLFrameSetElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlFrameSetElement
})
include HTMLElement.Impl({type t = htmlFrameSetElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLHRElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlhrElement
})
include HTMLElement.Impl({type t = htmlhrElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLHeadElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlHeadElement
})
include HTMLElement.Impl({type t = htmlHeadElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLHeadingElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlHeadingElement
})
include HTMLElement.Impl({type t = htmlHeadingElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLHtmlElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlHtmlElement
})
include HTMLElement.Impl({type t = htmlHtmlElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLIFrameElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmliFrameElement
})
include HTMLElement.Impl({type t = htmliFrameElement})

@send
external getSVGDocument: htmliFrameElement => document = "getSVGDocument"
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLImageElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlImageElement
})
include HTMLElement.Impl({type t = htmlImageElement})

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/decode)
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLInputElement.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlInputElement
})
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.
Expand Down
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLLIElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlliElement
})
include HTMLElement.Impl({type t = htmlliElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLLabelElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlLabelElement
})
include HTMLElement.Impl({type t = htmlLabelElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLLegendElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlLegendElement
})
include HTMLElement.Impl({type t = htmlLegendElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLLinkElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlLinkElement
})
include HTMLElement.Impl({type t = htmlLinkElement})
4 changes: 1 addition & 3 deletions src/DOMAPI/HTMLMapElement.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
open DOMAPI

include HTMLElement.Impl({
type t = htmlMapElement
})
include HTMLElement.Impl({type t = htmlMapElement})
Loading