Skip to content

Commit

Permalink
fix(types): add varargs to hook callback annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Dec 7, 2023
1 parent b0107dc commit 15f9918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/resession/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,14 @@ end

---Add a callback that runs at a specific time
---@param name "pre_save"|"post_save"|"pre_load"|"post_load"
---@param callback fun()
---@param callback fun(...: any)
M.add_hook = function(name, callback)
table.insert(hooks[name], callback)
end

---Remove a hook callback
---@param name "pre_save"|"post_save"|"pre_load"|"post_load"
---@param callback fun()
---@param callback fun(...: any)
M.remove_hook = function(name, callback)
local cbs = hooks[name]
for i, cb in ipairs(cbs) do
Expand Down

0 comments on commit 15f9918

Please sign in to comment.