feat(spec): event, keys, ft and cmd can now also be a function that returns the values to be used

This commit is contained in:
Folke Lemaitre 2023-01-12 13:07:51 +01:00
parent bcd87a0215
commit 2128ca90fb
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 76 additions and 75 deletions

View file

@ -27,7 +27,7 @@
---@field event? string[]
---@field cmd? string[]
---@field ft? string[]
---@field keys? string[]
---@field keys? (string|LazyKeys)[]
---@field module? false
---@class LazyPluginRef
@ -53,10 +53,10 @@
---@field _ LazyPluginState
---@class LazyPluginSpecHandlers
---@field event? string[]|string
---@field cmd? string[]|string
---@field ft? string[]|string
---@field keys? string|string[]|LazyKeys[]
---@field event? string[]|string|fun(self:LazyPlugin, event:string[]):string[]
---@field cmd? string[]|string|fun(self:LazyPlugin, cmd:string[]):string[]
---@field ft? string[]|string|fun(self:LazyPlugin, ft:string[]):string[]
---@field keys? string|string[]|LazyKeys[]|fun(self:LazyPlugin, keys:string[]):(string|LazyKeys)[]
---@field module? false
---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef