27 lines
847 B
Lua
27 lines
847 B
Lua
---@meta
|
|
|
|
-- Generated from native/src/bindings/core/timer.cpp. Do not edit.
|
|
|
|
---@alias TimerId integer
|
|
---@alias TimerCallback fun()
|
|
|
|
---@class TimerLib
|
|
timer = {}
|
|
|
|
---Runs a callback once after a delay.
|
|
---@param intervalMs integer Positive delay; callback timing is best effort and never early.
|
|
---@param callback TimerCallback Retained until it fires or is cancelled.
|
|
---@return TimerId
|
|
function timer.after(intervalMs, callback) end
|
|
|
|
---Runs a callback repeatedly.
|
|
---@param intervalMs integer Positive interval; callback timing is best effort and never early.
|
|
---@param callback TimerCallback Retained until cancelled.
|
|
---@return TimerId
|
|
function timer.every(intervalMs, callback) end
|
|
|
|
---Cancels a timer and releases its callback.
|
|
---@param id TimerId
|
|
---@return boolean Whether an active timer was cancelled.
|
|
function timer.cancel(id) end
|