feat: render tuple types for API methods

This commit is contained in:
Lewis Russell
2025-04-23 10:36:24 +01:00
committed by Lewis Russell
parent 019b2050e1
commit 70d7979439
2 changed files with 11 additions and 5 deletions

View File

@@ -174,7 +174,13 @@ local function api_type(t)
local as0 = t:match('^ArrayOf%((.*)%)')
if as0 then
local as = split(as0, ', ')
return api_type(as[1]) .. '[]'
local a = api_type(as[1])
local count = tonumber(as[2])
if count then
return ('[%s]'):format(a:rep(count, ', '))
else
return a .. '[]'
end
end
local d = t:match('^Dict%((.*)%)')