Skip to content

Commit 4753247

Browse files
committed
doc: Added basic types
1 parent 32f74a0 commit 4753247

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

lua/bars.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ A *fancy* `bars & lines` plugin for `Neovim`.
99
local bars = {};
1010

1111
--[[ Executes an `action`. ]]
12-
---@param action string
13-
---@param on string[]
12+
---@param action bars.command
13+
---@param on bars.target[]
1414
---@param ... any
1515
bars.exec = function (action, on, ...)
1616
local modules = { "statusline", "statuscolumn", "winbar", "tabline" };
@@ -27,7 +27,9 @@ bars.exec = function (action, on, ...)
2727
end
2828
end
2929

30+
---@param config? bars.config
3031
bars.setup = function (config)
32+
---@diagnostic disable-next-line: param-type-mismatch
3133
for k, v in pairs(config) do
3234
local could_load, submodule = pcall(require, "bars." .. k);
3335

lua/bars/types/bars.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---@meta
2+
3+
---@alias bars.command
4+
---| "Disable" Disable `bar/line` for **all** windows.
5+
---| "Enable" Enable `bar/line` for **all** windows.
6+
---| "Start" Start a `bar/line`.
7+
---| "Stop" Stop a `bar/line`.
8+
---| "Toggle" Toggle `bar/line` for **all** windows.
9+
---| "disable" Disable `bar/line` for **specific** window.
10+
---| "enable" Enable `bar/line` for **specific** window.
11+
---| "toggle" Toggle `bar/line` for **specific** window.
12+
---| "update" Update *style* of a `bar/line` for **specific** window.
13+
14+
--[[ Target for a command. ]]
15+
---@alias bars.target
16+
---| "statuscolumn"
17+
---| "statusline"
18+
---| "tabline"
19+
---| "winbar"
20+
21+
--[[ Configuration for `bars.nvim`. ]]
22+
---@class bars.config
23+
---
24+
---@field statuscolumn? table | boolean
25+
---@field statusline? table | boolean
26+
---@field tabline? table | boolean
27+
---@field winbar? table | boolean

0 commit comments

Comments
 (0)