Skip to content

Setting Up Typescript

Trevor Wessel edited this page May 14, 2017 · 2 revisions

Setting Up Typescript for GTANetwork

Eraknelo released some Typescript files which is what Menu Builder uses.

So here's a link to that: Typescript Definition Files


In Visual Studio:




Install the typescript files.




Once you have it installed and have created a new typescript file. Take a look at the basic types.


After that, setup your tsconfig.json file in your project.

{
  "compilerOptions": {
    "alwaysStrict": true,
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": false,
    "target": "es6",
    "module": "commonjs"
  },
  "compileOnSave": true
}

Whenever you save your typeScript file it automatically compiles and ports it to javascript. So add all typescript files names as javascript files in your meta.

So if you want to use Menu Builder, you probably need to compile it and add it to your meta. ;)
  <script src="clientside/resources/menu_builder.js" type="client" lang="javascript" />