it compiles

This commit is contained in:
2021-06-23 22:48:54 -05:00
parent d125696058
commit 8ce294291c
7 changed files with 1862 additions and 7 deletions

1827
ts-lua/dist/lualib_bundle.lua vendored Normal file

File diff suppressed because it is too large Load Diff

23
ts-lua/dist/test.lua vendored Normal file
View File

@@ -0,0 +1,23 @@
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
menu:add_feature(
"test",
"action",
0,
function()
do
local i = 0
while i < 120 do
scriptdraw:draw_rect(
v2(nil, 1, 1),
v2(nil, 1, 1),
4278190080
)
local ____ = (function()
local ____tmp = i
i = ____tmp + 1
return ____tmp
end)() and system:wait(0)
end
end
end
)

6
ts-lua/src/test.ts Normal file
View File

@@ -0,0 +1,6 @@
menu.add_feature('test', 'action', 0, () => {
for (let i = 0; i < 120; i++ && system.wait(0))
scriptdraw.draw_rect(v2(1, 1), v2(1, 1), 4278190080)
})

View File

@@ -1,6 +0,0 @@
let a = new Feat('debug')
a.value_i
menu.add_feature('', '', 0, () => {
})

View File

@@ -1,5 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"target": "esnext", "target": "esnext",
"lib": ["esnext"], "lib": ["esnext"],
"moduleResolution": "node", "moduleResolution": "node",
@@ -11,5 +13,5 @@
}, },
"tstl": { "tstl": {
"luaTarget": "JIT" "luaTarget": "JIT"
} },
} }

View File

@@ -62,3 +62,5 @@ declare class v2 {
public magnitude(val: v2|null): number; public magnitude(val: v2|null): number;
} }
declare function v2(x?: number, y?: number): v2

View File

@@ -100,3 +100,4 @@ declare class v3 {
} }
declare function v3(x?: number, y?: number): v3