feat: update types to include new Yazi APIs

This commit is contained in:
sxyazi
2025-12-31 15:59:41 +08:00
parent da5b69563c
commit 398796d88f
5 changed files with 287 additions and 100 deletions

View File

@@ -8,20 +8,20 @@ local function info(content)
}
end
local selected_url = ya.sync(function()
local selected_path = ya.sync(function()
for _, u in pairs(cx.active.selected) do
return u
return u.cache or u
end
end)
local hovered_url = ya.sync(function()
local hovered_path = ya.sync(function()
local h = cx.active.current.hovered
return h and h.url
return h and (h.path or h.url) -- TODO: remove "or h.url"
end)
return {
entry = function()
local a, b = selected_url(), hovered_url()
local a, b = selected_path(), hovered_path()
if not a then
return info("No file selected")
elseif not b then