2022-12-27 07:30:28 +00:00
|
|
|
|
2023-01-03 09:43:10 +00:00
|
|
|
---@alias LazyPluginKind "normal"|"clean"|"disabled"
|
2022-12-27 07:30:28 +00:00
|
|
|
|
|
|
|
---@class LazyPluginState
|
|
|
|
---@field loaded? {[string]:string}|{time:number}
|
|
|
|
---@field installed boolean
|
|
|
|
---@field tasks? LazyTask[]
|
|
|
|
---@field dirty? boolean
|
|
|
|
---@field updated? {from:string, to:string}
|
|
|
|
---@field is_local boolean
|
2022-12-31 15:01:59 +00:00
|
|
|
---@field updates? {from:GitInfo, to:GitInfo}
|
2022-12-27 07:30:28 +00:00
|
|
|
---@field cloned? boolean
|
|
|
|
---@field kind? LazyPluginKind
|
|
|
|
---@field dep? boolean True if this plugin is only in the spec as a dependency
|
|
|
|
---@field cond? boolean
|
2023-01-04 08:35:00 +00:00
|
|
|
---@field super? LazyPlugin
|
2022-12-27 07:30:28 +00:00
|
|
|
|
2023-01-08 14:01:49 +00:00
|
|
|
---@alias PluginOpts table|fun(self:LazyPlugin, opts:table):table?
|
|
|
|
|
2022-12-27 07:30:28 +00:00
|
|
|
---@class LazyPluginHooks
|
2023-01-08 14:01:49 +00:00
|
|
|
---@field init? fun(self:LazyPlugin) Will always be run
|
2023-02-07 22:52:02 +00:00
|
|
|
---@field deactivate? fun(self:LazyPlugin) Unload/Stop a plugin
|
2023-01-08 14:01:49 +00:00
|
|
|
---@field config? fun(self:LazyPlugin, opts:table)|true Will be executed when loading the plugin
|
|
|
|
---@field build? string|fun(self:LazyPlugin)|(string|fun(self:LazyPlugin))[]
|
|
|
|
---@field opts? PluginOpts
|
2022-12-27 07:30:28 +00:00
|
|
|
|
|
|
|
---@class LazyPluginHandlers
|
|
|
|
---@field event? string[]
|
|
|
|
---@field cmd? string[]
|
|
|
|
---@field ft? string[]
|
2023-01-12 12:07:51 +00:00
|
|
|
---@field keys? (string|LazyKeys)[]
|
2022-12-27 07:30:28 +00:00
|
|
|
---@field module? false
|
|
|
|
|
|
|
|
---@class LazyPluginRef
|
|
|
|
---@field branch? string
|
|
|
|
---@field tag? string
|
|
|
|
---@field commit? string
|
|
|
|
---@field version? string
|
|
|
|
---@field pin? boolean
|
|
|
|
|
|
|
|
---@class LazyPluginBase
|
|
|
|
---@field [1] string?
|
|
|
|
---@field name string display name and name used for plugin config files
|
2023-02-07 22:52:02 +00:00
|
|
|
---@field main? string Entry module that has setup & deactivate
|
2022-12-27 07:30:28 +00:00
|
|
|
---@field url string?
|
|
|
|
---@field dir string
|
|
|
|
---@field enabled? boolean|(fun():boolean)
|
|
|
|
---@field cond? boolean|(fun():boolean)
|
|
|
|
---@field lazy? boolean
|
2022-12-27 16:24:40 +00:00
|
|
|
---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50
|
2022-12-27 07:30:28 +00:00
|
|
|
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
|
|
|
|
|
|
|
---@class LazyPlugin: LazyPluginBase,LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
|
|
|
|
---@field dependencies? string[]
|
|
|
|
---@field _ LazyPluginState
|
|
|
|
|
|
|
|
---@class LazyPluginSpecHandlers
|
2023-01-12 12:07:51 +00:00
|
|
|
---@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)[]
|
2022-12-27 07:30:28 +00:00
|
|
|
---@field module? false
|
|
|
|
|
|
|
|
---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef
|
|
|
|
---@field dependencies? string|string[]|LazyPluginSpec[]
|
|
|
|
|
2023-01-01 20:07:05 +00:00
|
|
|
---@alias LazySpec string|LazyPluginSpec|LazySpecImport|LazySpec[]
|
|
|
|
|
|
|
|
---@class LazySpecImport
|
|
|
|
---@field import string spec module to import
|
|
|
|
---@field enabled? boolean|(fun():boolean)
|