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
+8 -5
View File
@@ -237,17 +237,20 @@ state.new() *state.new*
(lz.n.handler.State)
lz.n.handler.State *lz.n.handler.State*
lz.n.handler.State *lz.n.handler.State*
Fields: ~
{insert} (fun(key?:string,plugin:lz.n.Plugin))
Insert a plugin (optionally, by key).
{insert} (fun(key:string,plugin:lz.n.Plugin)|fun(plugin:lz.n.Plugin))
Insert a plugin (optionally, by key).
{del} (fun(plugin_name:string,callback?:fun(key:string)))
Remove a plugin by its name.
Remove a plugin by its name.
{has_pending_plugins} (fun(key?:string):boolean)
Check if there are pending plugins (optionally, by key)
Check if there are pending plugins (optionally, by key)
{lookup_plugin} (fun(plugin_name:string):lz.n.Plugin)
Lookup a plugin by its name.
Lookup a plugin by its name.
vim:tw=78:ts=8:noet:ft=help:norl:
+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