refactor(import/disableControls): add missing lua typings (#231)

This commit is contained in:
Aaron-Downham
2023-02-22 02:26:09 +00:00
committed by GitHub
parent 639faa214d
commit f5bada7aa4

View File

@@ -4,7 +4,7 @@
--- ``` --- ```
local disableControls = {} local disableControls = {}
---@param ... number ---@param ... number | table
function disableControls:Add(...) function disableControls:Add(...)
local keys = type(...) == 'table' and ... or {...} local keys = type(...) == 'table' and ... or {...}
for i=1, #keys do for i=1, #keys do
@@ -17,7 +17,7 @@ function disableControls:Add(...)
end end
end end
---@param ... number ---@param ... number | table
function disableControls:Remove(...) function disableControls:Remove(...)
local keys = type(...) == 'table' and ... or {...} local keys = type(...) == 'table' and ... or {...}
for i=1, #keys do for i=1, #keys do
@@ -31,7 +31,7 @@ function disableControls:Remove(...)
end end
end end
---@param ... number ---@param ... number | table
function disableControls:Clear(...) function disableControls:Clear(...)
local keys = type(...) == 'table' and ... or {...} local keys = type(...) == 'table' and ... or {...}
for i=1, #keys do for i=1, #keys do
@@ -53,4 +53,4 @@ lib.disableControls = setmetatable(disableControls, {
end end
}) })
return lib.disableControls return lib.disableControls