MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua

github.com/TypeScriptToLua/TypeScriptToLua @v1.37.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.37.0 ↗ · + Follow
1,354 symbols 3,717 edges 465 files 20 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/TypeScriptToLua/TypeScriptToLua/raw/v1.37.0/logo-hq.png?raw=true" alt="TypeScriptToLua" width="256" />
<h1>

TypeScriptToLua

    <a href="https://github.com/TypeScriptToLua/TypeScriptToLua/actions"><img alt="CI status" src="https://github.com/TypeScriptToLua/TypeScriptToLua/workflows/CI/badge.svg" /></a>
    <a href="https://codecov.io/gh/TypeScriptToLua/TypeScriptToLua"><img alt="Coverage" src="https://img.shields.io/codecov/c/gh/TypeScriptToLua/TypeScriptToLua.svg?logo=codecov" /></a>
    <a href="https://discord.gg/BWAq58Y"><img alt="Chat with us!" src="https://img.shields.io/discord/515854149821267971.svg?colorB=7581dc&logo=discord&logoColor=white"></a>
</h1>
<a href="https://typescripttolua.github.io/" target="_blank">Documentation</a>
|
<a href="https://typescripttolua.github.io/play/" target="_blank">Try Online</a>
|
<a href="https://github.com/TypeScriptToLua/TypeScriptToLua/blob/master/CHANGELOG.md">Changelog</a>
|
<a href="https://github.com/TypeScriptToLua/TypeScriptToLua/blob/master/CONTRIBUTING.md">Contribution guidelines</a>

A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!

Large projects written in Lua can become hard to maintain and make it easy to make mistakes. Writing code in TypeScript instead improves maintainability, readability and robustness, with the added bonus of good tooling support (including ESLint, Prettier, Visual Studio Code and WebStorm). This project is useful in any environment where Lua code is accepted, with the powerful option of simply declaring any existing API using TypeScript declaration files.

Getting Started

To install TypeScriptToLua add the typescript-to-lua npm package:

$ npm install -D typescript-to-lua

This package includes the tstl command line application, which can be used similarly to tsc:

$ npx tstl

For more information, check out Getting Started in our documentation.

Extension points exported contracts — how you extend this code

GeneratorIterator (Interface)
(no doc) [2 implementers]
src/lualib/GeneratorIterator.d.ts
ObjectConstructor (Interface)
(no doc) [2 implementers]
language-extensions/index.d.ts
MemoryBenchmarkResult (Interface)
(no doc)
benchmark/src/benchmark_types.ts
Matchers (Interface)
(no doc)
test/setup.ts
DirectoryTestCase (Interface)
(no doc)
test/transpile/directories.spec.ts
ComparisonCase (Interface)
(no doc)
test/unit/typeof.spec.ts
CliResult (Interface)
(no doc)
test/cli/run.ts
PrintResult (Interface)
(no doc)
src/LuaPrinter.ts

Core symbols most depended-on inside this repo

expect
called by 386
src/transpilation/find-lua-requires.ts
transformExpression
called by 122
src/transformation/context/context.ts
transformLuaLibFunction
called by 117
src/transformation/utils/lualib.ts
getLuaResult
called by 56
test/util.ts
get
called by 56
src/lualib/Map.ts
set
called by 55
src/lualib/Map.ts
setReturnExport
called by 53
test/util.ts
resolve
called by 40
src/lualib/Promise.ts

Shape

Function 980
Method 193
Interface 108
Class 56
Enum 17

Languages

TypeScript100%

Modules by API surface

src/LuaAST.ts118 symbols
test/util.ts75 symbols
src/LuaPrinter.ts67 symbols
src/transformation/context/context.ts31 symbols
src/transpilation/resolve.ts30 symbols
src/transformation/utils/scope.ts21 symbols
src/lualib/Set.ts21 symbols
src/lualib/Promise.ts17 symbols
src/transformation/utils/lua-ast.ts16 symbols
src/transformation/utils/export.ts16 symbols
src/utils.ts15 symbols
src/transpilation/transpiler.ts15 symbols

For agents

$ claude mcp add TypeScriptToLua \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact