-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathlayout.lua
More file actions
34 lines (29 loc) · 1.1 KB
/
layout.lua
File metadata and controls
34 lines (29 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---@meta soluna.layout
---
--- Soluna layout module
---
---@class soluna.layout
local layout = {}
---
--- Loads a layout definition from a file or table
---
--- The filename_or_list parameter can be:
--- - A string: path to a .dl layout file (will be loaded and parsed)
--- - A table: pre-parsed datalist structure
---
--- The scripts parameter is optional and provides a function table for script resolution.
---
---@param filename_or_list string|table Layout definition file path or parsed list
---@param scripts? table Script resolver function table
---@return table document Layout document object with element access by ID
function layout.load(filename_or_list, scripts) end
---
--- Calculates layout positions and dimensions
---
--- Runs the Yoga layout calculation on the document and updates all element positions.
--- Returns an array of element objects, each with x, y, w, h fields set to calculated values.
---
---@param document table Layout document from layout.load()
---@return table[] elements Array of element objects with calculated x, y, w, h positions
function layout.calc(document) end
return layout