Skip to content

Commit

Permalink
fix(types): add varargs to hook callback annotations (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy authored Dec 10, 2023
1 parent 7fa6614 commit c359b89
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 c359b89

Please sign in to comment.