Upgraded the Wiki parser, OOP definitions and add generics (for event declarations or key binding) I have released the 1.0 version of MTASA TypeScript project. Add better hinting for `addEventHandler` function
GITHUB GTI RESOURCES MTASA UPDATE
Github bot, that will crawl mtasa wiki and update mtasa-lua-types continuously If you have any ideas, issues or suggestions - post them below, or in youtube comments, or in github issuesĮxample code (from youtube video) import )
GITHUB GTI RESOURCES MTASA INSTALL
So, you have to install NodeJS and download my boilerplate. If you would like to create a resource, you haven't to install it manually, just use the boilerplate.
![github gti resources mtasa github gti resources mtasa](https://4.bp.blogspot.com/-mS5Sar41a6I/XGOuyyVP3KI/AAAAAAAAD5U/MuLx-zN31ekj-z1prY_tbqyxpUnit1ehACLcBGAs/s1600/mta-sa-vw-araba-scripti2.png)
I have created this package to provide MTASA declarations in TypeScript.
![github gti resources mtasa github gti resources mtasa](https://raw.githubusercontent.com/mtasa-typescript/mtasa-lua-utils/HEAD/.docs/help.gif)
I have made the video, where I describe Lua disadvantages, explain, why I have chosen TypeScript (and language transpiling) and write an example. If you are not familiar with Lua or with scripting in general. When to not use TypeScript (where to use Lua instead of TypeScript)ġ. The TypeScript is being developed by Microsoft and, I believe, that TypeScript will be alive for several years. You are available to not use types in some parts of code (you are not restricted to use types everywhere). Thus, you can use TypeScript without modifying MTASA core. General purpose of TypeScriptToLua: convert (transpile) typescript code into Lua code. There is TypeScriptToLua project. My project is based on TypeScriptToLua (I use it as a dependency). MTASA Lua is still 5.1 (it is not developing). Lua, like any programming language, is developing, however MTASA core strongly linked to Lua 5.1. Hints (from your IDE). Lua is dynamic typed language, therefore, it's hard to determine, what the variable is and, hence, IDE cannot hint you function declarations, object methods and etc. That's make the source code more complicated, than it could be. If you want to write OOP code with your own classes, you have to use metatables to implement class objects behavior. Lua does not support classes (syntax) from scratch.
![github gti resources mtasa github gti resources mtasa](https://i.imgur.com/06t74fS.png)
I would like to share that project to receive some suggestions and, I believe, to help someone in resource writing.Ĭlasses. I am developing utility packages for transpiling TypeScript into an MTASA-compatible Lua code.