Skip to content

Commit

Permalink
docs(api): correct type signature
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Aug 5, 2024
1 parent c4b1246 commit 194d66e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/rocks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ api.try_get_cached_outdated_rocks() *api.try_get_cached_outdated_rocks*
if it is not ready.

Returns: ~
(table<rock_name,OutdatedRock[]>) rocks
(table<rock_name,OutdatedRock>) rocks


api.query_luarocks_rocks({callback}) *api.query_luarocks_rocks*
Expand Down
2 changes: 1 addition & 1 deletion lua/rocks/api/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
---or no connection to luarocks.org can be established.
---Will spawn an async task to attempt to populate the cache
---if it is not ready.
---@return table<rock_name, OutdatedRock[]> rocks
---@return table<rock_name, OutdatedRock> rocks
function api.try_get_cached_outdated_rocks()
return cache.try_get_outdated_rocks()
end
Expand Down
4 changes: 2 additions & 2 deletions lua/rocks/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local _cached_dev_binaries = nil
---@type string[] | nil
local _removable_rock_cache = nil

---@type table<rock_name, OutdatedRock[]> | nil
---@type table<rock_name, OutdatedRock> | nil
local _outdated_rock_cache = nil

---Tries to get the cached value
Expand Down Expand Up @@ -117,7 +117,7 @@ end)
---Tries to get the cached removable rocks.
---Returns an empty list if the cache is not ready,
---and triggers an async task to populate the cache.
---@return table<string, Rock[]> rocks indexed by name
---@return table<string, OutdatedRock> rocks indexed by name
function cache.try_get_outdated_rocks()
return try_get_unsafe(_outdated_rock_cache, cache.populate_outdated_rock_cache)
end
Expand Down

0 comments on commit 194d66e

Please sign in to comment.