@@ -42,21 +42,21 @@ local Api = {
4242}
4343
4444--- Print error when setup not called.
45- --- f function to invoke
46- --- @param f function
47- --- @return fun ( ... ) : any
48- local function wrap (f )
45+ --- @param fn fun ( ... ): any
46+ --- @return fun ( ... ): any
47+ local function wrap (fn )
4948 return function (...)
5049 if vim .g .NvimTreeSetup == 1 then
51- return f (... )
50+ return fn (... )
5251 else
5352 notify .error (" nvim-tree setup not called" )
5453 end
5554 end
5655end
5756
5857--- Inject the node as the first argument if present otherwise do nothing.
59- --- @param fn function function to invoke
58+ --- @param fn fun ( node : Node , ... ): any
59+ --- @return fun ( node : Node , ... ): any
6060local function wrap_node (fn )
6161 return function (node , ...)
6262 node = node or lib .get_node_at_cursor ()
@@ -67,7 +67,8 @@ local function wrap_node(fn)
6767end
6868
6969--- Inject the node or nil as the first argument if absent.
70- --- @param fn function function to invoke
70+ --- @param fn fun ( node : Node , ... ): any
71+ --- @return fun ( node : Node , ... ): any
7172local function wrap_node_or_nil (fn )
7273 return function (node , ...)
7374 node = node or lib .get_node_at_cursor ()
7879--- Invoke a method on the singleton explorer.
7980--- Print error when setup not called.
8081--- @param explorer_method string explorer method name
81- --- @return fun ( ... ) : any
82+ --- @return fun ( ... ): any
8283local function wrap_explorer (explorer_method )
8384 return wrap (function (...)
8485 local explorer = core .get_explorer ()
9293--- Print error when setup not called.
9394--- @param explorer_member string explorer member name
9495--- @param member_method string method name to invoke on member
95- --- @return fun ( ... ) : any
96+ --- @return fun ( ... ): any
9697local function wrap_explorer_member (explorer_member , member_method )
9798 return wrap (function (...)
9899 local explorer = core .get_explorer ()
@@ -211,6 +212,7 @@ local function edit(mode, node)
211212end
212213
213214--- @param mode string
215+ --- @param toggle_group boolean ?
214216--- @return fun ( node : Node )
215217local function open_or_expand_or_dir_up (mode , toggle_group )
216218 --- @param node Node
0 commit comments