Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Dom

The main DOM

Hierarchy

  • Resource
    • Dom

Index

Constructors

  • new Dom(ptr: number, source: RustString): Dom
  • Parameters

    • ptr: number
    • source: RustString

    Returns Dom

Properties

freed: boolean = false
ptr: number
source: RustString

Methods

  • free(): void
  • Frees the underlying WebAssembly memory associated to this DOM

    Calling this function will invalidate any handle that points to this DOM in any way. Attempting to use a resource after it's been freed will throw an exception.

    Returns void

  • getElementById(id: string): null | Node
  • Looks up an element by its ID

    If ID tracking was previously enabled, this operation is ~O(1), otherwise it is O(n)

    Parameters

    • id: string

    Returns null | Node

  • getElementsByClassName(className: string): Node[]
  • Returns an array of nodes that match the given class name

    Parameters

    • className: string

    Returns Node[]

  • getPointer(): number
  • Returns number

  • innerHTML(): string
  • Returns the inner HTML of this document.

    Returns string

  • isFreed(): boolean
  • Returns boolean

  • nodeCount(): number
  • Returns the number of elements in the DOM

    Returns number

  • querySelector(selector: string): null | Node
  • Returns a handle to the HTML node that matches the given CSS selector

    Parameters

    • selector: string

    Returns null | Node

  • querySelectorAll(selector: string): Node[]
  • Returns an array of handles to the HTML nodes that match the given CSS selector

    Parameters

    • selector: string

    Returns Node[]

  • throwIfResourceFreed(): void
  • Returns void

Generated using TypeDoc