Skip to content

Commit 1c4c3cd

Browse files
committed
Add hint for control property
1 parent 9dbcd1f commit 1c4c3cd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Classes/Control.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ local rect = {
3838
---@field enabled boolean | fun(...: any): boolean
3939
---@field onFocusGained? fun()
4040
---@field onFocusLost? fun()
41+
---@field shown Prop<boolean>
42+
---@field x Prop<number>?
43+
---@field y Prop<number>?
4144
local ControlClass = newClass("Control")
4245

4346
---@alias ControlAnchor [AnchorPoint, Control|ControlHost, AnchorPoint, boolean|nil]
@@ -58,6 +61,11 @@ function ControlClass:Control(anchor, rect)
5861
return self
5962
end
6063

64+
---@generic T
65+
---@alias Prop<T> (fun(self: self): T) | T
66+
67+
---@param name string
68+
---@return any value
6169
function ControlClass:GetProperty(name)
6270
if type(self[name]) == "function" then
6371
return self[name](self)

0 commit comments

Comments
 (0)