LogoAntiRaid

@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

any

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

number?

...

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`.

number

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.

number

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

any

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

number?

...

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

number

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.

number

Last updated on