@gta5urban/types-server 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +114 -0
- package/enums.d.ts +140 -0
- package/hashes/ped_hashes.d.ts +743 -0
- package/hashes/vehicle_hashes.d.ts +541 -0
- package/hashes/weapon_hashes.d.ts +114 -0
- package/index.d.ts +1934 -0
- package/package.json +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 The RAGE Multiplayer Community and its contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Remember to 🌟 this GitHub if you 💖 it.
|
|
2
|
+
|
|
3
|
+
> This package contains types definitions for RAGE:MP server-side module.
|
|
4
|
+
|
|
5
|
+
### 📥 Installation
|
|
6
|
+
|
|
7
|
+
#### `SERVER-SIDE`
|
|
8
|
+
|
|
9
|
+
:fire: Use `github:ragempcommunity/ragemp-types#types-server` to latest build
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# With npm
|
|
13
|
+
npm i --save-dev @ragempcommunity/types-server
|
|
14
|
+
|
|
15
|
+
# With yarn
|
|
16
|
+
yarn add -D @ragempcommunity/types-server
|
|
17
|
+
|
|
18
|
+
# With pnpm
|
|
19
|
+
pnpm add -D @ragempcommunity/types-server
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 🤓 Usage
|
|
23
|
+
|
|
24
|
+
> To make these types detectable, you need to add the `types` property below to `tsconfig.json` on each side of your project.
|
|
25
|
+
|
|
26
|
+
```jsonc
|
|
27
|
+
// e.g server-side
|
|
28
|
+
{
|
|
29
|
+
"compilerOptions": {
|
|
30
|
+
"types": ["{RELATIVE_PATH_TO_NODE_MODULES}/@ragempcommunity/types-server"]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Full type-safe and auto-complete
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### To extend a Mp object, there are 2 ways:
|
|
42
|
+
|
|
43
|
+
1. By extending the prototype of the object:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
mp.Player.prototype.myMethod = function myMethod() {
|
|
47
|
+
// my method logic
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Usage
|
|
51
|
+
mp.events.add('playerReady', (player) => {
|
|
52
|
+
player.myProperty = 1;
|
|
53
|
+
|
|
54
|
+
player.myMethod();
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// @types/index.d.ts
|
|
60
|
+
declare global {
|
|
61
|
+
interface PlayerMp {
|
|
62
|
+
myProperty: number;
|
|
63
|
+
|
|
64
|
+
myMethod(): void;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
2. By extending the object itself:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
mp.events.add('playerReady', (player) => {
|
|
75
|
+
player.myProperty = 1;
|
|
76
|
+
|
|
77
|
+
player.myMethod = function myMethod() {
|
|
78
|
+
// my method logic
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// @types/index.d.ts
|
|
85
|
+
declare global {
|
|
86
|
+
interface PlayerMp {
|
|
87
|
+
myProperty: number;
|
|
88
|
+
|
|
89
|
+
myMethod(): void;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
See: [RAGEMP Typescript Boilerplate](https://github.com/ragempcommunity/ragemp-typescript)
|
|
97
|
+
|
|
98
|
+
## 👨💻 Contributing
|
|
99
|
+
|
|
100
|
+
To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.
|
|
101
|
+
|
|
102
|
+
1. Fork / Clone and select the `main` branch.
|
|
103
|
+
2. Create a new branch in your fork.
|
|
104
|
+
3. Make your changes.
|
|
105
|
+
4. Commit your changes and push them.
|
|
106
|
+
5. Submit a Pull Request [here](https://github.com/ragempcommunity/ragemp-types/pulls)!
|
|
107
|
+
|
|
108
|
+
## 🎉 Thanks
|
|
109
|
+
|
|
110
|
+
- [CocaColaBear](https://github.com/CocaColaBear/) - Creator of [types-ragemp-s](https://github.com/CocaColaBear/types-ragemp-s) & [types-ragemp-c](https://github.com/CocaColaBear/types-ragemp-c)
|
|
111
|
+
|
|
112
|
+
## 📋 License
|
|
113
|
+
|
|
114
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
package/enums.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
declare namespace RageEnums {
|
|
2
|
+
const enum ClothesComponent {
|
|
3
|
+
HEAD = 0,
|
|
4
|
+
MASK = 1,
|
|
5
|
+
HAIR = 2,
|
|
6
|
+
TORSO = 3,
|
|
7
|
+
LEGS = 4,
|
|
8
|
+
BAGS = 5,
|
|
9
|
+
SHOES = 6,
|
|
10
|
+
ACCESSORIES_1 = 7,
|
|
11
|
+
ACCESSORIES_2 = 8,
|
|
12
|
+
BODY_ARMORS = 9,
|
|
13
|
+
DECALS = 10,
|
|
14
|
+
AUXILIARY = 11
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const enum ColshapeType {
|
|
18
|
+
CIRCLE = 'circle',
|
|
19
|
+
CUBOID = 'cuboid',
|
|
20
|
+
POLYGON = 'polygon',
|
|
21
|
+
RECTANGLE = 'rectangle',
|
|
22
|
+
SPHERE = 'sphere',
|
|
23
|
+
TUBE = 'tube'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const enum EntityType {
|
|
27
|
+
BLIP = 'blip',
|
|
28
|
+
CHECKPOINT = 'checkpoint',
|
|
29
|
+
COLSHAPE = 'colshape',
|
|
30
|
+
DUMMY = 'dummy',
|
|
31
|
+
MARKER = 'marker',
|
|
32
|
+
OBJECT = 'object',
|
|
33
|
+
PICKUP = 'pickup',
|
|
34
|
+
PLAYER = 'player',
|
|
35
|
+
VEHICLE = 'vehicle',
|
|
36
|
+
PED = 'ped',
|
|
37
|
+
TEXT_LABEL = 'textlabel'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const enum HeadOverlay {
|
|
41
|
+
BLEMISHES = 0,
|
|
42
|
+
FACIAL_HAIR = 1,
|
|
43
|
+
EYEBROWS = 2,
|
|
44
|
+
AGEING = 3,
|
|
45
|
+
MAKEUP = 4,
|
|
46
|
+
BLUSH = 5,
|
|
47
|
+
COMPLEXION = 6,
|
|
48
|
+
SUN_DAMAGE = 7,
|
|
49
|
+
LIPSTICK = 8,
|
|
50
|
+
FRECKLES = 9,
|
|
51
|
+
CHEST_HAIR = 10,
|
|
52
|
+
BODY_BLEMISHES = 11,
|
|
53
|
+
ADD_BODY_BLEMISHES = 12
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const enum Marker {
|
|
57
|
+
UPSIDE_DOWN_CONE = 0,
|
|
58
|
+
VERTICAL_CYLINDER = 1,
|
|
59
|
+
THICK_CHEVRON_UP = 2,
|
|
60
|
+
THIN_CHEVRON_UP = 3,
|
|
61
|
+
CHECKERED_FLAG_RECT = 4,
|
|
62
|
+
CHECKERED_FLAG_CIRCLE = 5,
|
|
63
|
+
VERTICAL_CIRCLE = 6,
|
|
64
|
+
PLANE_MODEL = 7,
|
|
65
|
+
LOST_MC_DARK = 8,
|
|
66
|
+
LOST_MC_LIGHT = 9,
|
|
67
|
+
NUMBER_0 = 10,
|
|
68
|
+
NUMBER_1 = 11,
|
|
69
|
+
NUMBER_2 = 12,
|
|
70
|
+
NUMBER_3 = 13,
|
|
71
|
+
NUMBER_4 = 14,
|
|
72
|
+
NUMBER_5 = 15,
|
|
73
|
+
NUMBER_6 = 16,
|
|
74
|
+
NUMBER_7 = 17,
|
|
75
|
+
NUMBER_8 = 18,
|
|
76
|
+
NUMBER_9 = 19,
|
|
77
|
+
CHEVRON_UP_1 = 20,
|
|
78
|
+
CHEVRON_UP_2 = 21,
|
|
79
|
+
CHEVRON_UP_3 = 22,
|
|
80
|
+
HORIZONTAL_CIRCLE_FLAT = 23,
|
|
81
|
+
REPLAY_ICON = 24,
|
|
82
|
+
HORIZONTAL_CIRCLE_SKINNY = 25,
|
|
83
|
+
HORIZONTAL_CIRCLE_ARROW = 26,
|
|
84
|
+
HORIZONTAL_SPLIT_ARROW_CIRCLE = 27,
|
|
85
|
+
DEBUG_SPHERE = 28,
|
|
86
|
+
DOLLAR_SIGN = 29,
|
|
87
|
+
HORIZONTAL_BARS = 30,
|
|
88
|
+
WOLF_HEAD = 31
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const enum PlayerProp {
|
|
92
|
+
HELMET = 0,
|
|
93
|
+
GLASSES = 1,
|
|
94
|
+
EAR_ACCESSORY = 2
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const enum VehicleNumberPlateType {
|
|
98
|
+
BLUE_WHITE = 0,
|
|
99
|
+
YELLOW_BLACK = 1,
|
|
100
|
+
YELLOW_BLUE = 2,
|
|
101
|
+
BLUE_WHITE2 = 3,
|
|
102
|
+
BLUE_WHITE3 = 4,
|
|
103
|
+
YANKTON = 5
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const enum VehicleSeat {
|
|
107
|
+
DRIVER,
|
|
108
|
+
PASSENGER_1,
|
|
109
|
+
PASSENGER_2,
|
|
110
|
+
PASSENGER_3,
|
|
111
|
+
PASSENGER_4,
|
|
112
|
+
PASSENGER_5,
|
|
113
|
+
PASSENGER_6,
|
|
114
|
+
PASSENGER_7,
|
|
115
|
+
PASSENGER_8,
|
|
116
|
+
PASSENGER_9,
|
|
117
|
+
PASSENGER_10,
|
|
118
|
+
PASSENGER_11,
|
|
119
|
+
PASSENGER_12,
|
|
120
|
+
PASSENGER_13,
|
|
121
|
+
PASSENGER_14,
|
|
122
|
+
PASSENGER_15,
|
|
123
|
+
PASSENGER_16
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const enum Weather {
|
|
127
|
+
BLIZZARD = 'BLIZZARD',
|
|
128
|
+
CLEAR = 'CLEAR',
|
|
129
|
+
CLEARING = 'CLEARING',
|
|
130
|
+
CLOUDS = 'CLOUDS',
|
|
131
|
+
EXTRA_SUNNY = 'EXTRASUNNY',
|
|
132
|
+
FOGGY = 'FOGGY',
|
|
133
|
+
OVERCAST = 'OVERCAST',
|
|
134
|
+
RAIN = 'RAIN',
|
|
135
|
+
SMOG = 'SMOG',
|
|
136
|
+
SNOW_LIGHT = 'SNOWLIGHT',
|
|
137
|
+
THUNDER = 'THUNDER',
|
|
138
|
+
XMAS = 'XMAS'
|
|
139
|
+
}
|
|
140
|
+
}
|