Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hazzard993/luatotypescript
Converts Lua code to TypeScript
https://github.com/hazzard993/luatotypescript
lua transpiler typescript
Last synced: 5 days ago
JSON representation
Converts Lua code to TypeScript
- Host: GitHub
- URL: https://github.com/hazzard993/luatotypescript
- Owner: hazzard993
- License: mit
- Created: 2019-07-04T11:39:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T04:37:44.000Z (4 months ago)
- Last Synced: 2024-12-30T18:17:36.997Z (12 days ago)
- Topics: lua, transpiler, typescript
- Language: TypeScript
- Size: 441 KB
- Stars: 63
- Watchers: 5
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Transpiles Lua to TypeScript declaration and/or TypeScript source code.
```sh
npm install -g lua-to-typescript
```To transpile files...
```sh
ltts main.lua
# Generates main.tsltts a.lua b.lua c.lua ...
# Generates a.ts, b.ts, c.ts, ...ltts -d library.lua
# Generates library.d.ts
```## LDoc
This program uses [LDoc](https://stevedonovan.github.io/ldoc/) type annotations for type information that is used in generated TypeScript code.
```lua
--- @tparam number a
--- @treturn number
local function f(a)
return a
endreturn a
```Loosely translates to the below code. Note the type annotations.
```ts
function f(a: number): number {
return a;
}export = f;
```