chore: fix luaCATS annotations

This commit is contained in:
Marc Jakobi
2024-08-28 17:36:38 +02:00
parent 180eb920f0
commit 0d4eae4271
2 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ function state.new()
local DEFAULT_KEY = "lz.n.handler.State.DEFAULT_KEY"
---@type lz.n.handler.State
---@class lz.n.handler.State
return {
---@overload fun(key: string, plugin: lz.n.Plugin)
---@overload fun(plugin: lz.n.Plugin)
@@ -87,7 +87,7 @@ end
---@class lz.n.handler.State
---
---Insert a plugin (optionally, by key).
---@field insert fun(key?: string, plugin: lz.n.Plugin)
---@field insert fun(key: string, plugin: lz.n.Plugin) | fun(plugin: lz.n.Plugin)
---
---Remove a plugin by its name.
---@field del fun(plugin_name: string, callback?: fun(key: string))
@@ -100,6 +100,6 @@ end
---
---Safely apply a callback to all pending plugins
---(optionally, by key).
---@field each_pending fun(key?: string, callback: fun(plugin: lz.n.Plugin)): string[]
---@field each_pending fun(key: string, callback: fun(plugin: lz.n.Plugin)): string[] | fun(callback: fun(plugin: lz.n.Plugin)): string[]
return state