2022-02-25 22:00:39 +00:00
|
|
|
--- @meta
|
|
|
|
|
|
|
|
local bait = {}
|
|
|
|
|
|
|
|
--- Catches a hook with `name`. Runs the `cb` when it is thrown
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param name string
|
|
|
|
--- @param cb function
|
|
|
|
function bait.catch(name, cb) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
|
|
|
--- Same as catch, but only runs the `cb` once and then removes the hook
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param name string
|
|
|
|
--- @param cb function
|
|
|
|
function bait.catchOnce(name, cb) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
2022-12-21 00:59:55 +00:00
|
|
|
--- Returns a table with hooks (callback functions) on the event with `name`.
|
2022-12-02 00:05:24 +00:00
|
|
|
--- @param name string
|
2022-12-21 00:59:55 +00:00
|
|
|
--- @returns table<function>
|
2022-12-02 00:05:24 +00:00
|
|
|
function bait.hooks(name) end
|
2022-10-11 21:43:22 +00:00
|
|
|
|
2023-02-07 22:19:24 +00:00
|
|
|
--- Removes the `catcher` for the event with `name`.
|
2022-08-17 22:01:55 +00:00
|
|
|
--- For this to work, `catcher` has to be the same function used to catch
|
|
|
|
--- an event, like one saved to a variable.
|
2022-12-02 00:05:24 +00:00
|
|
|
--- @param name string
|
|
|
|
--- @param catcher function
|
|
|
|
function bait.release(name, catcher) end
|
2022-08-17 22:01:55 +00:00
|
|
|
|
2022-02-25 22:00:39 +00:00
|
|
|
--- Throws a hook with `name` with the provided `args`
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param name string
|
|
|
|
--- @vararg any
|
2022-12-15 04:00:54 +00:00
|
|
|
function bait.throw(name, ...args) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
|
|
|
return bait
|