updated type hints for remaining graphics_element generic types

This commit is contained in:
Mikayla
2024-09-26 21:23:50 +00:00
parent ec1fc13ae7
commit 17e53fdba2
38 changed files with 54 additions and 52 deletions

View File

@@ -42,7 +42,7 @@ local hzd_fg_bg = cpair(colors.white, colors.gray)
local dis_colors = cpair(colors.white, colors.lightGray)
-- new unit control page view
---@param root graphics_element parent
---@param root Container parent
local function new_view(root)
local db = iocontrol.get_db()
@@ -63,7 +63,7 @@ local function new_view(root)
local btn_fg_bg = cpair(colors.green, colors.black)
local btn_active = cpair(colors.white, colors.black)
local page_div = nil ---@type nil|graphics_element
local page_div = nil ---@type Div|nil
-- set sidebar to display unit-specific fields based on a specified unit
local function set_sidebar()
@@ -83,7 +83,7 @@ local function new_view(root)
local function load()
page_div = Div{parent=main,y=2,width=main.get_width()}
local panes = {}
local panes = {} ---@type Div[]
local active_unit = 1

View File

@@ -22,7 +22,7 @@ local cpair = core.cpair
local APP_ID = pocket.APP_ID
-- create diagnostic app pages
---@param root graphics_element parent
---@param root Container parent
local function create_pages(root)
local db = iocontrol.get_db()

View File

@@ -13,7 +13,7 @@ local TextBox = require("graphics.elements.TextBox")
local APP_ID = pocket.APP_ID
-- create placeholder app page
---@param root graphics_element parent
---@param root Container parent
local function create_pages(root)
local db = iocontrol.get_db()

View File

@@ -36,7 +36,7 @@ local APP_ID = pocket.APP_ID
-- local text_fg = style.text_fg
-- new system guide view
---@param root graphics_element parent
---@param root Container parent
local function new_view(root)
local db = iocontrol.get_db()
@@ -58,7 +58,7 @@ local function new_view(root)
app.set_sidebar({{ label = " # ", tall = true, color = core.cpair(colors.black, colors.green), callback = function () db.nav.open_app(APP_ID.ROOT) end }})
local page_div = nil ---@type nil|graphics_element
local page_div = nil ---@type Div|nil
-- load the app (create the elements)
local function load()
@@ -88,7 +88,7 @@ local function new_view(root)
local fps = Div{parent=page_div,x=2,width=p_width}
local gls = Div{parent=page_div,x=2,width=p_width}
local lnk = Div{parent=page_div,x=2,width=p_width}
local panes = { home, search, use, uis, fps, gls, lnk }
local panes = { home, search, use, uis, fps, gls, lnk } ---@type Div[]
local doc_map = {} ---@type { [string]: function }
local search_db = {} ---@type [ string, string, string, function ][]

View File

@@ -18,7 +18,7 @@ local APP_ID = pocket.APP_ID
local LINK_STATE = iocontrol.LINK_STATE
-- create the connecting to SV & API page
---@param root graphics_element parent
---@param root Container parent
local function create_pages(root)
local db = iocontrol.get_db()

View File

@@ -25,7 +25,7 @@ local cpair = core.cpair
local APP_ID = pocket.APP_ID
-- create system app pages
---@param root graphics_element parent
---@param root Container parent
local function create_pages(root)
local db = iocontrol.get_db()

View File

@@ -47,7 +47,7 @@ local emc_ind_s = {
}
-- new unit page view
---@param root graphics_element parent
---@param root Container parent
local function new_view(root)
local db = iocontrol.get_db()
@@ -69,7 +69,7 @@ local function new_view(root)
local btn_active = cpair(colors.white, colors.black)
local nav_links = {}
local page_div = nil ---@type nil|graphics_element
local page_div = nil ---@type Div|nil
-- set sidebar to display unit-specific fields based on a specified unit
local function set_sidebar(id)
@@ -99,7 +99,7 @@ local function new_view(root)
local function load()
page_div = Div{parent=main,y=2,width=main.get_width()}
local panes = {}
local panes = {} ---@type Div[]
local active_unit = 1

View File

@@ -18,7 +18,7 @@ local ALIGN = core.ALIGN
local cpair = core.cpair
-- create a waiting view
---@param parent graphics_element parent
---@param parent Container parent
---@param y integer y offset
local function init(parent, y, is_api)
-- root div

View File

@@ -38,7 +38,7 @@ local cpair = core.cpair
local APP_ID = pocket.APP_ID
-- create new main view
---@param main graphics_element main displaybox
---@param main DisplayBox main displaybox
local function init(main)
local db = iocontrol.get_db()

View File

@@ -21,7 +21,7 @@ local DOC_TYPE = docs.DOC_ITEM_TYPE
local LIST_TYPE = docs.DOC_LIST_TYPE
-- new guide documentation section
---@param data { [1]: pocket_app, [2]: graphics_element, [3]: graphics_element[], [4]: { [string]: function }, [5]: [ string, string, string, function ][], [6]: cpair, [7]: cpair }
---@param data { [1]: pocket_app, [2]: Div, [3]: Div[], [4]: { [string]: function }, [5]: [ string, string, string, function ][], [6]: cpair, [7]: cpair }
---@param base_page nav_tree_page
---@param title string
---@param items table

View File

@@ -19,7 +19,7 @@ local cpair = core.cpair
local APP_ID = pocket.APP_ID
-- new home page view
---@param root graphics_element parent
---@param root Container parent
local function new_view(root)
local db = iocontrol.get_db()

View File

@@ -29,8 +29,8 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a boiler view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes graphics_element[]
---@param blr_pane graphics_element
---@param panes Div[]
---@param blr_pane Div
---@param b_id integer boiler ID
---@param ps psil
---@param update function

View File

@@ -29,8 +29,8 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a reactor view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes graphics_element[]
---@param page_div graphics_element
---@param panes Div[]
---@param page_div Div
---@param u_ps psil
---@param update function
return function (app, u_page, panes, page_div, u_ps, update)

View File

@@ -30,8 +30,8 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a turbine view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes graphics_element[]
---@param tbn_pane graphics_element
---@param panes Div[]
---@param tbn_pane Div
---@param u_id integer unit ID
---@param t_id integer turbine ID
---@param ps psil