diff --git a/README.md b/README.md index 2df4ec2..0078a18 100644 --- a/README.md +++ b/README.md @@ -44,14 +44,6 @@ for any unclear types. - [Using lazydev.nvim](#using-lazydevnvim) - [Using The Built-in Neovim LSP](#using-the-built-in-neovim-lsp) - [Featured Plugins](#featured-plugins) - - [ai-commander.wezterm](#ai-commanderwezterm) - - [ai-helper.wezterm](#ai-helperwezterm) - - [modal.wezterm](#modalwezterm) - - [presentation.wez](#presentationwez) - - [tabline.wez](#tablinewez) - - [wez-pain-control](#wez-pain-control) - - [wez-tmux](#wez-tmux) - - [wezterm-config.nvim](#wezterm-confignvim) - [License](#license) --- @@ -170,7 +162,61 @@ This project also features type annotations for various WezTerm plugins. **_If you want to have your plugin featured please request it through an issue._** -### ai-commander.wezterm +
+dev.wezterm (SPECIAL CASE) + +You can import type annotations for +[`ChrisGVE/dev.wezterm`](https://github.com/ChrisGVE/dev.wezterm) as shown below: + +```lua +---@type Dev +local dev = wezterm.plugin.require("https://github.com/ChrisGVE/dev.wezterm") +``` + +This integration also adds the following events to `wezterm.on()`: + +- `dev.wezterm-plugin-not-found` +- `dev.wezterm.invalid_hashkey` +- `dev.wezterm.invalid_opts` +- `dev.wezterm.no_keywords` +- `dev.wezterm.require_path_not_set` + +```lua +---Either no `hashkey` or an invalid one provided. +--- +---@param event "dev.wezterm.invalid_hashkey" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---Invalid options provided to plugin setup. +--- +---@param event "dev.wezterm.invalid_opts" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---No keywords were provided for searching the plugin. +--- +---@param event "dev.wezterm.no_keywords" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---The plugin was not found and thus `package.path` could not be set. +--- +---@param event "dev.wezterm.require_path_not_set" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---The provided keywords did not allow for the plugin to be found. +--- +---@param event "dev.wezterm-plugin-not-found" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end +``` + +
+
+
+ai-commander.wezterm You can import type annotations for [`dimao/ai-commander.wezterm`](https://github.com/dimao/ai-commander.wezterm) as shown below: @@ -180,7 +226,10 @@ You can import type annotations for local ai_commander = wezterm.plugin.require("https://github.com/dimao/ai-commander.wezterm") ``` -### ai-helper.wezterm +
+ +
+ai-helper.wezterm You can import type annotations for [`Michal1993r/ai-helper.wezterm`](https://github.com/Michal1993r/ai-helper.wezterm) as shown below: @@ -190,7 +239,10 @@ You can import type annotations for local ai_helper = wezterm.plugin.require("https://github.com/Michal1993r/ai-helper.wezterm") ``` -### modal.wezterm +
+ +
+modal.wezterm You can import type annotations for [`MLFlexer/modal.wezterm`](https://github.com/MLFlexer/modal.wezterm) as shown below: @@ -200,7 +252,10 @@ You can import type annotations for local modal = wezterm.plugin.require("https://github.com/MLFlexer/modal.wezterm") ``` -### presentation.wez +
+ +
+presentation.wez You can import type annotations for [`xarvex/presentation.wez`](https://github.com/xarvex/presentation.wez) as shown below: @@ -210,7 +265,10 @@ You can import type annotations for local presentation = wezterm.plugin.require("https://github.com/xarvex/presentation.wez") ``` -### tabline.wez +
+ +
+tabline.wez You can import type annotations for [`michaelbrusegard/tabline.wez`](https://github.com/michaelbrusegard/tabline.wez) as show below: @@ -220,7 +278,10 @@ You can import type annotations for local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabline.wez") ``` -### wez-pain-control +
+ +
+wez-pain-control You can import type annotations for [`sei40kr/wez-pain-control`](https://github.com/sei40kr/wez-pain-control) as shown below: @@ -237,7 +298,10 @@ Or, if you've installed it locally: local wez_pain_control = require("wez-pain-control.plugin") ``` -### wez-tmux +
+ +
+wez-tmux You can import type annotations for [`sei40kr/wez-tmux`](https://github.com/sei40kr/wez-tmux) as shown below: @@ -254,7 +318,10 @@ Or, if you've installed it locally: local wez_tmux = require("plugins.wez-tmux.plugin") ``` -### wezterm-config.nvim +
+ +
+wezterm-config.nvim You can import type annotations for [`winter-again/wezterm-config.nvim`](https://github.com/winter-again/wezterm-config.nvim) @@ -265,6 +332,8 @@ as shown below: local wezterm_config_nvim = wezterm.plugin.require('https://github.com/winter-again/wezterm-config.nvim') ``` +
+ --- ## Collaborators diff --git a/lua/wezterm/types/plugins/dev-wezterm.lua b/lua/wezterm/types/plugins/dev-wezterm.lua new file mode 100644 index 0000000..6d03762 --- /dev/null +++ b/lua/wezterm/types/plugins/dev-wezterm.lua @@ -0,0 +1,62 @@ +---@meta +---@diagnostic disable:unused-local + +---@enum (key) Behavior +local behavior = { + error = 1, + keep = 1, + force = 1, +} + +---@class DevOpts +---@field keywords? string[] +---@field auto? boolean +---@field ignore_branch? string[]|string +---@field fetch_branch? boolean + +---@class CacheElement +---@field keywords? string[] +---@field plugin_path? string +---@field require_path? string +---@field error? boolean +---@field fetch_branch? boolean +---@field auto? boolean +---@field ignore_branch? string[]|string +---@field branch? string +---@field file? string + +---@class Dev +---@field dev_cache_element CacheElement +---@field cache table +---@field substitutions table|nil +---@field utils boolean +---@field bootstrap boolean +local M = {} + +---@param hashkey string +---@return string|nil plugin_path +function M.get_plugin_path(hashkey) end + +---@param hashkey string +---@return string|nil require_path +function M.get_require_path(hashkey) end + +---Set the wezterm require path for the plugin. +--- +---@param hashkey string +function M.set_wezterm_require_path(hashkey) end + +---@param url string +---@param opts? DevOpts +---@return any? +function M.require(url, opts) end + +---@param opts? DevOpts +---@return string|nil hashkey +---@return string|nil plugin_path +function M.setup(opts) end + +---@param substitute_dict table +function M.set_substitutions(substitute_dict) end + +-- vim: set ts=2 sts=2 sw=2 et ai si sta: diff --git a/lua/wezterm/types/wezterm.lua b/lua/wezterm/types/wezterm.lua index 48c83b3..0fbcd61 100644 --- a/lua/wezterm/types/wezterm.lua +++ b/lua/wezterm/types/wezterm.lua @@ -1739,6 +1739,50 @@ function Wezterm.on(event, callback) end ---@param callback CallbackWindowPane function Wezterm.on(event, callback) end +---============================= dev.wezterm ======================================= + +---This is for `dev.wezterm` only! +------ +---Either no `hashkey` or an invalid one provided. +--- +---@param event "dev.wezterm.invalid_hashkey" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---This is for `dev.wezterm` only! +------ +---Invalid options provided to plugin setup. +--- +---@param event "dev.wezterm.invalid_opts" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---This is for `dev.wezterm` only! +------ +---No keywords were provided for searching the plugin. +--- +---@param event "dev.wezterm.no_keywords" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---This is for `dev.wezterm` only! +------ +---The plugin was not found and thus `package.path` could not be set. +--- +---@param event "dev.wezterm.require_path_not_set" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---This is for `dev.wezterm` only! +------ +---The provided keywords did not allow for the plugin to be found. +--- +---@param event "dev.wezterm-plugin-not-found" This is for `dev.wezterm` only! +---@param callback function +function Wezterm.on(event, callback) end + +---================================================================================= + ---This function opens the specified `path_or_url` with ---either the specified application or the default application ---if `application` was not passed in.