Skip to content

Commit

Permalink
Fix the getSelection method. (#13632)
Browse files Browse the repository at this point in the history
  • Loading branch information
treeform authored Apr 21, 2020
1 parent b8b0e9b commit 89e6a7a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/js/dom.nim
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ type
memory*: PerformanceMemory
timing*: PerformanceTiming

Selection* {.importc.} = ref object ## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Selection>`_

LocalStorage* {.importc.} = ref object

Window* = ref WindowObj
Expand Down Expand Up @@ -1155,7 +1157,7 @@ proc createAttribute*(d: Document, identifier: cstring): Node
proc getElementsByName*(d: Document, name: cstring): seq[Element]
proc getElementsByTagName*(d: Document, name: cstring): seq[Element]
proc getElementsByClassName*(d: Document, name: cstring): seq[Element]
proc getSelection*(d: Document): cstring
proc getSelection*(d: Document): Selection
proc handleEvent*(d: Document, event: Event)
proc open*(d: Document)
proc releaseEvents*(d: Document, eventMask: int) {.deprecated.}
Expand Down Expand Up @@ -1245,6 +1247,11 @@ proc slice*(e: Blob, startindex: int = 0, endindex: int = e.size, contentType: c
# Performance "methods"
proc now*(p: Performance): float

# Selection "methods"
proc removeAllRanges*(s: Selection)
converter toString*(s: Selection): cstring
proc `$`*(s: Selection): string = $(s.toString())

# LocalStorage "methods"
proc getItem*(ls: LocalStorage, key: cstring): cstring
proc setItem*(ls: LocalStorage, key, value: cstring)
Expand Down

0 comments on commit 89e6a7a

Please sign in to comment.