Module dom

Search:
Group by:

Declaration of the Document Object Model for the JavaScript backend.

Types

EventTarget* = ref EventTargetObj
  Source Edit
Window* = ref WindowObj
  Source Edit
Frame* = ref FrameObj
  Source Edit
ClassList* = ref ClassListObj
  Source Edit
NodeType* = enum
  ElementNode = 1, AttributeNode, TextNode, CDATANode, EntityRefNode, EntityNode,
  ProcessingInstructionNode, CommentNode, DocumentNode, DocumentTypeNode,
  DocumentFragmentNode, NotationNode
  Source Edit
Node* = ref NodeObj
  Source Edit
Document* = ref DocumentObj
  Source Edit
Element* = ref ElementObj
  Source Edit
HtmlElement* = ref object of Element
  contentEditable*: cstring
  isContentEditable*: bool
  dir*: cstring
  offsetHeight*: int
  offsetWidth*: int
  offsetLeft*: int
  offsetTop*: int
  Source Edit
LinkElement* = ref LinkObj
  Source Edit
EmbedElement* = ref EmbedObj
  Source Edit
AnchorElement* = ref AnchorObj
  Source Edit
OptionElement* = ref OptionObj
  Source Edit
FormElement* = ref FormObj
  Source Edit
ImageElement* = ref ImageObj
  Source Edit
Event* = ref EventObj
  Source Edit
TouchList* {.
importc
.} = ref object of RootObj length*: int
  Source Edit
TouchEvent* {.
importc
.} = ref object of Event changedTouches*, targetTouches*, touches*: TouchList
  Source Edit
Touch* {.
importc
.} = ref object of RootObj identifier*: int screenX*, screenY*, clientX*, clientY*, pageX*, pageY*: int target*: Element radiusX*, radiusY*: int rotationAngle*: int force*: float
  Source Edit
Location* = ref LocationObj
  Source Edit
History* = ref HistoryObj
  Source Edit
  Source Edit
TPlugin* {.
importc
.} = object of RootObj description*: cstring filename*: cstring name*: cstring
  Source Edit
TMimeType* {.
importc
.} = object of RootObj description*: cstring enabledPlugin*: ref TPlugin suffixes*: seq[cstring] `type`*: cstring
  Source Edit
TLocationBar* {.
importc
.} = object of RootObj visible*: bool
  Source Edit
TMenuBar* = TLocationBar
  Source Edit
TPersonalBar* = TLocationBar
  Source Edit
TScrollBars* = TLocationBar
  Source Edit
TToolBar* = TLocationBar
  Source Edit
TStatusBar* = TLocationBar
  Source Edit
TTimeOut* {.
importc
.} = object of RootObj
  Source Edit
TInterval* {.
importc
.} = object of RootObj
  Source Edit
AddEventListenerOptions* = object
  capture*: bool
  once*: bool
  passive*: bool
  Source Edit
TEventHandlers* {.
deprecated
.} = EventTargetObj
  Source Edit
TWindow* {.
deprecated
.} = WindowObj
  Source Edit
TFrame* {.
deprecated
.} = FrameObj
  Source Edit
TNode* {.
deprecated
.} = NodeObj
  Source Edit
TDocument* {.
deprecated
.} = DocumentObj
  Source Edit
TElement* {.
deprecated
.} = ElementObj
  Source Edit
  Source Edit
TEmbed* {.
deprecated
.} = EmbedObj
  Source Edit
TAnchor* {.
deprecated
.} = AnchorObj
  Source Edit
TOption* {.
deprecated
.} = OptionObj
  Source Edit
TForm* {.
deprecated
.} = FormObj
  Source Edit
TImage* {.
deprecated
.} = ImageObj
  Source Edit
TNodeType* {.
deprecated
.} = NodeType
  Source Edit
TEvent* {.
deprecated
.} = EventObj
  Source Edit
TLocation* {.
deprecated
.} = LocationObj
  Source Edit
THistory* {.
deprecated
.} = HistoryObj
  Source Edit
TNavigator* {.
deprecated
.} = NavigatorObj
  Source Edit
TStyle* {.
deprecated
.} = StyleObj
  Source Edit
TScreen* {.
deprecated
.} = ScreenObj
  Source Edit
TApplet* {.
importc, deprecated
.} = object of RootObj
  Source Edit

Vars

window* {.
importc, nodecl
.}: Window
  Source Edit
document* {.
importc, nodecl
.}: Document
  Source Edit
  Source Edit
screen* {.
importc, nodecl
.}: Screen
  Source Edit

Procs

proc addEventListener*(et: EventTarget; ev: cstring; cb: proc (ev: Event);
                      useCapture: bool = false)
  Source Edit
proc addEventListener*(et: EventTarget; ev: cstring; cb: proc (ev: Event);
                      options: AddEventListenerOptions)
  Source Edit
proc removeEventListener*(et: EventTarget; ev: cstring; cb: proc (ev: Event);
                         useCapture: bool = false)
  Source Edit
proc alert*(w: Window; msg: cstring)
  Source Edit
proc back*(w: Window)
  Source Edit
proc blur*(w: Window)
  Source Edit
proc captureEvents*(w: Window; eventMask: int) {.
deprecated
.}
  Source Edit
proc clearInterval*(w: Window; interval: ref TInterval)
  Source Edit
proc clearTimeout*(w: Window; timeout: ref TTimeOut)
  Source Edit
proc close*(w: Window)
  Source Edit
proc confirm*(w: Window; msg: cstring): bool
  Source Edit
proc disableExternalCapture*(w: Window)
  Source Edit
proc enableExternalCapture*(w: Window)
  Source Edit
proc find*(w: Window; text: cstring; caseSensitive = false; backwards = false)
  Source Edit
proc focus*(w: Window)
  Source Edit
proc forward*(w: Window)
  Source Edit
proc handleEvent*(w: Window; e: Event)
  Source Edit
proc home*(w: Window)
  Source Edit
proc moveBy*(w: Window; x, y: int)
  Source Edit
proc moveTo*(w: Window; x, y: int)
  Source Edit
proc open*(w: Window; uri, windowname: cstring; properties: cstring = nil): Window
  Source Edit
proc print*(w: Window)
  Source Edit
proc prompt*(w: Window; text, default: cstring): cstring
  Source Edit
proc releaseEvents*(w: Window; eventMask: int) {.
deprecated
.}
  Source Edit
proc resizeBy*(w: Window; x, y: int)
  Source Edit
proc resizeTo*(w: Window; x, y: int)
  Source Edit
proc routeEvent*(w: Window; event: Event)
  Source Edit
proc scrollBy*(w: Window; x, y: int)
  Source Edit
proc scrollTo*(w: Window; x, y: int)
  Source Edit
proc setInterval*(w: Window; code: cstring; pause: int): ref TInterval
  Source Edit
proc setInterval*(w: Window; function: proc (); pause: int): ref TInterval
  Source Edit
proc setTimeout*(w: Window; code: cstring; pause: int): ref TTimeOut
  Source Edit
proc setTimeout*(w: Window; function: proc (); pause: int): ref TInterval
  Source Edit
proc stop*(w: Window)
  Source Edit
proc requestAnimationFrame*(w: Window; function: proc (time: float)): int
  Source Edit
proc cancelAnimationFrame*(w: Window; id: int)
  Source Edit
proc appendChild*(n, child: Node)
  Source Edit
proc appendData*(n: Node; data: cstring)
  Source Edit
proc cloneNode*(n: Node; copyContent: bool): Node
  Source Edit
proc deleteData*(n: Node; start, len: int)
  Source Edit
proc getAttribute*(n: Node; attr: cstring): cstring
  Source Edit
proc getAttributeNode*(n: Node; attr: cstring): Node
  Source Edit
proc hasChildNodes*(n: Node): bool
  Source Edit
proc insertBefore*(n, newNode, before: Node)
  Source Edit
proc insertData*(n: Node; position: int; data: cstring)
  Source Edit
proc removeAttribute*(n: Node; attr: cstring)
  Source Edit
proc removeAttributeNode*(n, attr: Node)
  Source Edit
proc removeChild*(n, child: Node)
  Source Edit
proc replaceChild*(n, newNode, oldNode: Node)
  Source Edit
proc replaceData*(n: Node; start, len: int; text: cstring)
  Source Edit
proc scrollIntoView*(n: Node)
  Source Edit
proc setAttribute*(n: Node; name, value: cstring)
  Source Edit
proc setAttributeNode*(n: Node; attr: Node)
  Source Edit
proc captureEvents*(d: Document; eventMask: int) {.
deprecated
.}
  Source Edit
proc createAttribute*(d: Document; identifier: cstring): Node
  Source Edit
proc createElement*(d: Document; identifier: cstring): Element
  Source Edit
proc createTextNode*(d: Document; identifier: cstring): Node
  Source Edit
proc getElementById*(d: Document; id: cstring): Element
  Source Edit
proc getElementsByName*(d: Document; name: cstring): seq[Element]
  Source Edit
proc getElementsByTagName*(d: Document; name: cstring): seq[Element]
  Source Edit
proc getElementsByClassName*(d: Document; name: cstring): seq[Element]
  Source Edit
proc getSelection*(d: Document): cstring
  Source Edit
proc handleEvent*(d: Document; event: Event)
  Source Edit
proc open*(d: Document)
  Source Edit
proc releaseEvents*(d: Document; eventMask: int) {.
deprecated
.}
  Source Edit
proc routeEvent*(d: Document; event: Event)
  Source Edit
proc write*(d: Document; text: cstring)
  Source Edit
proc writeln*(d: Document; text: cstring)
  Source Edit
proc querySelector*(d: Document; selectors: cstring): Element
  Source Edit
proc querySelectorAll*(d: Document; selectors: cstring): seq[Element]
  Source Edit
proc blur*(e: Element)
  Source Edit
proc click*(e: Element)
  Source Edit
proc focus*(e: Element)
  Source Edit
proc handleEvent*(e: Element; event: Event)
  Source Edit
proc select*(e: Element)
  Source Edit
proc getElementsByTagName*(e: Element; name: cstring): seq[Element]
  Source Edit
proc getElementsByClassName*(e: Element; name: cstring): seq[Element]
  Source Edit
proc reset*(f: FormElement)
  Source Edit
proc submit*(f: FormElement)
  Source Edit
proc play*(e: EmbedElement)
  Source Edit
proc stop*(e: EmbedElement)
  Source Edit
proc reload*(loc: Location)
  Source Edit
proc replace*(loc: Location; s: cstring)
  Source Edit
proc back*(h: History)
  Source Edit
proc forward*(h: History)
  Source Edit
proc go*(h: History; pagesToJump: int)
  Source Edit
proc pushState*[T](h: History; stateObject: T; title, url: cstring)
  Source Edit
proc javaEnabled*(h: Navigator): bool
  Source Edit
proc add*(c: ClassList; class: cstring)
  Source Edit
proc remove*(c: ClassList; class: cstring)
  Source Edit
proc contains*(c: ClassList; class: cstring): bool
  Source Edit
proc toggle*(c: ClassList; class: cstring)
  Source Edit
proc getAttribute*(s: Style; attr: cstring; caseSensitive = false): cstring
  Source Edit
proc removeAttribute*(s: Style; attr: cstring; caseSensitive = false)
  Source Edit
proc setAttribute*(s: Style; attr, value: cstring; caseSensitive = false)
  Source Edit
proc preventDefault*(ev: Event)
  Source Edit
proc identifiedTouch*(list: TouchList): Touch
  Source Edit
proc item*(list: TouchList; i: int): Touch
  Source Edit
proc decodeURI*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc encodeURI*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc escape*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc unescape*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc decodeURIComponent*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc encodeURIComponent*(uri: cstring): cstring {.
importc, nodecl
.}
  Source Edit
proc isFinite*(x: BiggestFloat): bool {.
importc, nodecl
.}
  Source Edit
proc isNaN*(x: BiggestFloat): bool {.
importc, nodecl
.}
  Source Edit
proc parseFloat*(s: cstring): BiggestFloat {.
importc, nodecl
.}
  Source Edit
proc parseInt*(s: cstring): int {.
importc, nodecl
.}
  Source Edit
proc parseInt*(s: cstring; radix: int): int {.
importc, nodecl
.}
  Source Edit