types: update type annotations for LuaLS 3.7

This commit is contained in:
Steven Arcangeli 2023-08-24 09:15:06 -07:00
parent b61bc9b701
commit e45aeebc2b
9 changed files with 34 additions and 16 deletions

View file

@ -17,30 +17,30 @@ local FIELD_TYPE = constants.FIELD_TYPE
---@alias oil.Action oil.CreateAction|oil.DeleteAction|oil.MoveAction|oil.CopyAction|oil.ChangeAction
---@class oil.CreateAction
---@class (exact) oil.CreateAction
---@field type "create"
---@field url string
---@field entry_type oil.EntryType
---@field link nil|string
---@class oil.DeleteAction
---@class (exact) oil.DeleteAction
---@field type "delete"
---@field url string
---@field entry_type oil.EntryType
---@class oil.MoveAction
---@class (exact) oil.MoveAction
---@field type "move"
---@field entry_type oil.EntryType
---@field src_url string
---@field dest_url string
---@class oil.CopyAction
---@class (exact) oil.CopyAction
---@field type "copy"
---@field entry_type oil.EntryType
---@field src_url string
---@field dest_url string
---@class oil.ChangeAction
---@class (exact) oil.ChangeAction
---@field type "change"
---@field entry_type oil.EntryType
---@field url string
@ -71,6 +71,7 @@ M.create_actions_from_diffs = function(all_diffs)
if diff.id then
local by_id = diff_by_id[diff.id]
-- FIXME this is kind of a hack. We shouldn't be setting undocumented fields on the diff
---@diagnostic disable-next-line: inject-field
diff.dest = parent_url .. diff.name
table.insert(by_id, diff)
else

View file

@ -13,19 +13,19 @@ local FIELD_META = constants.FIELD_META
---@alias oil.Diff oil.DiffNew|oil.DiffDelete|oil.DiffChange
---@class oil.DiffNew
---@class (exact) oil.DiffNew
---@field type "new"
---@field name string
---@field entry_type oil.EntryType
---@field id nil|integer
---@field link nil|string
---@class oil.DiffDelete
---@class (exact) oil.DiffDelete
---@field type "delete"
---@field name string
---@field id integer
---
---@class oil.DiffChange
---@class (exact) oil.DiffChange
---@field type "change"
---@field entry_type oil.EntryType
---@field name string
@ -56,7 +56,7 @@ local function compare_link_target(meta, parsed_entry)
return meta_name == parsed_name
end
---@class oil.ParseResult
---@class (exact) oil.ParseResult
---@field data table Parsed entry data
---@field ranges table<string, integer[]> Locations of the various columns
---@field entry nil|oil.InternalEntry If the entry already exists

View file

@ -1,6 +1,7 @@
local util = require("oil.util")
---@class oil.Trie
---@class (exact) oil.Trie
---@field new fun(): oil.Trie
---@field private root table
local Trie = {}