1
1
--- @meta
2
2
error (" Cannot require a meta file" )
3
3
4
- local nvim_tree = { api = { decorator = { BaseDecorator = {} } } }
4
+ local nvim_tree = { api = { decorator = { AbstractDecorator = {} } } }
5
5
6
- --- Custom decorator extends nvim_tree.api.decorator.BaseDecorator
6
+ --- Custom decorator extends nvim_tree.api.decorator.AbstractDecorator
7
7
--- It may:
8
8
--- Add icons
9
9
--- Set name highlight group
@@ -21,60 +21,60 @@ local nvim_tree = { api = { decorator = { BaseDecorator = {} } } }
21
21
--- @alias nvim_tree.api.decorator.IconPlacement " none" | " before" | " after" | " signcolumn" | " right_align"
22
22
23
23
--- Names of predefined decorators or your decorator classes
24
- --- @alias nvim_tree.api.decorator.Name " Cut" | " Copied" | " Diagnostics" | " Bookmarks" | " Modified" | " Hidden" | " Opened" | " Git" | nvim_tree.api.decorator.BaseDecorator
24
+ --- @alias nvim_tree.api.decorator.Name " Cut" | " Copied" | " Diagnostics" | " Bookmarks" | " Modified" | " Hidden" | " Opened" | " Git" | nvim_tree.api.decorator.AbstractDecorator
25
25
26
- --- BaseDecorator Class , your decorator will extend this
26
+ --- Abstract decorator class , your decorator will extend this
27
27
---
28
- --- @class (exact ) nvim_tree.api.decorator.BaseDecorator
28
+ --- @class (exact ) nvim_tree.api.decorator.AbstractDecorator
29
29
--- @field protected enabled boolean
30
30
--- @field protected highlight_range nvim_tree.api.decorator.HighlightRange
31
31
--- @field protected icon_placement nvim_tree.api.decorator.IconPlacement
32
32
33
- --- No -args constructor must be implemented
33
+ --- Abstract no -args constructor must be implemented
34
34
---
35
- function nvim_tree .api .decorator .BaseDecorator :new () end
35
+ function nvim_tree .api .decorator .AbstractDecorator :new () end
36
36
37
37
--- Must be called from your constructor
38
38
---
39
- --- @class (exact ) nvim_tree.api.decorator.InitArgs
39
+ --- @class (exact ) nvim_tree.api.decorator.AbstractDecoratorInitArgs
40
40
--- @field enabled boolean
41
41
--- @field highlight_range nvim_tree.api.decorator.HighlightRange
42
42
--- @field icon_placement nvim_tree.api.decorator.IconPlacement
43
43
---
44
44
--- @protected
45
- --- @param args nvim_tree.api.decorator.InitArgs
46
- function nvim_tree .api .decorator .BaseDecorator :init (args ) end
45
+ --- @param args nvim_tree.api.decorator.AbstractDecoratorInitArgs
46
+ function nvim_tree .api .decorator .AbstractDecorator :init (args ) end
47
47
48
- --- Optionally implement this method to set the node's icon
48
+ --- Abstract: optionally implement to set the node's icon
49
49
---
50
50
--- @param node nvim_tree.api.Node
51
51
--- @return HighlightedString ? icon_node
52
- function nvim_tree .api .decorator .BaseDecorator :icon_node (node ) end
52
+ function nvim_tree .api .decorator .AbstractDecorator :icon_node (node ) end
53
53
54
- --- Optionally implement this method to provide icons and the highlight groups for your icon_placement
54
+ --- Abstract: optionally implement to provide icons and the highlight groups for your icon_placement
55
55
---
56
56
--- @param node nvim_tree.api.Node
57
57
--- @return HighlightedString[] ? icons
58
- function nvim_tree .api .decorator .BaseDecorator :icons (node ) end
58
+ function nvim_tree .api .decorator .AbstractDecorator :icons (node ) end
59
59
60
- --- Optionally implement this method to provide one highlight group to apply to your highlight_range
60
+ --- Abstract: optionally implement to provide one highlight group to apply to your highlight_range
61
61
---
62
62
--- @param node nvim_tree.api.Node
63
63
--- @return string ? highlight_group
64
- function nvim_tree .api .decorator .BaseDecorator :highlight_group (node ) end
64
+ function nvim_tree .api .decorator .AbstractDecorator :highlight_group (node ) end
65
65
66
66
67
67
--
68
68
-- Example Decorator
69
69
--
70
70
71
- --- @class (exact ) MyDecorator : nvim_tree.api.decorator.BaseDecorator
71
+ --- @class (exact ) MyDecorator : nvim_tree.api.decorator.AbstractDecorator
72
72
--- @field private my_icon nvim_tree.api.HighlightedString
73
73
local MyDecorator = require (" nvim-tree.api" ).decorator .create ()
74
74
75
75
--- Mandatory constructor :new() will be called once per tree render, with no arguments.
76
76
function MyDecorator :new ()
77
- --- @type nvim_tree.api.decorator.InitArgs
77
+ --- @type nvim_tree.api.decorator.AbstractDecoratorInitArgs
78
78
local args = {
79
79
enabled = true ,
80
80
highlight_range = " all" ,
0 commit comments