Add type notation

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-22 23:25:39 +07:00
parent 2b916ca2ad
commit 16e472f7ef

View File

@@ -26,6 +26,21 @@ OTHER DEALINGS IN THE SOFTWARE.
local slider = {}
slider.__index = slider
---@type table
---@class slider.style
---@field width? number
---@field orientatio? 'horizontal'|'vertical'
---@field track? 'rectangle'|'line'|'roundrect'
---@field knob? 'rectangle'|'circle'
---@param x number
---@param y number
---@param length number
---@param value number
---@param min number
---@param max number
---@param setter? function
---@param style? slider.style
function newSlider(x, y, length, value, min, max, setter, style)
local s = {}
s.value = (value - min) / (max - min)