Module dom

Declaration of the Document Object Model for the JavaScript backend.

Types

TEventHandlers* {.importc.} = object of RootObj
  onabort*: proc (event: ref TEvent) {.nimcall.}
  onblur*: proc (event: ref TEvent) {.nimcall.}
  onchange*: proc (event: ref TEvent) {.nimcall.}
  onclick*: proc (event: ref TEvent) {.nimcall.}
  ondblclick*: proc (event: ref TEvent) {.nimcall.}
  onerror*: proc (event: ref TEvent) {.nimcall.}
  onfocus*: proc (event: ref TEvent) {.nimcall.}
  onkeydown*: proc (event: ref TEvent) {.nimcall.}
  onkeypress*: proc (event: ref TEvent) {.nimcall.}
  onkeyup*: proc (event: ref TEvent) {.nimcall.}
  onload*: proc (event: ref TEvent) {.nimcall.}
  onmousedown*: proc (event: ref TEvent) {.nimcall.}
  onmousemove*: proc (event: ref TEvent) {.nimcall.}
  onmouseout*: proc (event: ref TEvent) {.nimcall.}
  onmouseover*: proc (event: ref TEvent) {.nimcall.}
  onmouseup*: proc (event: ref TEvent) {.nimcall.}
  onreset*: proc (event: ref TEvent) {.nimcall.}
  onselect*: proc (event: ref TEvent) {.nimcall.}
  onsubmit*: proc (event: ref TEvent) {.nimcall.}
  onunload*: proc (event: ref TEvent) {.nimcall.}
  addEventListener*: proc (ev: cstring; cb: proc (ev: ref TEvent);
                         useCapture: bool = false) {.nimcall.}
  Source
Window* = ref WindowObj
  Source
Frame* = ref FrameObj
  Source
ClassList* {.importc.} = object of RootObj
  add*: proc (class: cstring) {.nimcall.}
  remove*: proc (class: cstring) {.nimcall.}
  contains*: proc (class: cstring): bool {.nimcall.}
  toggle*: proc (class: cstring) {.nimcall.}
  Source
TNodeType* = enum
  ElementNode = 1, AttributeNode, TextNode, CDATANode, EntityRefNode, EntityNode,
  ProcessingInstructionNode, CommentNode, DocumentNode, DocumentTypeNode,
  DocumentFragmentNode, NotationNode
  Source
Node* = ref NodeObj
  Source
Document* = ref DocumentObj
  Source
Element* = ref ElementObj
  Source
LinkElement* = ref LinkObj
  Source
EmbedElement* = ref EmbedObj
  Source
AnchorElement* = ref AnchorObj
  Source
TApplet* {.importc.} = object of RootObj
  Source
OptionElement* = ref OptionObj
  Source
FormElement* = ref FormObj
  Source
ImageElement* = ref ImageObj
  Source
TStyle* {.importc.} = object of RootObj
  background*: cstring
  backgroundAttachment*: cstring
  backgroundColor*: cstring
  backgroundImage*: cstring
  backgroundPosition*: cstring
  backgroundRepeat*: cstring
  border*: cstring
  borderBottom*: cstring
  borderBottomColor*: cstring
  borderBottomStyle*: cstring
  borderBottomWidth*: cstring
  borderColor*: cstring
  borderLeft*: cstring
  borderLeftColor*: cstring
  borderLeftStyle*: cstring
  borderLeftWidth*: cstring
  borderRight*: cstring
  borderRightColor*: cstring
  borderRightStyle*: cstring
  borderRightWidth*: cstring
  borderStyle*: cstring
  borderTop*: cstring
  borderTopColor*: cstring
  borderTopStyle*: cstring
  borderTopWidth*: cstring
  borderWidth*: cstring
  bottom*: cstring
  captionSide*: cstring
  clear*: cstring
  clip*: cstring
  color*: cstring
  cursor*: cstring
  direction*: cstring
  display*: cstring
  emptyCells*: cstring
  cssFloat*: cstring
  font*: cstring
  fontFamily*: cstring
  fontSize*: cstring
  fontStretch*: cstring
  fontStyle*: cstring
  fontVariant*: cstring
  fontWeight*: cstring
  height*: cstring
  left*: cstring
  letterSpacing*: cstring
  lineHeight*: cstring
  listStyle*: cstring
  listStyleImage*: cstring
  listStylePosition*: cstring
  listStyleType*: cstring
  margin*: cstring
  marginBottom*: cstring
  marginLeft*: cstring
  marginRight*: cstring
  marginTop*: cstring
  maxHeight*: cstring
  maxWidth*: cstring
  minHeight*: cstring
  minWidth*: cstring
  overflow*: cstring
  padding*: cstring
  paddingBottom*: cstring
  paddingLeft*: cstring
  paddingRight*: cstring
  paddingTop*: cstring
  pageBreakAfter*: cstring
  pageBreakBefore*: cstring
  position*: cstring
  right*: cstring
  scrollbar3dLightColor*: cstring
  scrollbarArrowColor*: cstring
  scrollbarBaseColor*: cstring
  scrollbarDarkshadowColor*: cstring
  scrollbarFaceColor*: cstring
  scrollbarHighlightColor*: cstring
  scrollbarShadowColor*: cstring
  scrollbarTrackColor*: cstring
  tableLayout*: cstring
  textAlign*: cstring
  textDecoration*: cstring
  textIndent*: cstring
  textTransform*: cstring
  top*: cstring
  verticalAlign*: cstring
  visibility*: cstring
  width*: cstring
  wordSpacing*: cstring
  zIndex*: int
  getAttribute*: proc (attr: cstring; caseSensitive = false): cstring {.nimcall.}
  removeAttribute*: proc (attr: cstring; caseSensitive = false) {.nimcall.}
  setAttribute*: proc (attr, value: cstring; caseSensitive = false) {.nimcall.}
  Source
TEvent* {.importc.} = object of RootObj
  target*: Node
  altKey*, ctrlKey*, shiftKey*: bool
  button*: int
  clientX*, clientY*: int
  keyCode*: int
  layerX*, layerY*: int
  modifiers*: int
  ALT_MASK*, CONTROL_MASK*, SHIFT_MASK*, META_MASK*: int
  offsetX*, offsetY*: int
  pageX*, pageY*: int
  screenX*, screenY*: int
  which*: int
  `type`*: cstring
  x*, y*: int
  ABORT*: int
  BLUR*: int
  CHANGE*: int
  CLICK*: int
  DBLCLICK*: int
  DRAGDROP*: int
  ERROR*: int
  FOCUS*: int
  KEYDOWN*: int
  KEYPRESS*: int
  KEYUP*: int
  LOAD*: int
  MOUSEDOWN*: int
  MOUSEMOVE*: int
  MOUSEOUT*: int
  MOUSEOVER*: int
  MOUSEUP*: int
  MOVE*: int
  RESET*: int
  RESIZE*: int
  SELECT*: int
  SUBMIT*: int
  UNLOAD*: int
  Source
TLocation* {.importc.} = object of RootObj
  hash*: cstring
  host*: cstring
  hostname*: cstring
  href*: cstring
  pathname*: cstring
  port*: cstring
  protocol*: cstring
  search*: cstring
  reload*: proc () {.nimcall.}
  replace*: proc (s: cstring) {.nimcall.}
  Source
THistory* {.importc.} = object of RootObj
  length*: int
  back*: proc () {.nimcall.}
  forward*: proc () {.nimcall.}
  go*: proc (pagesToJump: int) {.nimcall.}
  Source
TNavigator* {.importc.} = object of RootObj
  appCodeName*: cstring
  appName*: cstring
  appVersion*: cstring
  cookieEnabled*: bool
  language*: cstring
  platform*: cstring
  userAgent*: cstring
  javaEnabled*: proc (): bool {.nimcall.}
  mimeTypes*: seq[ref TMimeType]
  Source
TPlugin* {.importc.} = object of RootObj
  description*: cstring
  filename*: cstring
  name*: cstring
  Source
TMimeType* {.importc.} = object of RootObj
  description*: cstring
  enabledPlugin*: ref TPlugin
  suffixes*: seq[cstring]
  `type`*: cstring
  Source
TLocationBar* {.importc.} = object of RootObj
  visible*: bool
  Source
TMenuBar* = TLocationBar
  Source
TPersonalBar* = TLocationBar
  Source
TScrollBars* = TLocationBar
  Source
TToolBar* = TLocationBar
  Source
TStatusBar* = TLocationBar
  Source
TScreen* {.importc.} = object of RootObj
  availHeight*: int
  availWidth*: int
  colorDepth*: int
  height*: int
  pixelDepth*: int
  width*: int
  Source
TTimeOut* {.importc.} = object of RootObj
  Source
TInterval* {.importc.} = object of RootObj
  Source
TWindow* {.deprecated.} = WindowObj
  Source
TFrame* {.deprecated.} = FrameObj
  Source
TNode* {.deprecated.} = NodeObj
  Source
TDocument* {.deprecated.} = DocumentObj
  Source
TElement* {.deprecated.} = ElementObj
  Source
  Source
TEmbed* {.deprecated.} = EmbedObj
  Source
TAnchor* {.deprecated.} = AnchorObj
  Source
TOption* {.deprecated.} = OptionObj
  Source
TForm* {.deprecated.} = FormObj
  Source
TImage* {.deprecated.} = ImageObj
  Source

Vars

window* {.importc, nodecl.}: Window
  Source
document* {.importc, nodecl.}: Document
  Source
  Source
screen* {.importc, nodecl.}: ref TScreen
  Source

Procs

proc decodeURI*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc encodeURI*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc escape*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc unescape*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc decodeURIComponent*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc encodeURIComponent*(uri: cstring): cstring {.importc, nodecl.}
  Source
proc isFinite*(x: BiggestFloat): bool {.importc, nodecl.}
  Source
proc isNaN*(x: BiggestFloat): bool {.importc, nodecl.}
  Source
proc parseFloat*(s: cstring): BiggestFloat {.importc, nodecl.}
  Source
proc parseInt*(s: cstring): int {.importc, nodecl.}
  Source
proc parseInt*(s: cstring; radix: int): int {.importc, nodecl.}
  Source