Skip to content

Commit d7ebf08

Browse files
committed
doc: Updated type definitions
1 parent 1d5ab23 commit d7ebf08

File tree

3 files changed

+76
-16
lines changed

3 files changed

+76
-16
lines changed

lua/bars.lua

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
local bars = {};
22

3-
---@class bars.config
4-
---
5-
--- When true, all options are set
6-
--- globally.
7-
--- Can be used to prevent visible
8-
--- changes to the bars & lines when
9-
--- opening Neovim or new windows.
10-
---@field global boolean
11-
---
12-
---@field statusline statusline.config
13-
---@field statuscolumn statuscolumn.config
14-
---@field winbar winbar.config
15-
---
16-
---@field tabline tabline.config
3+
---@type bars.config
174
bars.config = {
185
global = true
196
};
207

8+
--- Setup function.
9+
--- Should be optional.
10+
---@param config bars.config | nil
2111
bars.setup = function (config)
12+
--- Update the configuration.
2213
if type(config) == "table" then
23-
--- Update configuration.
2414
bars.config = vim.tbl_deep_extend("force", bars.config, config);
2515
end
2616

lua/definitions/bars.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- Primary configuration table.
2+
---@class bars.config
3+
---
4+
--- When true, all options are set
5+
--- **globally**.
6+
--- Can be used to prevent visible
7+
--- changes to the bars & lines when
8+
--- opening Neovim or new windows.
9+
---@field global? boolean
10+
---
11+
---@field statusline? statusline.config Statusline configuration.
12+
---@field statuscolumn? statuscolumn.config Statuscolumn configuration.
13+
---@field winbar? winbar.config Winbar configuration.
14+
---
15+
---@field tabline? tabline.config Tabline configuration.

lua/definitions/statuscolumn.lua

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,42 +83,97 @@
8383
---@field hl? string | string[]
8484

8585

86+
--- Empty section.
8687
---@class statuscolumn.parts.empty
8788
---
89+
--- Condition for this component.
90+
---@field condition? fun(buffer: integer, window: integer, statuscolumn: string): boolean
91+
---
92+
--- What kind of part is this?
8893
---@field kind "empty"
94+
---
95+
--- How many columns should this span?
8996
---@field len integer
9097
---
98+
--- Highlight group for this section.
9199
---@field hl? string
92100

93101

102+
--- Border for the statuscolumn.
94103
---@class statuscolumn.parts.border
95104
---
105+
--- What kind of component is this?
96106
---@field kind "border"
97107
---
108+
--- Text to use for the border.
109+
--- Can be a list to create a gradient.
98110
---@field text string | string[]
111+
---
112+
--- Highlight group for the border.
113+
--- Can be a list to create a gradient.
99114
---@field hl? string | string[]
100115

101116

117+
--- Fold column for the statuscolumn.
102118
---@class statuscolumn.parts.folds
103119
---
120+
--- What kind of component is this?
104121
---@field kind "folds"
105122
---
123+
--- Text to show for closed fold.
124+
--- Can be a list to use a different
125+
--- text for different levels of folds.
106126
---@field close_text string | string[]
127+
---
128+
--- Highlight group for the `close_text`.
129+
--- Can be a list to assign different
130+
--- colors to different fold level.
107131
---@field close_hl? string | string[]
108132
---
133+
--- Text to show for opened fold.
134+
--- Can be a list to use a different
135+
--- text for different levels of folds.
109136
---@field open_text string | string[]
137+
---
138+
--- Highlight group for the `open_text`.
139+
--- Can be a list to assign different
140+
--- colors to different fold level.
110141
---@field open_hl? string | string[]
111142
---
143+
--- Text to show the scope of opened fold.
144+
--- Can be a list to use a different
145+
--- text for different levels of folds.
112146
---@field scope_text string | string[]
147+
---
148+
--- Highlight group for the `scope_text`.
149+
--- Can be a list to assign different
150+
--- colors to different fold level.
113151
---@field scope_hl? string | string[]
114152
---
153+
--- Text to show at the end of opened fold.
154+
--- Can be a list to use a different
155+
--- text for different levels of folds.
115156
---@field scope_end_text string | string[]
157+
---
158+
--- Highlight group for the `scope_end_text`.
159+
--- Can be a list to assign different
160+
--- colors to different fold level.
116161
---@field scope_end_hl? string | string[]
117162
---
163+
--- Text to show where fold level changes.
164+
--- Can be a list to use a different
165+
--- text for different levels of folds.
118166
---@field scope_merge_text string | string[]
167+
---
168+
--- Highlight group for the `scope_merge_text`.
169+
--- Can be a list to assign different
170+
--- colors to different fold level.
119171
---@field scope_merge_hl? string | string[]
120172
---
121-
---@field fill_text string | string[]
173+
--- Text for normal lines.
174+
---@field fill_text string
175+
---
176+
--- Highlight group for `fill_text`.
122177
---@field fill_hl? string
123178

124179

0 commit comments

Comments
 (0)