docs(lua): add LuaCATS type annotations across core modules

This commit is contained in:
Barrett Ruth 2026-03-06 23:02:31 -05:00
parent fc2331c242
commit 1f0414de8e
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
15 changed files with 73 additions and 0 deletions

View file

@ -216,6 +216,10 @@ local function run_scraper(platform, subcommand, args, opts)
end
end
---@param platform string
---@param contest_id string
---@param callback fun(data: table)?
---@param on_error fun()?
function M.scrape_contest_metadata(platform, contest_id, callback, on_error)
run_scraper(platform, 'metadata', { contest_id }, {
on_exit = function(result)
@ -253,6 +257,8 @@ function M.scrape_contest_metadata(platform, contest_id, callback, on_error)
})
end
---@param platform string
---@return { contests: ContestSummary[], supports_countdown: boolean }?
function M.scrape_contest_list(platform)
local result = run_scraper(platform, 'contests', {}, { sync = true })
if not result or not result.success or not (result.data and result.data.contests) then
@ -330,6 +336,10 @@ function M.scrape_all_tests(platform, contest_id, callback, on_done)
})
end
---@param platform string
---@param credentials table
---@param on_status fun(ev: table)?
---@param callback fun(result: table)?
function M.login(platform, credentials, on_status, callback)
local done = false
run_scraper(platform, 'login', {}, {
@ -361,6 +371,14 @@ function M.login(platform, credentials, on_status, callback)
})
end
---@param platform string
---@param contest_id string
---@param problem_id string
---@param language string
---@param source_file string
---@param credentials table
---@param on_status fun(ev: table)?
---@param callback fun(result: table)?
function M.submit(
platform,
contest_id,