{
"import": [
"mizchi/js",
"mizchi/js_browser/dom"
]
}let doc = @dom.document()
let div = doc.createElement("div")
div.set_attribute("id", "app")
div.set_attribute("class", "container")
let text = doc.createTextNode("Hello, World!")
div.append_child(text.as_element()) |> ignore// Property access
div.set("innerHTML", "Hello World")
let content = div._get("innerHTML")
// Attributes
div.set_attribute("data-value", "123")
let value = div.getAttribute("data-value") // Some("123")
div.removeAttribute("data-value")
// Class manipulation
div.addClass("active")
div.removeClass("inactive")
div.toggleClass("hidden")
inspect(div.containsClass("active")) // true
// DOM properties
div.setId("main")
div.setClassName("app container")
div.setInnerHTML("<span>Content</span>")let parent = element.parent_element()
let children = element.children()
let first = element.first_child()
let last = element.last_child()
let next = element.next_sibling()
let prev = element.previous_sibling()
// Element-only traversal (skips text nodes)
let first_elem = element.first_element_child()
let next_elem = element.next_element_sibling()let doc = @dom.document()
// Single element
let el = doc.query_selector("#app")
match el {
Some(element) => element.set_text_content("Found!")
None => ()
}
// By ID
let element = doc.get_element_by_id("main")
// Multiple elements
let elements = doc.query_selector_all(".item")
let by_tag = doc.get_elements_by_tag_name("div")
let by_class = doc.get_elements_by_class_name("container")fn handle_click(event : @dom.Event) -> Unit {
event.prevent_default()
event.stop_propagation()
let target = event.target()
target.set_text_content("Clicked!")
}
element.addEventListener("click", handle_click)
// Remove listener
element.removeEventListener("click", handle_click)fn handle_mouse(event : @dom.MouseEvent) -> Unit {
let x = event.client_x()
let y = event.client_y()
let button = event.button()
if event.ctrl_key() {
// Handle Ctrl+Click
}
}
element.addEventListener("click", fn(e) {
handle_mouse(e.cast())
})fn handle_keydown(event : @dom.KeyboardEvent) -> Unit {
let key = event.key()
let code = event.code()
if event.ctrl_key() && key == "s" {
event.prevent_default()
// Handle Ctrl+S
}
}// Inline styles
div.set_display("block")
div.set_color("red")
div.set_width("100px")
div.set_height("50px")
div.set_opacity(0.5)
// CSS properties
div.set_style_property("background-color", "blue")
div.set_style_property("border-radius", "5px")
// Get computed style
let computed = @dom.get_computed_style(div)
let color = computed._get("color")container.set_display("flex")
container.set_flex_direction("row")
container.set_justify_content("center")
container.set_align_items("center")
container.set_gap("10px")
// Grid
grid.set_display("grid")
grid.set_grid_template_columns("1fr 2fr 1fr")
grid.set_grid_template_rows("auto")let storage = @dom.get_local_storage()
// Set and get
storage.set_item("user", "Alice")
let user = storage.get_item("user") // Some("Alice")
// Remove
storage.remove_item("user")
// Check existence
if storage.has_item("token") {
// ...
}
// Iterate
let keys = storage.keys()
let values = storage.values()
let entries = storage.entries()
// Clear all
storage.clear()let nav = @dom.navigator()
let ua = nav.user_agent()
let lang = nav.language()
let online = nav.on_line()
let platform = nav.platform()
let cores = nav.hardware_concurrency()let doc = @dom.document()
// Document properties
let title = doc.title()
doc.set_title("New Title")
let url = doc.url()
let domain = doc.domain()
// Body and head
let body = doc.body()
let head = doc.head()
// Create fragment
let fragment = doc.create_document_fragment()// Client dimensions
let width = element.client_width()
let height = element.client_height()
// Scroll dimensions
let scroll_width = element.scroll_width()
let scroll_height = element.scroll_height()
// Scroll position
let scroll_top = element.scroll_top()
element.set_scroll_top(100.0)
// Bounding rect
let rect = element.get_bounding_client_rect()// Clone node
let clone = element.clone_node(true) // deep clone
// Check containment
if parent.contains(child) {
// parent contains child
}
// Compare nodes
if node1.is_equal_node(node2) {
// nodes are equal
}
// Text content
element.set_text_content("New text")
let text = element.text_content()// Setup JSDOM
extern "js" fn require(module_name : String) -> @js.Val =
#| (moduleName) => require(moduleName)
fn setup_jsdom() -> Unit {
let jsdom = require("global-jsdom")
jsdom._call("register", []) |> ignore
}
// Run tests
test "basic DOM operations" {
setup_jsdom()
let doc = @dom.document()
let div = doc.create_element("div")
div.set_attribute("id", "test")
inspect(div.get_attribute("id"), content="Some(\"test\")")
}let div = doc.createElement("div")
div.as_node().appendChild(child.as_node())
div.as_element().setAttribute("class", "container")
div.as_html_element().innerHTML()let div = doc.createElement("div")
div.appendChild(child.as_node())
div.setAttribute("class", "container")
div.innerHTML()pnpm generate:dom
# or
deno run --allow-read --allow-write scripts/generate_dom_inheritance.tsEventTarget
└── Node (appendChild, removeChild, textContent, etc.)
├── Element (querySelector, setAttribute, etc.)
│ ├── HTMLElement (innerHTML, innerText, etc.)
│ │ └── HTMLDivElement, HTMLSpanElement, etc.
│ └── SVGElement
│ └── SVGCircleElement, SVGRectElement, etc.
└── Documentmatch element.parent_element() {
Some(parent) => // Handle parent
None => // No parent
}pub(all) struct AnimationEvent {
animationName : String
elapsedTime : Double
pseudoElement : String
}impl Show for AnimationEvent#external
pub type BeforeUnloadEvent#alias(set_return_value)
fn BeforeUnloadEvent::setReturnValue(self : BeforeUnloadEvent, value : String) -> Unit#external
pub type CSSRulefn CSSStyleDeclaration::get_property_priority(self : CSSStyleDeclaration, property : String) -> Stringfn CSSStyleDeclaration::set_property(self : CSSStyleDeclaration, property : String, value : String) -> Unitfn CSSStyleDeclaration::set_property_priority(self : CSSStyleDeclaration, property : String, value : String, priority : String) -> Unit#external
pub type CSSStyleSheetpub(all) struct ChangeEvent {
}impl Show for ChangeEvent#external
pub type CustomElementRegistryfn CustomElementRegistry::define_(self : CustomElementRegistry, name : String, on_connected? : () -> Unit, on_disconnected? : () -> Unit, on_adopted? : () -> Unit, on_attribute_changed? : (String, String?, String?, String?) -> Unit, observed_attributes? : Array[String], html_element_class? : Any) -> Unitfn CustomElementRegistry::getName(self : CustomElementRegistry, element_constructor : Any) -> String?pub(all) struct DOMRect {
x : Double
y : Double
width : Double
height : Double
top : Double
right : Double
bottom : Double
left : Double
}pub(all) struct DOMRectReadOnly {
x : Double
y : Double
width : Double
height : Double
top : Double
right : Double
bottom : Double
left : Double
}#external
pub type DataTransferItem#external
pub type Document#alias(create_document_fragment)
fn Document::createDocumentFragment(self : Document) -> DocumentFragment#external
pub type DocumentFragment#external
pub type Element#external
pub type Event#external
pub type FocusEventpub(all) struct HTMLAnchorElement {
href : String
target : String
}fn HTMLAnchorElement::getElementsByClassName(self : HTMLAnchorElement, class_name : String) -> Array[Element]fn HTMLAnchorElement::getElementsByTagName(self : HTMLAnchorElement, tag_name : String) -> Array[Element]fn HTMLAnchorElement::insertAdjacentElement(self : HTMLAnchorElement, position : String, element : Element) -> Element?fn HTMLAnchorElement::insertAdjacentHTML(self : HTMLAnchorElement, position : String, html : String) -> Unitfn HTMLAnchorElement::insertAdjacentText(self : HTMLAnchorElement, position : String, text : String) -> Unitfn HTMLAnchorElement::insertBefore(self : HTMLAnchorElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLAnchorElement::moveBefore(self : HTMLAnchorElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLAnchorElement::querySelectorAll(self : HTMLAnchorElement, selector : String) -> Array[Element]fn HTMLAnchorElement::replaceChild(self : HTMLAnchorElement, new_child : Node, old_child : Node) -> Nodefn HTMLAnchorElement::toggleAttribute(self : HTMLAnchorElement, name : String, force? : Bool) -> Bool#external
pub type HTMLBodyElementfn HTMLBodyElement::getElementsByClassName(self : HTMLBodyElement, class_name : String) -> Array[Element]fn HTMLBodyElement::getElementsByTagName(self : HTMLBodyElement, tag_name : String) -> Array[Element]fn HTMLBodyElement::insertAdjacentElement(self : HTMLBodyElement, position : String, element : Element) -> Element?fn HTMLBodyElement::insertAdjacentHTML(self : HTMLBodyElement, position : String, html : String) -> Unitfn HTMLBodyElement::insertAdjacentText(self : HTMLBodyElement, position : String, text : String) -> Unitfn HTMLBodyElement::replaceChild(self : HTMLBodyElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HTMLButtonElement {
disabled : Bool
}fn HTMLButtonElement::getElementsByClassName(self : HTMLButtonElement, class_name : String) -> Array[Element]fn HTMLButtonElement::getElementsByTagName(self : HTMLButtonElement, tag_name : String) -> Array[Element]fn HTMLButtonElement::insertAdjacentElement(self : HTMLButtonElement, position : String, element : Element) -> Element?fn HTMLButtonElement::insertAdjacentHTML(self : HTMLButtonElement, position : String, html : String) -> Unitfn HTMLButtonElement::insertAdjacentText(self : HTMLButtonElement, position : String, text : String) -> Unitfn HTMLButtonElement::insertBefore(self : HTMLButtonElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLButtonElement::moveBefore(self : HTMLButtonElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLButtonElement::querySelectorAll(self : HTMLButtonElement, selector : String) -> Array[Element]fn HTMLButtonElement::replaceChild(self : HTMLButtonElement, new_child : Node, old_child : Node) -> Nodefn HTMLButtonElement::toggleAttribute(self : HTMLButtonElement, name : String, force? : Bool) -> Boolpub(all) struct HTMLCanvasElement {
width : Int
height : Int
}impl Show for HTMLCanvasElementfn HTMLCanvasElement::getElementsByClassName(self : HTMLCanvasElement, class_name : String) -> Array[Element]fn HTMLCanvasElement::getElementsByTagName(self : HTMLCanvasElement, tag_name : String) -> Array[Element]fn HTMLCanvasElement::insertAdjacentElement(self : HTMLCanvasElement, position : String, element : Element) -> Element?fn HTMLCanvasElement::insertAdjacentHTML(self : HTMLCanvasElement, position : String, html : String) -> Unitfn HTMLCanvasElement::insertAdjacentText(self : HTMLCanvasElement, position : String, text : String) -> Unitfn HTMLCanvasElement::insertBefore(self : HTMLCanvasElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLCanvasElement::moveBefore(self : HTMLCanvasElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLCanvasElement::querySelectorAll(self : HTMLCanvasElement, selector : String) -> Array[Element]fn HTMLCanvasElement::replaceChild(self : HTMLCanvasElement, new_child : Node, old_child : Node) -> Nodeasync fn HTMLCanvasElement::toBlob(self : HTMLCanvasElement, image_type? : String, quality? : Double) -> Blobfn HTMLCanvasElement::toDataURL(self : HTMLCanvasElement, image_type? : String, quality? : Double) -> Stringfn HTMLCanvasElement::toggleAttribute(self : HTMLCanvasElement, name : String, force? : Bool) -> Bool#external
pub type HTMLDivElementfn HTMLDivElement::getElementsByClassName(self : HTMLDivElement, class_name : String) -> Array[Element]fn HTMLDivElement::insertAdjacentElement(self : HTMLDivElement, position : String, element : Element) -> Element?fn HTMLDivElement::insertAdjacentHTML(self : HTMLDivElement, position : String, html : String) -> Unitfn HTMLDivElement::insertAdjacentText(self : HTMLDivElement, position : String, text : String) -> Unit#external
pub type HTMLElementfn HTMLElement::insertAdjacentElement(self : HTMLElement, position : String, element : Element) -> Element?#external
pub type HTMLFormElementfn HTMLFormElement::getElementsByClassName(self : HTMLFormElement, class_name : String) -> Array[Element]fn HTMLFormElement::getElementsByTagName(self : HTMLFormElement, tag_name : String) -> Array[Element]fn HTMLFormElement::insertAdjacentElement(self : HTMLFormElement, position : String, element : Element) -> Element?fn HTMLFormElement::insertAdjacentHTML(self : HTMLFormElement, position : String, html : String) -> Unitfn HTMLFormElement::insertAdjacentText(self : HTMLFormElement, position : String, text : String) -> Unitfn HTMLFormElement::replaceChild(self : HTMLFormElement, new_child : Node, old_child : Node) -> Node#external
pub type HTMLHeadElementfn HTMLHeadElement::getElementsByClassName(self : HTMLHeadElement, class_name : String) -> Array[Element]fn HTMLHeadElement::getElementsByTagName(self : HTMLHeadElement, tag_name : String) -> Array[Element]fn HTMLHeadElement::insertAdjacentElement(self : HTMLHeadElement, position : String, element : Element) -> Element?fn HTMLHeadElement::insertAdjacentHTML(self : HTMLHeadElement, position : String, html : String) -> Unitfn HTMLHeadElement::insertAdjacentText(self : HTMLHeadElement, position : String, text : String) -> Unitfn HTMLHeadElement::replaceChild(self : HTMLHeadElement, new_child : Node, old_child : Node) -> Node#external
pub type HTMLHeadingElementfn HTMLHeadingElement::getElementsByClassName(self : HTMLHeadingElement, class_name : String) -> Array[Element]fn HTMLHeadingElement::getElementsByTagName(self : HTMLHeadingElement, tag_name : String) -> Array[Element]fn HTMLHeadingElement::insertAdjacentElement(self : HTMLHeadingElement, position : String, element : Element) -> Element?fn HTMLHeadingElement::insertAdjacentHTML(self : HTMLHeadingElement, position : String, html : String) -> Unitfn HTMLHeadingElement::insertAdjacentText(self : HTMLHeadingElement, position : String, text : String) -> Unitfn HTMLHeadingElement::insertBefore(self : HTMLHeadingElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLHeadingElement::moveBefore(self : HTMLHeadingElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLHeadingElement::querySelectorAll(self : HTMLHeadingElement, selector : String) -> Array[Element]fn HTMLHeadingElement::replaceChild(self : HTMLHeadingElement, new_child : Node, old_child : Node) -> Nodefn HTMLHeadingElement::setAttribute(self : HTMLHeadingElement, name : String, value : String) -> Unitfn HTMLHeadingElement::toggleAttribute(self : HTMLHeadingElement, name : String, force? : Bool) -> Bool#external
pub type HTMLHtmlElementfn HTMLHtmlElement::getElementsByClassName(self : HTMLHtmlElement, class_name : String) -> Array[Element]fn HTMLHtmlElement::getElementsByTagName(self : HTMLHtmlElement, tag_name : String) -> Array[Element]fn HTMLHtmlElement::insertAdjacentElement(self : HTMLHtmlElement, position : String, element : Element) -> Element?fn HTMLHtmlElement::insertAdjacentHTML(self : HTMLHtmlElement, position : String, html : String) -> Unitfn HTMLHtmlElement::insertAdjacentText(self : HTMLHtmlElement, position : String, text : String) -> Unitfn HTMLHtmlElement::replaceChild(self : HTMLHtmlElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HTMLIFrameElement {
src : String
sandbox : String
width : String
height : String
name : String
}impl Show for HTMLIFrameElementfn HTMLIFrameElement::getElementsByClassName(self : HTMLIFrameElement, class_name : String) -> Array[Element]fn HTMLIFrameElement::getElementsByTagName(self : HTMLIFrameElement, tag_name : String) -> Array[Element]fn HTMLIFrameElement::insertAdjacentElement(self : HTMLIFrameElement, position : String, element : Element) -> Element?fn HTMLIFrameElement::insertAdjacentHTML(self : HTMLIFrameElement, position : String, html : String) -> Unitfn HTMLIFrameElement::insertAdjacentText(self : HTMLIFrameElement, position : String, text : String) -> Unitfn HTMLIFrameElement::insertBefore(self : HTMLIFrameElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLIFrameElement::moveBefore(self : HTMLIFrameElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLIFrameElement::querySelectorAll(self : HTMLIFrameElement, selector : String) -> Array[Element]fn HTMLIFrameElement::replaceChild(self : HTMLIFrameElement, new_child : Node, old_child : Node) -> Nodefn HTMLIFrameElement::toggleAttribute(self : HTMLIFrameElement, name : String, force? : Bool) -> Boolpub(all) struct HTMLImageElement {
src : String
alt : String
}fn HTMLImageElement::getElementsByClassName(self : HTMLImageElement, class_name : String) -> Array[Element]fn HTMLImageElement::getElementsByTagName(self : HTMLImageElement, tag_name : String) -> Array[Element]fn HTMLImageElement::insertAdjacentElement(self : HTMLImageElement, position : String, element : Element) -> Element?fn HTMLImageElement::insertAdjacentHTML(self : HTMLImageElement, position : String, html : String) -> Unitfn HTMLImageElement::insertAdjacentText(self : HTMLImageElement, position : String, text : String) -> Unitfn HTMLImageElement::insertBefore(self : HTMLImageElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLImageElement::moveBefore(self : HTMLImageElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLImageElement::replaceChild(self : HTMLImageElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HTMLInputElement {
disabled : Bool
value : String
placeholder : String
checked : Bool
}fn HTMLInputElement::getElementsByClassName(self : HTMLInputElement, class_name : String) -> Array[Element]fn HTMLInputElement::getElementsByTagName(self : HTMLInputElement, tag_name : String) -> Array[Element]fn HTMLInputElement::insertAdjacentElement(self : HTMLInputElement, position : String, element : Element) -> Element?fn HTMLInputElement::insertAdjacentHTML(self : HTMLInputElement, position : String, html : String) -> Unitfn HTMLInputElement::insertAdjacentText(self : HTMLInputElement, position : String, text : String) -> Unitfn HTMLInputElement::insertBefore(self : HTMLInputElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLInputElement::moveBefore(self : HTMLInputElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLInputElement::replaceChild(self : HTMLInputElement, new_child : Node, old_child : Node) -> Node#external
pub type HTMLLIElementfn HTMLLIElement::getElementsByClassName(self : HTMLLIElement, class_name : String) -> Array[Element]fn HTMLLIElement::insertAdjacentElement(self : HTMLLIElement, position : String, element : Element) -> Element?fn HTMLLIElement::insertAdjacentHTML(self : HTMLLIElement, position : String, html : String) -> Unitfn HTMLLIElement::insertAdjacentText(self : HTMLLIElement, position : String, text : String) -> Unitpub(all) struct HTMLLabelElement {
htmlFor : String
}fn HTMLLabelElement::getElementsByClassName(self : HTMLLabelElement, class_name : String) -> Array[Element]fn HTMLLabelElement::getElementsByTagName(self : HTMLLabelElement, tag_name : String) -> Array[Element]fn HTMLLabelElement::insertAdjacentElement(self : HTMLLabelElement, position : String, element : Element) -> Element?fn HTMLLabelElement::insertAdjacentHTML(self : HTMLLabelElement, position : String, html : String) -> Unitfn HTMLLabelElement::insertAdjacentText(self : HTMLLabelElement, position : String, text : String) -> Unitfn HTMLLabelElement::insertBefore(self : HTMLLabelElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLLabelElement::moveBefore(self : HTMLLabelElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLLabelElement::replaceChild(self : HTMLLabelElement, new_child : Node, old_child : Node) -> Node#external
pub type HTMLOListElementfn HTMLOListElement::getElementsByClassName(self : HTMLOListElement, class_name : String) -> Array[Element]fn HTMLOListElement::getElementsByTagName(self : HTMLOListElement, tag_name : String) -> Array[Element]fn HTMLOListElement::insertAdjacentElement(self : HTMLOListElement, position : String, element : Element) -> Element?fn HTMLOListElement::insertAdjacentHTML(self : HTMLOListElement, position : String, html : String) -> Unitfn HTMLOListElement::insertAdjacentText(self : HTMLOListElement, position : String, text : String) -> Unitfn HTMLOListElement::insertBefore(self : HTMLOListElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLOListElement::moveBefore(self : HTMLOListElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLOListElement::replaceChild(self : HTMLOListElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HTMLOptionElement {
value : String
selected : Bool
}fn HTMLOptionElement::getElementsByClassName(self : HTMLOptionElement, class_name : String) -> Array[Element]fn HTMLOptionElement::getElementsByTagName(self : HTMLOptionElement, tag_name : String) -> Array[Element]fn HTMLOptionElement::insertAdjacentElement(self : HTMLOptionElement, position : String, element : Element) -> Element?fn HTMLOptionElement::insertAdjacentHTML(self : HTMLOptionElement, position : String, html : String) -> Unitfn HTMLOptionElement::insertAdjacentText(self : HTMLOptionElement, position : String, text : String) -> Unitfn HTMLOptionElement::insertBefore(self : HTMLOptionElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLOptionElement::moveBefore(self : HTMLOptionElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLOptionElement::querySelectorAll(self : HTMLOptionElement, selector : String) -> Array[Element]fn HTMLOptionElement::replaceChild(self : HTMLOptionElement, new_child : Node, old_child : Node) -> Nodefn HTMLOptionElement::toggleAttribute(self : HTMLOptionElement, name : String, force? : Bool) -> Bool#external
pub type HTMLParagraphElementfn HTMLParagraphElement::getElementsByClassName(self : HTMLParagraphElement, class_name : String) -> Array[Element]fn HTMLParagraphElement::getElementsByTagName(self : HTMLParagraphElement, tag_name : String) -> Array[Element]fn HTMLParagraphElement::insertAdjacentElement(self : HTMLParagraphElement, position : String, element : Element) -> Element?fn HTMLParagraphElement::insertAdjacentHTML(self : HTMLParagraphElement, position : String, html : String) -> Unitfn HTMLParagraphElement::insertAdjacentText(self : HTMLParagraphElement, position : String, text : String) -> Unitfn HTMLParagraphElement::insertBefore(self : HTMLParagraphElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLParagraphElement::moveBefore(self : HTMLParagraphElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLParagraphElement::querySelectorAll(self : HTMLParagraphElement, selector : String) -> Array[Element]fn HTMLParagraphElement::replaceChild(self : HTMLParagraphElement, new_child : Node, old_child : Node) -> Nodefn HTMLParagraphElement::setAttribute(self : HTMLParagraphElement, name : String, value : String) -> Unitfn HTMLParagraphElement::toggleAttribute(self : HTMLParagraphElement, name : String, force? : Bool) -> Boolpub(all) struct HTMLSelectElement {
value : String
disabled : Bool
}fn HTMLSelectElement::getElementsByClassName(self : HTMLSelectElement, class_name : String) -> Array[Element]fn HTMLSelectElement::getElementsByTagName(self : HTMLSelectElement, tag_name : String) -> Array[Element]fn HTMLSelectElement::insertAdjacentElement(self : HTMLSelectElement, position : String, element : Element) -> Element?fn HTMLSelectElement::insertAdjacentHTML(self : HTMLSelectElement, position : String, html : String) -> Unitfn HTMLSelectElement::insertAdjacentText(self : HTMLSelectElement, position : String, text : String) -> Unitfn HTMLSelectElement::insertBefore(self : HTMLSelectElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLSelectElement::moveBefore(self : HTMLSelectElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLSelectElement::querySelectorAll(self : HTMLSelectElement, selector : String) -> Array[Element]fn HTMLSelectElement::replaceChild(self : HTMLSelectElement, new_child : Node, old_child : Node) -> Nodefn HTMLSelectElement::toggleAttribute(self : HTMLSelectElement, name : String, force? : Bool) -> Bool#external
pub type HTMLSpanElementfn HTMLSpanElement::getElementsByClassName(self : HTMLSpanElement, class_name : String) -> Array[Element]fn HTMLSpanElement::getElementsByTagName(self : HTMLSpanElement, tag_name : String) -> Array[Element]fn HTMLSpanElement::insertAdjacentElement(self : HTMLSpanElement, position : String, element : Element) -> Element?fn HTMLSpanElement::insertAdjacentHTML(self : HTMLSpanElement, position : String, html : String) -> Unitfn HTMLSpanElement::insertAdjacentText(self : HTMLSpanElement, position : String, text : String) -> Unitfn HTMLSpanElement::replaceChild(self : HTMLSpanElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HTMLTextAreaElement {
value : String
placeholder : String
disabled : Bool
rows : Int
cols : Int
readOnly : Bool
}fn HTMLTextAreaElement::getElementsByClassName(self : HTMLTextAreaElement, class_name : String) -> Array[Element]fn HTMLTextAreaElement::getElementsByTagName(self : HTMLTextAreaElement, tag_name : String) -> Array[Element]fn HTMLTextAreaElement::insertAdjacentElement(self : HTMLTextAreaElement, position : String, element : Element) -> Element?fn HTMLTextAreaElement::insertAdjacentHTML(self : HTMLTextAreaElement, position : String, html : String) -> Unitfn HTMLTextAreaElement::insertAdjacentText(self : HTMLTextAreaElement, position : String, text : String) -> Unitfn HTMLTextAreaElement::insertBefore(self : HTMLTextAreaElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLTextAreaElement::moveBefore(self : HTMLTextAreaElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLTextAreaElement::querySelectorAll(self : HTMLTextAreaElement, selector : String) -> Array[Element]fn HTMLTextAreaElement::replaceChild(self : HTMLTextAreaElement, new_child : Node, old_child : Node) -> Nodefn HTMLTextAreaElement::setAttribute(self : HTMLTextAreaElement, name : String, value : String) -> Unitfn HTMLTextAreaElement::toggleAttribute(self : HTMLTextAreaElement, name : String, force? : Bool) -> Bool#external
pub type HTMLUListElementfn HTMLUListElement::getElementsByClassName(self : HTMLUListElement, class_name : String) -> Array[Element]fn HTMLUListElement::getElementsByTagName(self : HTMLUListElement, tag_name : String) -> Array[Element]fn HTMLUListElement::insertAdjacentElement(self : HTMLUListElement, position : String, element : Element) -> Element?fn HTMLUListElement::insertAdjacentHTML(self : HTMLUListElement, position : String, html : String) -> Unitfn HTMLUListElement::insertAdjacentText(self : HTMLUListElement, position : String, text : String) -> Unitfn HTMLUListElement::insertBefore(self : HTMLUListElement, new_node : Node, ref_node : Node?) -> Nodefn HTMLUListElement::moveBefore(self : HTMLUListElement, moved_node : Node, ref_node : Node?) -> Unitfn HTMLUListElement::replaceChild(self : HTMLUListElement, new_child : Node, old_child : Node) -> Nodepub(all) struct HashChangeEvent {
oldURL : String
newURL : String
}impl Show for HashChangeEventpub(all) struct InputEvent {
data : Nullable[String]
dataTransfer : Nullable[DataTransfer]
inputType : String
isComposing : Bool
}pub(all) struct KeyboardEvent {
key : String
code : String
keyCode : Int
which : Int
ctrlKey : Bool
altKey : Bool
shiftKey : Bool
metaKey : Bool
repeat : Bool
location : Int
isComposing : Bool
}impl Show for KeyboardEventpub(all) struct MediaQueryList {
media : String
matches : Bool
}fn MediaQueryList::removeListener(self : MediaQueryList, listener : (MediaQueryList) -> Unit) -> Unitpub(all) struct MessageEvent {
data : Any
origin : String
lastEventId : String
ports : Array[MessagePort]
}impl Show for MessageEventpub(all) struct MouseEvent {
clientX : Double
clientY : Double
screenX : Double
screenY : Double
offsetX : Double
offsetY : Double
pageX : Double
pageY : Double
movementX : Double
movementY : Double
button : Int
buttons : Int
ctrlKey : Bool
shiftKey : Bool
altKey : Bool
metaKey : Bool
}impl Show for MouseEvent#external
pub type Nodepub(all) struct PageTransitionEvent {
persisted : Bool
}impl Show for PageTransitionEventpub(all) struct PointerEvent {
pointerId : Int
width : Double
height : Double
pressure : Double
tangentialPressure : Double
tiltX : Double
tiltY : Double
twist : Double
altitudeAngle : Double
azimuthAngle : Double
pointerType : String
isPrimary : Bool
}impl Show for PointerEvent#external
pub type PopStateEvent#external
pub type SVGCircleElementfn SVGCircleElement::getElementsByClassName(self : SVGCircleElement, class_name : String) -> Array[Element]fn SVGCircleElement::getElementsByTagName(self : SVGCircleElement, tag_name : String) -> Array[Element]fn SVGCircleElement::insertAdjacentElement(self : SVGCircleElement, position : String, element : Element) -> Element?fn SVGCircleElement::insertAdjacentHTML(self : SVGCircleElement, position : String, html : String) -> Unitfn SVGCircleElement::insertAdjacentText(self : SVGCircleElement, position : String, text : String) -> Unitfn SVGCircleElement::insertBefore(self : SVGCircleElement, new_node : Node, ref_node : Node?) -> Nodefn SVGCircleElement::moveBefore(self : SVGCircleElement, moved_node : Node, ref_node : Node?) -> Unitfn SVGCircleElement::replaceChild(self : SVGCircleElement, new_child : Node, old_child : Node) -> Node#external
pub type SVGElementfn SVGElement::insertAdjacentElement(self : SVGElement, position : String, element : Element) -> Element?#external
pub type SVGEllipseElement#external
pub type SVGGElementfn SVGGElement::insertAdjacentElement(self : SVGGElement, position : String, element : Element) -> Element?#external
pub type SVGGraphicsElementfn SVGGraphicsElement::getBBoxWithOptions(self : SVGGraphicsElement, fill : Bool, stroke : Bool, markers : Bool, clipped : Bool) -> SVGRect#external
pub type SVGImageElement#external
pub type SVGLineElementfn SVGLineElement::getElementsByClassName(self : SVGLineElement, class_name : String) -> Array[Element]fn SVGLineElement::insertAdjacentElement(self : SVGLineElement, position : String, element : Element) -> Element?fn SVGLineElement::insertAdjacentHTML(self : SVGLineElement, position : String, html : String) -> Unitfn SVGLineElement::insertAdjacentText(self : SVGLineElement, position : String, text : String) -> Unit#external
pub type SVGMatrix#external
pub type SVGPathElementfn SVGPathElement::getElementsByClassName(self : SVGPathElement, class_name : String) -> Array[Element]fn SVGPathElement::insertAdjacentElement(self : SVGPathElement, position : String, element : Element) -> Element?fn SVGPathElement::insertAdjacentHTML(self : SVGPathElement, position : String, html : String) -> Unitfn SVGPathElement::insertAdjacentText(self : SVGPathElement, position : String, text : String) -> Unit#external
pub type SVGPoint#external
pub type SVGPolygonElementfn SVGPolygonElement::getElementsByClassName(self : SVGPolygonElement, class_name : String) -> Array[Element]fn SVGPolygonElement::getElementsByTagName(self : SVGPolygonElement, tag_name : String) -> Array[Element]fn SVGPolygonElement::insertAdjacentElement(self : SVGPolygonElement, position : String, element : Element) -> Element?fn SVGPolygonElement::insertAdjacentHTML(self : SVGPolygonElement, position : String, html : String) -> Unitfn SVGPolygonElement::insertAdjacentText(self : SVGPolygonElement, position : String, text : String) -> Unitfn SVGPolygonElement::insertBefore(self : SVGPolygonElement, new_node : Node, ref_node : Node?) -> Nodefn SVGPolygonElement::moveBefore(self : SVGPolygonElement, moved_node : Node, ref_node : Node?) -> Unitfn SVGPolygonElement::querySelectorAll(self : SVGPolygonElement, selector : String) -> Array[Element]fn SVGPolygonElement::replaceChild(self : SVGPolygonElement, new_child : Node, old_child : Node) -> Nodefn SVGPolygonElement::toggleAttribute(self : SVGPolygonElement, name : String, force? : Bool) -> Bool#external
pub type SVGPolylineElementfn SVGPolylineElement::getElementsByClassName(self : SVGPolylineElement, class_name : String) -> Array[Element]fn SVGPolylineElement::getElementsByTagName(self : SVGPolylineElement, tag_name : String) -> Array[Element]fn SVGPolylineElement::insertAdjacentElement(self : SVGPolylineElement, position : String, element : Element) -> Element?fn SVGPolylineElement::insertAdjacentHTML(self : SVGPolylineElement, position : String, html : String) -> Unitfn SVGPolylineElement::insertAdjacentText(self : SVGPolylineElement, position : String, text : String) -> Unitfn SVGPolylineElement::insertBefore(self : SVGPolylineElement, new_node : Node, ref_node : Node?) -> Nodefn SVGPolylineElement::moveBefore(self : SVGPolylineElement, moved_node : Node, ref_node : Node?) -> Unitfn SVGPolylineElement::querySelectorAll(self : SVGPolylineElement, selector : String) -> Array[Element]fn SVGPolylineElement::replaceChild(self : SVGPolylineElement, new_child : Node, old_child : Node) -> Nodefn SVGPolylineElement::setAttribute(self : SVGPolylineElement, name : String, value : String) -> Unitfn SVGPolylineElement::toggleAttribute(self : SVGPolylineElement, name : String, force? : Bool) -> Bool#external
pub type SVGRect#external
pub type SVGRectElementfn SVGRectElement::getElementsByClassName(self : SVGRectElement, class_name : String) -> Array[Element]fn SVGRectElement::insertAdjacentElement(self : SVGRectElement, position : String, element : Element) -> Element?fn SVGRectElement::insertAdjacentHTML(self : SVGRectElement, position : String, html : String) -> Unitfn SVGRectElement::insertAdjacentText(self : SVGRectElement, position : String, text : String) -> Unit#external
pub type SVGSVGElementfn SVGSVGElement::getElementsByClassName(self : SVGSVGElement, class_name : String) -> Array[Element]fn SVGSVGElement::insertAdjacentElement(self : SVGSVGElement, position : String, element : Element) -> Element?fn SVGSVGElement::insertAdjacentHTML(self : SVGSVGElement, position : String, html : String) -> Unitfn SVGSVGElement::insertAdjacentText(self : SVGSVGElement, position : String, text : String) -> Unit#external
pub type SVGTextElementfn SVGTextElement::getElementsByClassName(self : SVGTextElement, class_name : String) -> Array[Element]fn SVGTextElement::insertAdjacentElement(self : SVGTextElement, position : String, element : Element) -> Element?fn SVGTextElement::insertAdjacentHTML(self : SVGTextElement, position : String, html : String) -> Unitfn SVGTextElement::insertAdjacentText(self : SVGTextElement, position : String, text : String) -> Unitpub(all) struct ScrollEvent {
}impl Show for ScrollEvent#external
pub type ShadowRootpub struct ShadowRootInit {
mode : String
delegatesFocus : Bool
slotAssignment : String
}fn ShadowRootInit::new(mode : String, delegatesFocus? : Bool, slotAssignment? : String) -> ShadowRootInit#external
pub type Textpub(all) struct Touch {
identifier : Int
clientX : Double
clientY : Double
screenX : Double
screenY : Double
pageX : Double
pageY : Double
radiusX : Double
radiusY : Double
rotationAngle : Double
force : Double
}impl Show for TouchEventpub(all) struct TransitionEvent {
propertyName : String
elapsedTime : Double
pseudoElement : String
}impl Show for TransitionEventpub(all) struct WheelEvent {
deltaX : Double
deltaY : Double
deltaZ : Double
deltaMode : Int
}impl Show for WheelEvent#external
pub type Window#alias(css_escape)
fn cssEscape(value : String) -> String#alias(css_supports)
fn cssSupports(property : String, value : String) -> Bool#alias(css_supports_condition)
fn cssSupportsCondition(condition : String) -> Boolbrowser-specific js bindings (DOM, canvas, indexeddb, ...)
Dependencies