Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The TypeScriptLUA repo contains the complete source code implementation for TypeScript compiler for LUA bytecode

NotificationsYou must be signed in to change notification settings

ASDAlexander77/TypeScriptLua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The TypeScriptLua repo contains the complete source code implementation for TypeScript compiler for Lua bytecode.

Chat Room

Want to chat with other members of the TypeScript for Lua community?

Join the chat at https://gitter.im/ASDAlexander77/cs2cpp

Engage, Contribute and Provide Feedback

Some of the best ways to contribute are to try things out, file bugs, and join in design conversations.

License

TypeScriptLua is licensed under the MIT license.

Quick Start

Prerequisite: nodejs, Lua 5.3, VSCode

  1. Build Project
npm installnpm run build
  1. Compile test.ts

create file test.ts

declarevarprint:any;classPerson{protectedname:string;constructor(name:string){this.name=name;}}classEmployeeextendsPerson{privatedepartment:string;constructor(name:string,department:string){super(name);this.department=department;}publicgetElevatorPitch(){return`Hello, my name is${this.name} and I work in${this.department}.`;}}lethoward=newEmployee("Howard","Sales");print(howard.ElevatorPitch);
node __out/main.js test.ts

Now you have test.lua

  1. Run it.
lua test.lua

Result:

Hello, my name is Howard and I work in Sales.

Enjoy it.

How to use JavaScript Library

  1. Compile JavaScript Library
cd experiments\jslibnode ../../__out/main.js -singleModule
  1. Copy JS.lua into your folder where you run the compiled app.

  2. Compile test.ts

create file test.ts

classPerson{protectedname:string;constructor(name:string){this.name=name;}}classEmployeeextendsPerson{privatedepartment:string;constructor(name:string,department:string){super(name);this.department=department;}publicgetElevatorPitch(){return`Hello, my name is${this.name} and I work in${this.department}.`;}}lethoward=newEmployee("Howard","Sales");console.log(howard.ElevatorPitch);
node __out/main.js test.ts
  1. Run it.
lua -e "require('./JS')" test.lua

Result:

Hello, my name is Howard and I work in Sales.

Enjoy it

About

The TypeScriptLUA repo contains the complete source code implementation for TypeScript compiler for LUA bytecode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp