Skip to content

Commit e0a2828

Browse files
committed
doc: add types for more luarocks.path fields
1 parent 6c547e1 commit e0a2828

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

types/luarocks/core/path.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ local path = {}
77
---@return string
88
function path.rocks_tree_to_string(tree) end
99

10+
---@param tree string | luarocks.core.Tree
11+
---@return string
12+
function path.deploy_lua_dir(tree) end
13+
1014
return path

types/luarocks/path.lua

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1-
local core_path = require("luarocks.core.path")
1+
---@meta
2+
3+
local core_path = require("luarocks.core.path") --[[@as luarocks.core.path]]
24

35
---@class luarocks.path
46
local path = {}
57

68
path.rocks_tree_to_string = core_path.rocks_tree_to_string
9+
path.deploy_lua_dir = core_path.deploy_lua_dir
10+
11+
---Get the local installation directory (prefix) for a package.
12+
---@param name string -- the package name
13+
---@param version string -- the package version
14+
---@param tree? string | luarocks.core.Tree -- if given, specifies the local tree to use
15+
---@return string install_dir -- the resulting path -- does not guarantee that the package (and by extension, the path) exists
16+
function path.install_dir(name, version, tree) end
17+
18+
---Get the local installation directory for Lua modules of a package.
19+
---@param name string -- the package name
20+
---@param version string -- the package version
21+
---@param tree? string | luarocks.core.Tree -- if given, specifies the local tree to use
22+
---@return string lua_dir -- the resulting path -- does not guarantee that the package (and by extension, the path) exists
23+
function path.lua_dir(name, version, tree) end
24+
25+
---@param tree string | luarocks.core.Tree
26+
function path.use_tree(tree) end
727

828
return path

0 commit comments

Comments
 (0)