Skip to content

Commit 86ff76c

Browse files
committed
doc: add more luarocks types
1 parent ed38de1 commit 86ff76c

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

types/luarocks/core/path.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ function path.rocks_tree_to_string(tree) end
1111
---@return string
1212
function path.deploy_lua_dir(tree) end
1313

14+
---@param tree? string | luarocks.core.Tree
15+
---@return string
16+
function path.rocks_dir(tree) end
17+
1418
return path

types/luarocks/core/vers.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---@meta
2+
3+
---@class luarocks.core.vers.Version
4+
---@field string string
5+
---@field revision number
6+
---@field [number] number
7+
8+
---@class luarocks.core.vers
9+
local vers = {}
10+
11+
---@param vstring string
12+
---@return luarocks.core.vers.Version
13+
---@overload fun(vstring: nil): nil
14+
function vers.parse_version(vstring) end
15+
16+
---@param a string
17+
---@param b string
18+
---@return boolean -- whether `a > b`
19+
function vers.compare_versions(a, b) end
20+
21+
return vers

types/luarocks/path.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local path = {}
77

88
path.rocks_tree_to_string = core_path.rocks_tree_to_string
99
path.deploy_lua_dir = core_path.deploy_lua_dir
10+
path.rocks_dir = core_path.rocks_dir
1011

1112
---Get the local installation directory (prefix) for a package.
1213
---@param name string -- the package name

0 commit comments

Comments
 (0)