refactor: tighten LuaCATS annotations across modules
Problem: type annotations repeated inline unions with no aliases, used `table<string, any>` where structured types exist, and had loose `string` where union types should be used. Solution: add `pending.TaskStatus`, `pending.RecurMode`, `pending.TaskExtra`, `pending.ForgeType`, `pending.ForgeState`, `pending.ForgeAuthStatus` aliases and `pending.SyncBackend` interface. Replace inline unions and loose types with the new aliases in `store.lua`, `forge.lua`, `config.lua`, `diff.lua`, `views.lua`, `parse.lua`, `init.lua`, and `oauth.lua`.
This commit is contained in:
parent
287a4e32e3
commit
4710e6197f
8 changed files with 50 additions and 15 deletions
|
|
@ -24,6 +24,15 @@ local BUNDLED_CLIENT_SECRET = 'PLACEHOLDER'
|
|||
---@field config_key string
|
||||
|
||||
---@class pending.OAuthClient : pending.OAuthClientOpts
|
||||
---@field token_path fun(self: pending.OAuthClient): string
|
||||
---@field resolve_credentials fun(self: pending.OAuthClient): pending.OAuthCredentials
|
||||
---@field load_tokens fun(self: pending.OAuthClient): pending.OAuthTokens?
|
||||
---@field save_tokens fun(self: pending.OAuthClient, tokens: pending.OAuthTokens): boolean
|
||||
---@field refresh_access_token fun(self: pending.OAuthClient, creds: pending.OAuthCredentials, tokens: pending.OAuthTokens): pending.OAuthTokens?
|
||||
---@field get_access_token fun(self: pending.OAuthClient): string?
|
||||
---@field setup fun(self: pending.OAuthClient): nil
|
||||
---@field auth fun(self: pending.OAuthClient, on_complete?: fun(ok: boolean): nil): nil
|
||||
---@field clear_tokens fun(self: pending.OAuthClient): nil
|
||||
local OAuthClient = {}
|
||||
OAuthClient.__index = OAuthClient
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue