
---@class copas_timer_options*
---@field delay? number Delay in seconds.
---@field recurring? boolean Whether to repeat.
---@field params? any[] callback parameters.
---@field callback function callback function.

---@class copas_timer_module*
---@type copas_timer_module*
local M = {}

---@class copas_timer_object*
local copas_timer_object = {}

--- Create a timer.
---@param opts copas_timer_options* options.
---@return copas_timer_object* timer timer object.
function M.new(opts) end

--- Start the timer.
---@param initial_delay? number Initial delay.
---@return copas_timer_object*|nil timer timer object.
---@return string? errMsg error message.
function copas_timer_object:arm(initial_delay) end

--- Cancel the timer.
---@return copas_timer_object*|nil timer timer object.
---@return string? errMsg error message.
function copas_timer_object:cancel() end

return M
