diff options
Diffstat (limited to 'lib/js/dom.nim')
-rw-r--r-- | lib/js/dom.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim index a879ddb61..cdefc772c 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -57,6 +57,7 @@ type status*: cstring toolbar*: ref TToolBar frames*: seq[TFrame] + screen*: Screen Frame* = ref FrameObj FrameObj {.importc.} = object of WindowObj @@ -129,6 +130,7 @@ type name*: cstring readOnly*: bool options*: seq[OptionElement] + clientWidth*, clientHeight*: int # https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement HtmlElement* = ref object of Element @@ -393,10 +395,17 @@ type TTimeOut* {.importc.} = object of RootObj TInterval* {.importc.} = object of RootObj + AddEventListenerOptions* = object + capture*: bool + once*: bool + passive*: bool + {.push importcpp.} # EventTarget "methods" proc addEventListener*(et: EventTarget, ev: cstring, cb: proc(ev: Event), useCapture: bool = false) +proc addEventListener*(et: EventTarget, ev: cstring, cb: proc(ev: Event), options: AddEventListenerOptions) + # Window "methods" proc alert*(w: Window, msg: cstring) @@ -470,6 +479,8 @@ proc releaseEvents*(d: Document, eventMask: int) {.deprecated.} proc routeEvent*(d: Document, event: Event) proc write*(d: Document, text: cstring) proc writeln*(d: Document, text: cstring) +proc querySelector*(d: Document, selectors: cstring): Element +proc querySelectorAll*(d: Document, selectors: cstring): seq[Element] # Element "methods" proc blur*(e: Element) |