<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Using_Typescript</id>
	<title>Using Typescript - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Using_Typescript"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Using_Typescript&amp;action=history"/>
	<updated>2026-07-24T18:41:18Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Using_Typescript&amp;diff=15604&amp;oldid=prev</id>
		<title>imported&gt;Shr0x в 17:35, 29 мая 2024</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Using_Typescript&amp;diff=15604&amp;oldid=prev"/>
		<updated>2024-05-29T17:35:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
[[Category:Typescript]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Information =&lt;br /&gt;
&lt;br /&gt;
Typescript is a really great resource for C# users looking for a similar language for writing client and server side resources.&lt;br /&gt;
Luckily for us there are a few users out there who have created Typescript definitions for the RAGEMP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;d like a quick startup without going through the installation said below you can install an already made boilerplate such as:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/leonardssh/ragemp-typescript RAGEMP Typescript Boilerplate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
* [https://nodejs.org/ NodeJS] Installed&lt;br /&gt;
* [https://wiki.rage.mp/index.php?title=Getting_Started_with_Server General Server Setup] Done&lt;br /&gt;
* [https://code.visualstudio.com/ Visual Studio Code] Installed&lt;br /&gt;
* [https://github.com/ragempcommunity/ragemp-types RAGEMP Type Definitions] Installed&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
Open Visual Studio Code&lt;br /&gt;
&lt;br /&gt;
Pressing &amp;lt;code&amp;gt;ctrl + `&amp;lt;/code&amp;gt; (or by going to File &amp;gt; Terminal &amp;gt; New terminal) will open a terminal.&lt;br /&gt;
&lt;br /&gt;
Initialize a new Nodejs project by running the commands below in your terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;npm init&amp;lt;/pre&amp;gt; Or for a quick setup: &amp;lt;pre&amp;gt;npm init -y&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
After you&amp;#039;re done initializing the new nodejs project, execute the command below to install typescript:&lt;br /&gt;
&amp;lt;pre&amp;gt;npm install -g typescript&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To verify that you have installed typescript correctly type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tsc --version //should output typescript version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Adding Typescript Definitions =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client-Side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# With npm&lt;br /&gt;
&amp;gt; npm i --save-dev @ragempcommunity/types-client&lt;br /&gt;
&lt;br /&gt;
# With yarn&lt;br /&gt;
&amp;gt; yarn add -D @ragempcommunity/types-client&lt;br /&gt;
&lt;br /&gt;
# With pnpm&lt;br /&gt;
&amp;gt; pnpm add -D @ragempcommunity/types-client&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Server-Side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# With npm&lt;br /&gt;
&amp;gt; npm i --save-dev @ragempcommunity/types-server&lt;br /&gt;
&lt;br /&gt;
# With yarn&lt;br /&gt;
&amp;gt; yarn add -D @ragempcommunity/types-server&lt;br /&gt;
&lt;br /&gt;
# With pnpm&lt;br /&gt;
&amp;gt; pnpm add -D @ragempcommunity/types-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of these happen to be working properly you can try removing &amp;lt;code&amp;gt;-g&amp;lt;/code&amp;gt;. That&amp;#039;s just a global install function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can verify if it&amp;#039;s working properly by creating a new Typescript file. &amp;lt;code&amp;gt;.ts&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then begin programming by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mp.game&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If working properly you will have auto-fill available.&lt;br /&gt;
&lt;br /&gt;
= Workspace Help =&lt;br /&gt;
&lt;br /&gt;
When you&amp;#039;re working with Typescript you want your workspace to be setup in &amp;lt;code&amp;gt;clientside_resources&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can do this by going to: &amp;lt;code&amp;gt;File -&amp;gt; Open Folder -&amp;gt; clientside_resources&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After you should initialize your typescript directory by doing &amp;lt;code&amp;gt;Ctrl + `&amp;lt;/code&amp;gt; and typing &amp;lt;code&amp;gt;tsc --init&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If done correctly you will have a &amp;lt;code&amp;gt;tsconfig.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Compiling your Typescript Files =&lt;br /&gt;
&lt;br /&gt;
You mainly want to do this through your command prompt. You can open up a prompt in Visual Studio Code by press &amp;lt;code&amp;gt;Ctrl + `&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This will allow you to easily type &amp;lt;code&amp;gt;tsc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If done properly you will see newly compiled JavaScript files available in the same directory as the files you have created.&lt;/div&gt;</summary>
		<author><name>imported&gt;Shr0x</name></author>
	</entry>
</feed>