refactor(types): extract inline anonymous types into named classes (#110)

Problem: several functions used inline `{...}` table types in their
`@param` and `@return` annotations, making them hard to read and
impossible to reference from other modules.

Solution: extract each into a named `---@class`: `pending.Metadata`,
`pending.TaskFields`, `pending.CompletionItem`, `pending.SystemResult`,
and `pending.OAuthClientOpts`.
This commit is contained in:
Barrett Ruth 2026-03-08 19:49:49 -04:00
parent 24bc1e395b
commit 34a68db6d0
5 changed files with 123 additions and 45 deletions

View file

@ -1,5 +1,9 @@
local config = require('pending.config')
---@class pending.CompletionItem
---@field word string
---@field info string
---@class pending.complete
local M = {}
@ -32,7 +36,7 @@ local function get_categories()
return result
end
---@return { word: string, info: string }[]
---@return pending.CompletionItem[]
local function date_completions()
return {
{ word = 'today', info = "Today's date" },
@ -89,7 +93,7 @@ local recur_descriptions = {
['2y'] = 'Every 2 years',
}
---@return { word: string, info: string }[]
---@return pending.CompletionItem[]
local function recur_completions()
local recur = require('pending.recur')
local list = recur.shorthand_list()