Cleanup interval and timeout procs (#18431)
clear/setTimeout procs were using ref ref Timeout. Added more interval overloads. Corrections.
This commit is contained in:
parent
927a832dde
commit
36654fd577
1 changed files with 10 additions and 8 deletions
|
|
@ -1301,7 +1301,7 @@ type
|
||||||
width*: int
|
width*: int
|
||||||
|
|
||||||
TimeOut* {.importc.} = ref object of RootObj
|
TimeOut* {.importc.} = ref object of RootObj
|
||||||
Interval* {.importc.} = object of RootObj
|
Interval* {.importc.} = ref object of RootObj
|
||||||
|
|
||||||
AddEventListenerOptions* = object
|
AddEventListenerOptions* = object
|
||||||
capture*: bool
|
capture*: bool
|
||||||
|
|
@ -1481,6 +1481,8 @@ else:
|
||||||
|
|
||||||
proc setTimeout*(action: proc(); ms: int): TimeOut {.importc, nodecl.}
|
proc setTimeout*(action: proc(); ms: int): TimeOut {.importc, nodecl.}
|
||||||
proc clearTimeout*(t: TimeOut) {.importc, nodecl.}
|
proc clearTimeout*(t: TimeOut) {.importc, nodecl.}
|
||||||
|
proc setInterval*(action: proc(); ms: int): Interval {.importc, nodecl.}
|
||||||
|
proc clearInterval*(i: Interval) {.importc, nodecl.}
|
||||||
|
|
||||||
{.push importcpp.}
|
{.push importcpp.}
|
||||||
|
|
||||||
|
|
@ -1494,8 +1496,8 @@ proc removeEventListener*(et: EventTarget; ev: cstring; cb: proc(ev: Event))
|
||||||
proc alert*(w: Window, msg: cstring)
|
proc alert*(w: Window, msg: cstring)
|
||||||
proc back*(w: Window)
|
proc back*(w: Window)
|
||||||
proc blur*(w: Window)
|
proc blur*(w: Window)
|
||||||
proc clearInterval*(w: Window, interval: ref Interval)
|
proc clearInterval*(w: Window, interval: Interval)
|
||||||
proc clearTimeout*(w: Window, timeout: ref TimeOut)
|
proc clearTimeout*(w: Window, timeout: TimeOut)
|
||||||
proc close*(w: Window)
|
proc close*(w: Window)
|
||||||
proc confirm*(w: Window, msg: cstring): bool
|
proc confirm*(w: Window, msg: cstring): bool
|
||||||
proc disableExternalCapture*(w: Window)
|
proc disableExternalCapture*(w: Window)
|
||||||
|
|
@ -1520,10 +1522,10 @@ proc resizeTo*(w: Window, x, y: int)
|
||||||
proc routeEvent*(w: Window, event: Event)
|
proc routeEvent*(w: Window, event: Event)
|
||||||
proc scrollBy*(w: Window, x, y: int)
|
proc scrollBy*(w: Window, x, y: int)
|
||||||
proc scrollTo*(w: Window, x, y: int)
|
proc scrollTo*(w: Window, x, y: int)
|
||||||
proc setInterval*(w: Window, code: cstring, pause: int): ref Interval
|
proc setInterval*(w: Window, code: cstring, pause: int): Interval
|
||||||
proc setInterval*(w: Window, function: proc (), pause: int): ref Interval
|
proc setInterval*(w: Window, function: proc (), pause: int): Interval
|
||||||
proc setTimeout*(w: Window, code: cstring, pause: int): ref TimeOut
|
proc setTimeout*(w: Window, code: cstring, pause: int): TimeOut
|
||||||
proc setTimeout*(w: Window, function: proc (), pause: int): ref Interval
|
proc setTimeout*(w: Window, function: proc (), pause: int): Interval
|
||||||
proc stop*(w: Window)
|
proc stop*(w: Window)
|
||||||
proc requestAnimationFrame*(w: Window, function: proc (time: float)): int
|
proc requestAnimationFrame*(w: Window, function: proc (time: float)): int
|
||||||
proc cancelAnimationFrame*(w: Window, id: int)
|
proc cancelAnimationFrame*(w: Window, id: int)
|
||||||
|
|
@ -1768,4 +1770,4 @@ since (1, 3):
|
||||||
proc readAsDataURL*(f: FileReader, b: Blob) {.importcpp: "#.readAsDataURL(#)".}
|
proc readAsDataURL*(f: FileReader, b: Blob) {.importcpp: "#.readAsDataURL(#)".}
|
||||||
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
|
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
|
||||||
proc readAsText*(f: FileReader, b: Blob|File, encoding = cstring"UTF-8") {.importcpp: "#.readAsText(#, #)".}
|
proc readAsText*(f: FileReader, b: Blob|File, encoding = cstring"UTF-8") {.importcpp: "#.readAsText(#, #)".}
|
||||||
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText
|
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue