diff options
Diffstat (limited to 'lib/js/dom.nim')
-rw-r--r-- | lib/js/dom.nim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim index 5a33dfa9f..a879ddb61 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -130,6 +130,16 @@ type readOnly*: bool options*: seq[OptionElement] + # https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement + HtmlElement* = ref object of Element + contentEditable*: string + isContentEditable*: bool + dir*: string + offsetHeight*: int + offsetWidth*: int + offsetLeft*: int + offsetTop*: int + LinkElement* = ref LinkObj LinkObj {.importc.} = object of ElementObj target*: cstring @@ -270,6 +280,8 @@ type wordSpacing*: cstring zIndex*: int + # TODO: A lot of the fields in Event belong to a more specific type of event. + # TODO: Should we clean this up? Event* = ref EventObj EventObj {.importc.} = object of RootObj target*: Node @@ -310,6 +322,20 @@ type SUBMIT*: int UNLOAD*: int + TouchList* {.importc.} = ref object of RootObj + length*: int + + TouchEvent* {.importc.} = ref object of Event + changedTouches*, targetTouches*, touches*: TouchList + + Touch* {.importc.} = ref object of RootObj + identifier*: int + screenX*, screenY*, clientX*, clientY*, pageX*, pageY*: int + target*: Element + radiusX*, radiusY*: int + rotationAngle*: int + force*: float + Location* = ref LocationObj LocationObj {.importc.} = object of RootObj hash*: cstring @@ -488,6 +514,10 @@ proc setAttribute*(s: Style, attr, value: cstring, caseSensitive=false) # Event "methods" proc preventDefault*(ev: Event) +# TouchEvent "methods" +proc identifiedTouch*(list: TouchList): Touch +proc item*(list: TouchList, i: int): Touch + {.pop.} var |