@antiraid-ext/concurrency
API reference for @antiraid-ext/concurrency
@antiraid-ext/concurrency
Functions
setTimeout
Implementation of setTimeout for the AntiRaid runtime.
Functions like JavaScript's setTimeout.
Function Signature
--- Implementation of setTimeout for the AntiRaid runtime.
---
--- Functions like JavaScript's setTimeout.
---
--- @param callback The function to call after the delay.
--- @param delay The delay in milliseconds. If a string is passed, it will be converted to a number.
--- @param ... Additional arguments to pass to the callback function.
--- @return tid The timeout ID, which can be used to cancel the timeout with \`clearTimeout\`.
function setTimeout(callback: (any) -> (), delay: number?, ...) -> number end
Arguments
callback
The function to call after the delay.
Function Signature
callback: (any) -> ()
Arguments
arg1
delay
The delay in milliseconds. If a string is passed, it will be converted to a number.
This field is optional and may not be specified
...
Additional arguments to pass to the callback function.
No type specified!!!
Returns
tid
The timeout ID, which can be used to cancel the timeout with `clearTimeout`.
clearTimeout
Implementation of clearTimeout for the AntiRaid runtime.
Functions like JavaScript's clearTimeout.
Function Signature
--- Implementation of clearTimeout for the AntiRaid runtime.
---
--- Functions like JavaScript's clearTimeout.
---
--- @param tid The timeout ID to cancel.
--- @return nil
function clearTimeout(tid: number) end
Arguments
tid
The timeout ID to cancel.
setInterval
Implementation of setInterval for the AntiRaid runtime.
Functions like JavaScript's setInterval.
Function Signature
--- Implementation of setInterval for the AntiRaid runtime.
---
--- Functions like JavaScript's setInterval.
---
--- @param callback The function to call at each interval.
--- @param delay The delay in milliseconds. If a string is passed, it will be converted to a number.
--- @param ... Additional arguments to pass to the callback function.
--- @return tid The interval ID, which can be used to cancel the interval with \`clear
function setInterval(callback: (any) -> (), delay: number?, ...) -> number end
Arguments
callback
The function to call at each interval.
Function Signature
callback: (any) -> ()
Arguments
arg1
delay
The delay in milliseconds. If a string is passed, it will be converted to a number.
This field is optional and may not be specified
...
Additional arguments to pass to the callback function.
No type specified!!!
Returns
tid
The interval ID, which can be used to cancel the interval with `clear
clearInterval
Implementation of clearInterval for the AntiRaid runtime.
Functions like JavaScript's clearInterval.
Function Signature
--- Implementation of clearInterval for the AntiRaid runtime.
---
--- Functions like JavaScript's clearInterval.
---
--- @param tid The interval ID to cancel.
--- @return nil
function clearInterval(tid: number) end
Arguments
tid
The interval ID to cancel.
Last updated on