browser

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 3 Imported by: 0

README

Browser

github.com/typelate/dom/browser is an experimental package.

A prior attempt at this was here: https://github.com/crhntr/window

Test Setup

https://github.com/agnivade/wasmbrowsertest

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSValue

func JSValue(node any) js.Value

func NewNode

func NewNode(value js.Value) spec.Node

func OpenDocument

func OpenDocument() spec.Document

Types

type Document

type Document struct {
	// contains filtered or unexported fields
}

func (*Document) Body

func (d *Document) Body() spec.Element

func (*Document) CloneNode

func (d *Document) CloneNode(deep bool) spec.Node

func (*Document) CompareDocumentPosition

func (d *Document) CompareDocumentPosition(other spec.Node) spec.DocumentPosition

func (*Document) Contains

func (d *Document) Contains(other spec.Node) bool

func (*Document) CreateElement

func (d *Document) CreateElement(localName string) spec.Element

func (*Document) CreateElementIs

func (d *Document) CreateElementIs(localName, is string) spec.Element

func (*Document) CreateTextNode

func (d *Document) CreateTextNode(text string) spec.Text

func (*Document) GetElementsByClassName

func (d *Document) GetElementsByClassName(name string) spec.ElementCollection

func (*Document) GetElementsByTagName

func (d *Document) GetElementsByTagName(name string) spec.ElementCollection

func (*Document) Head

func (d *Document) Head() spec.Element

func (*Document) IsSameNode

func (d *Document) IsSameNode(other spec.Node) bool

func (*Document) NodeType

func (d *Document) NodeType() spec.NodeType

func (*Document) QuerySelector

func (d *Document) QuerySelector(query string) spec.Element

func (*Document) QuerySelectorAll

func (d *Document) QuerySelectorAll(query string) spec.NodeList[spec.Element]

func (*Document) QuerySelectorSequence

func (d *Document) QuerySelectorSequence(query string) iter.Seq[spec.Element]

func (*Document) TextContent

func (d *Document) TextContent() string

type DocumentFragment

type DocumentFragment struct {
	// contains filtered or unexported fields
}

func (*DocumentFragment) Append

func (d *DocumentFragment) Append(nodes ...spec.Node)

func (*DocumentFragment) ChildElementCount

func (d *DocumentFragment) ChildElementCount() int

func (*DocumentFragment) Children

func (d *DocumentFragment) Children() spec.ElementCollection

func (*DocumentFragment) CloneNode

func (d *DocumentFragment) CloneNode(deep bool) spec.Node

func (*DocumentFragment) CompareDocumentPosition

func (d *DocumentFragment) CompareDocumentPosition(other spec.Node) spec.DocumentPosition

func (*DocumentFragment) FirstElementChild

func (d *DocumentFragment) FirstElementChild() spec.Element

func (*DocumentFragment) IsSameNode

func (d *DocumentFragment) IsSameNode(other spec.Node) bool

func (*DocumentFragment) LastElementChild

func (d *DocumentFragment) LastElementChild() spec.Element

func (*DocumentFragment) NodeType

func (d *DocumentFragment) NodeType() spec.NodeType

func (*DocumentFragment) Prepend

func (d *DocumentFragment) Prepend(nodes ...spec.Node)

func (*DocumentFragment) QuerySelector

func (d *DocumentFragment) QuerySelector(query string) spec.Element

func (*DocumentFragment) QuerySelectorAll

func (d *DocumentFragment) QuerySelectorAll(query string) spec.NodeList[spec.Element]

func (*DocumentFragment) QuerySelectorSequence

func (d *DocumentFragment) QuerySelectorSequence(query string) iter.Seq[spec.Element]

func (*DocumentFragment) ReplaceChildren

func (d *DocumentFragment) ReplaceChildren(nodes ...spec.Node)

func (*DocumentFragment) TextContent

func (d *DocumentFragment) TextContent() string

type Element

type Element struct {
	// contains filtered or unexported fields
}

func (*Element) Append

func (e *Element) Append(nodes ...spec.Node)

func (*Element) AppendChild

func (e *Element) AppendChild(node spec.ChildNode) spec.ChildNode

func (*Element) ChildElementCount

func (e *Element) ChildElementCount() int

func (*Element) ChildNodes

func (e *Element) ChildNodes() spec.NodeList[spec.Node]

func (*Element) Children

func (e *Element) Children() spec.ElementCollection

func (*Element) ClassName

func (e *Element) ClassName() string

func (*Element) CloneNode

func (e *Element) CloneNode(deep bool) spec.Node

func (*Element) Closest

func (e *Element) Closest(selector string) spec.Element

func (*Element) CompareDocumentPosition

func (e *Element) CompareDocumentPosition(other spec.Node) spec.DocumentPosition

func (*Element) Contains

func (e *Element) Contains(other spec.Node) bool

func (*Element) FirstChild

func (e *Element) FirstChild() spec.ChildNode

func (*Element) FirstElementChild

func (e *Element) FirstElementChild() spec.Element

func (*Element) GetAttribute

func (e *Element) GetAttribute(name string) string

func (*Element) GetElementsByClassName

func (e *Element) GetElementsByClassName(name string) spec.ElementCollection

func (*Element) GetElementsByTagName

func (e *Element) GetElementsByTagName(name string) spec.ElementCollection

func (*Element) HasAttribute

func (e *Element) HasAttribute(name string) bool

func (*Element) HasChildNodes

func (e *Element) HasChildNodes() bool

func (*Element) ID

func (e *Element) ID() string

func (*Element) InnerHTML

func (e *Element) InnerHTML() string

func (*Element) InsertBefore

func (e *Element) InsertBefore(node, child spec.ChildNode) spec.ChildNode

func (*Element) IsConnected

func (e *Element) IsConnected() bool

func (*Element) IsSameNode

func (e *Element) IsSameNode(other spec.Node) bool

func (*Element) LastChild

func (e *Element) LastChild() spec.ChildNode

func (*Element) LastElementChild

func (e *Element) LastElementChild() spec.Element

func (*Element) Length

func (e *Element) Length() int

func (*Element) Matches

func (e *Element) Matches(selector string) bool

func (*Element) NextSibling

func (e *Element) NextSibling() spec.ChildNode

func (*Element) NodeType

func (e *Element) NodeType() spec.NodeType

func (*Element) OuterHTML

func (e *Element) OuterHTML() string

func (*Element) OwnerDocument

func (e *Element) OwnerDocument() spec.Document

func (*Element) ParentElement

func (e *Element) ParentElement() spec.Element

func (*Element) ParentNode

func (e *Element) ParentNode() spec.Node

func (*Element) Prepend

func (e *Element) Prepend(nodes ...spec.Node)

func (*Element) PreviousSibling

func (e *Element) PreviousSibling() spec.ChildNode

func (*Element) QuerySelector

func (e *Element) QuerySelector(query string) spec.Element

func (*Element) QuerySelectorAll

func (e *Element) QuerySelectorAll(query string) spec.NodeList[spec.Element]

func (*Element) QuerySelectorSequence

func (e *Element) QuerySelectorSequence(query string) iter.Seq[spec.Element]

func (*Element) RemoveAttribute

func (e *Element) RemoveAttribute(name string)

func (*Element) RemoveChild

func (e *Element) RemoveChild(node spec.ChildNode) spec.ChildNode

func (*Element) ReplaceChild

func (e *Element) ReplaceChild(node, child spec.ChildNode) spec.ChildNode

func (*Element) ReplaceChildren

func (e *Element) ReplaceChildren(nodes ...spec.Node)

func (*Element) SetAttribute

func (e *Element) SetAttribute(name, value string)

func (*Element) SetInnerHTML

func (e *Element) SetInnerHTML(s string)

func (*Element) SetOuterHTML

func (e *Element) SetOuterHTML(s string)

func (*Element) TagName

func (e *Element) TagName() string

func (*Element) TextContent

func (e *Element) TextContent() string

func (*Element) ToggleAttribute

func (e *Element) ToggleAttribute(name string) bool

type Node

type Node struct {
	// contains filtered or unexported fields
}

func (*Node) CloneNode

func (n *Node) CloneNode(deep bool) spec.Node

func (*Node) CompareDocumentPosition

func (n *Node) CompareDocumentPosition(other spec.Node) spec.DocumentPosition

func (*Node) IsSameNode

func (n *Node) IsSameNode(other spec.Node) bool

func (*Node) NodeType

func (n *Node) NodeType() spec.NodeType

func (*Node) TextContent

func (n *Node) TextContent() string

type Text

type Text struct {
	// contains filtered or unexported fields
}

func (*Text) CloneNode

func (t *Text) CloneNode(deep bool) spec.Node

func (*Text) CompareDocumentPosition

func (t *Text) CompareDocumentPosition(other spec.Node) spec.DocumentPosition

func (*Text) Data

func (t *Text) Data() string

func (*Text) IsConnected

func (t *Text) IsConnected() bool

func (*Text) IsSameNode

func (t *Text) IsSameNode(other spec.Node) bool

func (*Text) Length

func (t *Text) Length() int

func (*Text) NextSibling

func (t *Text) NextSibling() spec.ChildNode

func (*Text) NodeType

func (t *Text) NodeType() spec.NodeType

func (*Text) OwnerDocument

func (t *Text) OwnerDocument() spec.Document

func (*Text) ParentElement

func (t *Text) ParentElement() spec.Element

func (*Text) ParentNode

func (t *Text) ParentNode() spec.Node

func (*Text) PreviousSibling

func (t *Text) PreviousSibling() spec.ChildNode

func (*Text) SetData

func (t *Text) SetData(s string)

func (*Text) TextContent

func (t *Text) TextContent() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL