diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-07-21 21:32:27 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-07-21 21:32:27 +0000 |
| commit | 184bd50e2ea12b4bf40f4ae1b0d685f0bfa1c995 (patch) | |
| tree | bfe4f0a8fb39def302bdc807308c30b60dd18a92 /config/types.lua | |
| parent | c251d37c98efba534766e914f7392cc7a0470351 (diff) | |
started 2.0 refactor. Co-authored-by: ezntek <eason@ezntek.com>
Diffstat (limited to 'config/types.lua')
| -rw-r--r-- | config/types.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/types.lua b/config/types.lua new file mode 100644 index 0000000..10a444d --- /dev/null +++ b/config/types.lua @@ -0,0 +1,35 @@ +---@class (exact) Dirs +---@field prefix string +---@field bin string +---@field include string +---@field lib string +---@field src string + +---@class (exact) Recipe +---@field setup (fun(bldit_setup: fun()): number)? +---@field build fun(bldit_build: fun()): number +---@field install fun(bldit_install: fun()): number +---@field remove fun(bldit_remove: fun()): number +---@field on_update (fun(bldit_on_update: fun()): number)? + +---@type Recipe +---@alias GetSourcesFn fun(url: string, version: string, target_dir: string): number +---@alias GetVersionFn fun(url: string, target_dir: string): string + +---@class (exact) Fetcher +---@field get_sources GetSourcesFn +---@field get_version GetVersionFn + +---@class (exact) Package +---@field url string +---@field version string? +---@field fetcher Fetcher | nil +---@field dependencies { [string]: Package } | "bldit" | nil +---@field opts table? +---@field recipe Recipe | "bldit" | nil + +---@class (exact) Config +---@field dirs Dirs +---@field fetchers { [string]: Fetcher } +---@field recipes { [string]: Recipe } +---@field pkgs { [string]: Package } |
