Typescript is a really great resource for C# users looking for a similar language for writing client-side resources.
Luckily for us there are a few users out there who have created Typescript definitions for the client-side code.
You may obtain them from:
- NodeJS Installed
- General Server Setup Done
- Visual Studio Code
Open Visual Studio Code
ctrl + ` will open a terminal.
You can install typescript by running the following command:
npm install -g typescript
To verify that you have installed typescript correctly type:
Adding Typescript Definitions
npm install --save-dev github:CocaColaBear/types-ragemp-c#master or npm install --save-dev https://github.com/CocaColaBear/types-ragemp-c/tarball/master
npm install --save-dev github:CocaColaBear/types-ragemp-s#master
If neither of these happen to be working properly you can try removing
-g. That's just a global install function.
You can verify if it's working properly by creating a new Typescript file.
Then begin programming by typing:
If working properly you will have auto-fill available.
When you're working with Typescript you want your workspace to be setup in
You can do this by going to:
File -> Open Folder -> clientside_resources
After you should initialize your typescript directory by doing
Ctrl + ` and typing
If done correctly you will have a
Compiling your Typescript Files
You mainly want to do this through your command prompt. You can open up a prompt in Visual Studio Code by press
Ctrl + `.
This will allow you to easily type