chore: add type annotations to (almost) all functions

This commit is contained in:
Akmadan23
2023-11-24 12:01:24 +01:00
parent 46e1f776f0
commit fabea3376e
48 changed files with 438 additions and 83 deletions

View File

@@ -4,18 +4,21 @@ local NvimTreeMarks = {}
local M = {}
---@param node Node
local function add_mark(node)
NvimTreeMarks[node.absolute_path] = node
renderer.draw()
end
---@param node Node
local function remove_mark(node)
NvimTreeMarks[node.absolute_path] = nil
renderer.draw()
end
---@param node Node
function M.toggle_mark(node)
if node.absolute_path == nil then
return
@@ -36,10 +39,13 @@ function M.clear_marks()
renderer.draw()
end
---@param node Node
---@return table|nil
function M.get_mark(node)
return NvimTreeMarks[node.absolute_path]
end
---@return table
function M.get_marks()
local list = {}
for _, node in pairs(NvimTreeMarks) do