docs for table properties
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Zsolt Tasnadi
2026-02-26 10:21:48 +01:00
parent 64de41a940
commit 8f34cbf875
7 changed files with 99 additions and 4 deletions

View File

@@ -4,6 +4,10 @@ local _decisions = {}
--- Registers a decision definition.
--- @within Decision
-- @param decision table The decision data table.
-- @param decision.id string Unique decision identifier.
-- @param decision.label string Display text for the decision.
-- @param[opt] decision.condition function Returns true if decision is available. Defaults to always true.
-- @param[opt] decision.handle function Called when the decision is selected. Defaults to noop.
function Decision.register(decision)
if not decision or not decision.id then
PopupWindow.show({"Error: Invalid decision object registered (missing id)!"})
@@ -43,7 +47,8 @@ end
--- Gets decision objects based on a screen's data.
--- @within Decision
-- @param screen_data table The data for the screen, containing a 'decisions' field (list of decision IDs).
-- @param screen_data table The data for the screen.
-- @param screen_data.decisions table Array of decision ID strings.
-- @return table A table containing decision objects relevant to the screen.
function Decision.get_for_screen(screen_data)
if not screen_data or not screen_data.decisions then