From 184bd50e2ea12b4bf40f4ae1b0d685f0bfa1c995 Mon Sep 17 00:00:00 2001 From: dacctal Date: Tue, 21 Jul 2026 21:32:27 +0000 Subject: started 2.0 refactor. Co-authored-by: ezntek --- config/types.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 config/types.lua (limited to 'config/types.lua') 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 } -- cgit v1.2.3