mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
Cleanup interval and timeout procs (#18431)
clear/setTimeout procs were using ref ref Timeout. Added more interval overloads. Corrections.
This commit is contained in:
@@ -1301,7 +1301,7 @@ type
|
||||
width*: int
|
||||
|
||||
TimeOut* {.importc.} = ref object of RootObj
|
||||
Interval* {.importc.} = object of RootObj
|
||||
Interval* {.importc.} = ref object of RootObj
|
||||
|
||||
AddEventListenerOptions* = object
|
||||
capture*: bool
|
||||
@@ -1481,6 +1481,8 @@ else:
|
||||
|
||||
proc setTimeout*(action: proc(); ms: int): 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.}
|
||||
|
||||
@@ -1494,8 +1496,8 @@ proc removeEventListener*(et: EventTarget; ev: cstring; cb: proc(ev: Event))
|
||||
proc alert*(w: Window, msg: cstring)
|
||||
proc back*(w: Window)
|
||||
proc blur*(w: Window)
|
||||
proc clearInterval*(w: Window, interval: ref Interval)
|
||||
proc clearTimeout*(w: Window, timeout: ref TimeOut)
|
||||
proc clearInterval*(w: Window, interval: Interval)
|
||||
proc clearTimeout*(w: Window, timeout: TimeOut)
|
||||
proc close*(w: Window)
|
||||
proc confirm*(w: Window, msg: cstring): bool
|
||||
proc disableExternalCapture*(w: Window)
|
||||
@@ -1520,10 +1522,10 @@ proc resizeTo*(w: Window, x, y: int)
|
||||
proc routeEvent*(w: Window, event: Event)
|
||||
proc scrollBy*(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, function: proc (), pause: int): ref Interval
|
||||
proc setTimeout*(w: Window, code: cstring, pause: int): ref TimeOut
|
||||
proc setTimeout*(w: Window, function: proc (), pause: int): ref Interval
|
||||
proc setInterval*(w: Window, code: cstring, pause: int): Interval
|
||||
proc setInterval*(w: Window, function: proc (), pause: int): Interval
|
||||
proc setTimeout*(w: Window, code: cstring, pause: int): TimeOut
|
||||
proc setTimeout*(w: Window, function: proc (), pause: int): Interval
|
||||
proc stop*(w: Window)
|
||||
proc requestAnimationFrame*(w: Window, function: proc (time: float)): int
|
||||
proc cancelAnimationFrame*(w: Window, id: int)
|
||||
@@ -1768,4 +1770,4 @@ since (1, 3):
|
||||
proc readAsDataURL*(f: FileReader, b: Blob) {.importcpp: "#.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(#, #)".}
|
||||
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText
|
||||
## https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText
|
||||
|
||||
Reference in New Issue
Block a user