diff options
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 } |
