@nativewrappers/fivem 0.0.1 → 0.0.4

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.
@@ -4,227 +4,63 @@ import { VehicleType } from '../enum/VehicleType';
4
4
  import { Hash } from '../type/Hash';
5
5
  import { Color } from '../utils';
6
6
  import { BaseEntity } from './BaseEntity';
7
- /** @extends BaseEntity */
8
7
  export declare class Vehicle extends BaseEntity {
9
- /**
10
- * @protected
11
- * @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Vehicle
12
- */
13
8
  protected type: ClassTypes;
14
9
  constructor(handle: number);
15
10
  /**
16
11
  * Get an interable list of vehicles currently on the server
17
- * @public
18
- * @static
19
- * @returns {IterableIterator<Vehicle>} Iterable list of Vehicles.
12
+ * @returns Iterable list of Vehicles.
20
13
  */
21
14
  static AllVehicles(): IterableIterator<Vehicle>;
22
- /**
23
- * @public
24
- * @static
25
- * @param {number} netId
26
- * @returns {Vehicle}
27
- */
28
15
  static fromNetworkId(netId: number): Vehicle;
29
- /**
30
- * @public
31
- * @static
32
- * @param {number} handle
33
- * @returns {Vehicle}
34
- */
35
16
  static fromHandle(handle: number): Vehicle;
36
- /**
37
- * @public
38
- */
39
17
  get IsEngineRunning(): boolean;
40
- /**
41
- * @public
42
- */
43
18
  get IsPrimaryColourCustom(): boolean;
44
- /**
45
- * @public
46
- */
47
19
  get IsSecondaryColourCustom(): boolean;
48
- /**
49
- * @public
50
- */
51
20
  get BodyHealth(): number;
52
- /**
53
- * @public
54
- */
55
21
  get VehicleColours(): [number, number];
56
- /**
57
- * @public
58
- */
59
22
  get CustomPrimaryColour(): Color;
60
- /**
61
- * @public
62
- */
63
23
  get CustomSecondaryColour(): Color;
64
- /**
65
- * @public
66
- */
67
24
  get DashboardColour(): number;
68
- /**
69
- * @public
70
- */
71
25
  get DirtLevel(): number;
72
- /**
73
- * @public
74
- */
75
26
  get LockStatus(): VehicleLockStatus;
76
- /**
77
- * @public
78
- */
79
27
  get DoorStatus(): number;
80
- /**
81
- * @public
82
- */
83
28
  get DoorsLockedForPlayer(): number;
84
- /**
85
- * @public
86
- */
87
29
  get EngineHealth(): number;
88
- /**
89
- * @public
90
- */
91
30
  get ExtraColours(): [number, number];
92
- /**
93
- * @public
94
- */
95
31
  get FlightNozzlePosition(): number;
96
- /**
97
- * @public
98
- */
99
32
  get Handbrake(): boolean;
100
- /**
101
- * @public
102
- */
103
33
  get HeadlightsColour(): number;
104
- /**
105
- * @public
106
- */
107
34
  get HomingLockonState(): number;
108
- /**
109
- * @public
110
- */
111
35
  get InteriorColour(): number;
112
- /**
113
- * @public
114
- */
115
36
  get LightsState(): [boolean, boolean];
116
- /**
117
- * @public
118
- */
119
37
  get Livery(): number;
120
- /**
121
- * @public
122
- */
123
38
  get LockOnTarget(): Vehicle;
124
- /**
125
- * @public
126
- */
127
39
  get Plate(): string;
128
- /**
129
- * @public
130
- */
131
40
  get PlateIndex(): number;
132
- /**
133
- * @public
134
- */
135
41
  get PetrolTankHealth(): number;
136
- /**
137
- * @public
138
- */
139
42
  get RadioStation(): number;
140
- /**
141
- * @public
142
- */
143
43
  get RoofLivery(): number;
144
- /**
145
- * @public
146
- */
147
44
  get SteeringAngle(): number;
148
- /**
149
- * @public
150
- */
151
45
  get VehicleType(): VehicleType;
152
- /**
153
- * @public
154
- */
155
46
  get TyreSmokeColour(): Color;
156
- /**
157
- * @public
158
- */
159
47
  get WheelType(): number;
160
- /**
161
- * @public
162
- */
163
48
  get WindowTint(): number;
164
- /**
165
- * @public
166
- */
167
49
  get HasBeenOwnedByPlayer(): boolean;
168
- /**
169
- * @public
170
- */
171
50
  get IsEngineStarting(): boolean;
172
- /**
173
- * @public
174
- */
175
51
  get IsSirenOn(): boolean;
176
- /**
177
- * @public
178
- */
179
52
  get MaxHealth(): number;
180
- /**
181
- * @public
182
- */
183
53
  get ScriptTaskCommand(): Hash;
184
- /**
185
- * @public
186
- */
187
54
  get ScriptTaskStage(): Hash;
188
- /**
189
- * @public
190
- */
191
55
  get MainRotorHealth(): number;
192
- /**
193
- * @public
194
- */
195
56
  get TailRotorHealth(): number;
196
57
  /**
197
58
  * This might supposed to be TrainEngineHealth?
198
- * @public
199
59
  */
200
60
  get TrainCarriageEngine(): number;
201
- /**
202
- * @public
203
- */
204
61
  get TrainCarriageIndex(): number;
205
- /**
206
- * @public
207
- * @param {number} wheelId
208
- * @param {boolean} completely
209
- * @returns {boolean}
210
- */
211
62
  isTyreBurst(wheelId: number, completely: boolean): boolean;
212
- /**
213
- * @public
214
- * @param {number} extraId
215
- * @returns {boolean}
216
- */
217
63
  isExtraTurnedOn(extraId: number): boolean;
218
- /**
219
- * @public
220
- * @param {number} seatIndex
221
- * @returns {number}
222
- */
223
64
  getPedInSeat(seatIndex: number): number;
224
- /**
225
- * @public
226
- * @param {number} seatIndex
227
- * @returns {number}
228
- */
229
65
  getLastPedInSeat(seatIndex: number): number;
230
66
  }
@@ -1,330 +1,166 @@
1
1
  import { ClassTypes } from '../enum/ClassTypes';
2
2
  import { Color } from '../utils';
3
3
  import { BaseEntity } from './BaseEntity';
4
- /** @extends BaseEntity */
5
4
  export class Vehicle extends BaseEntity {
6
5
  constructor(handle) {
7
6
  super(handle);
8
- /**
9
- * @protected
10
- * @default import("/home/skaggs/projects/fivem/server/src/enum/ClassTypes").ClassTypes.Vehicle
11
- */
12
7
  this.type = ClassTypes.Vehicle;
13
8
  }
14
9
  /**
15
10
  * Get an interable list of vehicles currently on the server
16
- * @public
17
- * @static
18
- * @returns {IterableIterator<Vehicle>} Iterable list of Vehicles.
11
+ * @returns Iterable list of Vehicles.
19
12
  */
20
13
  static *AllVehicles() {
21
14
  for (const veh of GetAllVehicles()) {
22
15
  yield new Vehicle(veh);
23
16
  }
24
17
  }
25
- /**
26
- * @public
27
- * @static
28
- * @param {number} netId
29
- * @returns {Vehicle}
30
- */
31
18
  static fromNetworkId(netId) {
32
19
  return new Vehicle(NetworkGetEntityFromNetworkId(netId));
33
20
  }
34
- /**
35
- * @public
36
- * @static
37
- * @param {number} handle
38
- * @returns {Vehicle}
39
- */
40
21
  static fromHandle(handle) {
41
22
  return new Vehicle(handle);
42
23
  }
43
- /**
44
- * @public
45
- */
46
24
  get IsEngineRunning() {
47
25
  return GetIsVehicleEngineRunning(this.handle);
48
26
  }
49
- /**
50
- * @public
51
- */
52
27
  get IsPrimaryColourCustom() {
53
28
  return GetIsVehiclePrimaryColourCustom(this.handle);
54
29
  }
55
- /**
56
- * @public
57
- */
58
30
  get IsSecondaryColourCustom() {
59
31
  return GetIsVehicleSecondaryColourCustom(this.handle);
60
32
  }
61
- /**
62
- * @public
63
- */
64
33
  get BodyHealth() {
65
34
  return GetVehicleBodyHealth(this.handle);
66
35
  }
67
- /**
68
- * @public
69
- */
70
36
  get VehicleColours() {
71
37
  return GetVehicleColours(this.handle);
72
38
  }
73
- /**
74
- * @public
75
- */
76
39
  get CustomPrimaryColour() {
77
40
  return Color.fromArray(GetVehicleCustomPrimaryColour(this.handle));
78
41
  }
79
- /**
80
- * @public
81
- */
82
42
  get CustomSecondaryColour() {
83
43
  return Color.fromArray(GetVehicleCustomSecondaryColour(this.handle));
84
44
  }
85
- /**
86
- * @public
87
- */
88
45
  get DashboardColour() {
89
46
  return GetVehicleDashboardColour(this.handle);
90
47
  }
91
- /**
92
- * @public
93
- */
94
48
  get DirtLevel() {
95
49
  return GetVehicleDirtLevel(this.handle);
96
50
  }
97
- /**
98
- * @public
99
- */
100
51
  get LockStatus() {
101
52
  return GetVehicleDoorLockStatus(this.handle);
102
53
  }
103
- /**
104
- * @public
105
- */
106
54
  get DoorStatus() {
107
55
  return GetVehicleDoorStatus(this.handle);
108
56
  }
109
- /**
110
- * @public
111
- */
112
57
  get DoorsLockedForPlayer() {
113
58
  return GetVehicleDoorsLockedForPlayer(this.handle);
114
59
  }
115
- /**
116
- * @public
117
- */
118
60
  get EngineHealth() {
119
61
  return GetVehicleEngineHealth(this.handle);
120
62
  }
121
- /**
122
- * @public
123
- */
124
63
  get ExtraColours() {
125
64
  return GetVehicleExtraColours(this.handle);
126
65
  }
127
- /**
128
- * @public
129
- */
130
66
  get FlightNozzlePosition() {
131
67
  return GetVehicleFlightNozzlePosition(this.handle);
132
68
  }
133
- /**
134
- * @public
135
- */
136
69
  get Handbrake() {
137
70
  return GetVehicleHandbrake(this.handle);
138
71
  }
139
- /**
140
- * @public
141
- */
142
72
  get HeadlightsColour() {
143
73
  return GetVehicleHeadlightsColour(this.handle);
144
74
  }
145
- /**
146
- * @public
147
- */
148
75
  get HomingLockonState() {
149
76
  return GetVehicleHomingLockonState(this.handle);
150
77
  }
151
- /**
152
- * @public
153
- */
154
78
  get InteriorColour() {
155
79
  return GetVehicleInteriorColour(this.handle);
156
80
  }
157
- /**
158
- * @public
159
- */
160
81
  get LightsState() {
161
82
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
162
83
  const [_, lightsOn, highbeansOn] = GetVehicleLightsState(this.handle);
163
84
  return [lightsOn, highbeansOn];
164
85
  }
165
- /**
166
- * @public
167
- */
168
86
  get Livery() {
169
87
  return GetVehicleLivery(this.handle);
170
88
  }
171
- /**
172
- * @public
173
- */
174
89
  get LockOnTarget() {
175
90
  return new Vehicle(GetVehicleLockOnTarget(this.handle));
176
91
  }
177
- /**
178
- * @public
179
- */
180
92
  get Plate() {
181
93
  return GetVehicleNumberPlateText(this.handle);
182
94
  }
183
- /**
184
- * @public
185
- */
186
95
  get PlateIndex() {
187
96
  return GetVehicleNumberPlateTextIndex(this.handle);
188
97
  }
189
- /**
190
- * @public
191
- */
192
98
  get PetrolTankHealth() {
193
99
  return GetVehiclePetrolTankHealth(this.handle);
194
100
  }
195
- /**
196
- * @public
197
- */
198
101
  get RadioStation() {
199
102
  return GetVehicleRadioStationIndex(this.handle);
200
103
  }
201
- /**
202
- * @public
203
- */
204
104
  get RoofLivery() {
205
105
  return GetVehicleRoofLivery(this.handle);
206
106
  }
207
- /**
208
- * @public
209
- */
210
107
  get SteeringAngle() {
211
108
  return GetVehicleSteeringAngle(this.handle);
212
109
  }
213
- /**
214
- * @public
215
- */
216
110
  get VehicleType() {
217
111
  return GetVehicleType(this.handle);
218
112
  }
219
- /**
220
- * @public
221
- */
222
113
  get TyreSmokeColour() {
223
114
  return Color.fromArray(GetVehicleTyreSmokeColor(this.handle));
224
115
  }
225
- /**
226
- * @public
227
- */
228
116
  get WheelType() {
229
117
  return GetVehicleWheelType(this.handle);
230
118
  }
231
- /**
232
- * @public
233
- */
234
119
  get WindowTint() {
235
120
  return GetVehicleWindowTint(this.handle);
236
121
  }
237
- /**
238
- * @public
239
- */
240
122
  get HasBeenOwnedByPlayer() {
241
123
  return HasVehicleBeenOwnedByPlayer(this.handle);
242
124
  }
243
- /**
244
- * @public
245
- */
246
125
  get IsEngineStarting() {
247
126
  return IsVehicleEngineStarting(this.handle);
248
127
  }
249
- /**
250
- * @public
251
- */
252
128
  get IsSirenOn() {
253
129
  return IsVehicleSirenOn(this.handle);
254
130
  }
255
- /**
256
- * @public
257
- */
258
131
  get MaxHealth() {
259
132
  return GetPedMaxHealth(this.handle);
260
133
  }
261
- /**
262
- * @public
263
- */
264
134
  get ScriptTaskCommand() {
265
135
  return GetPedScriptTaskCommand(this.handle);
266
136
  }
267
- /**
268
- * @public
269
- */
270
137
  get ScriptTaskStage() {
271
138
  return GetPedScriptTaskStage(this.handle);
272
139
  }
273
- /**
274
- * @public
275
- */
276
140
  get MainRotorHealth() {
277
141
  return GetHeliMainRotorHealth(this.handle);
278
142
  }
279
- /**
280
- * @public
281
- */
282
143
  get TailRotorHealth() {
283
144
  return GetHeliTailRotorHealth(this.handle);
284
145
  }
285
146
  /**
286
147
  * This might supposed to be TrainEngineHealth?
287
- * @public
288
148
  */
289
149
  get TrainCarriageEngine() {
290
150
  return GetTrainCarriageEngine(this.handle);
291
151
  }
292
- /**
293
- * @public
294
- */
295
152
  get TrainCarriageIndex() {
296
153
  return GetTrainCarriageIndex(this.handle);
297
154
  }
298
- /**
299
- * @public
300
- * @param {number} wheelId
301
- * @param {boolean} completely
302
- * @returns {boolean}
303
- */
304
155
  isTyreBurst(wheelId, completely) {
305
156
  return IsVehicleTyreBurst(this.handle, wheelId, completely);
306
157
  }
307
- /**
308
- * @public
309
- * @param {number} extraId
310
- * @returns {boolean}
311
- */
312
158
  isExtraTurnedOn(extraId) {
313
159
  return IsVehicleExtraTurnedOn(this.handle, extraId);
314
160
  }
315
- /**
316
- * @public
317
- * @param {number} seatIndex
318
- * @returns {number}
319
- */
320
161
  getPedInSeat(seatIndex) {
321
162
  return GetPedInVehicleSeat(this.handle, seatIndex);
322
163
  }
323
- /**
324
- * @public
325
- * @param {number} seatIndex
326
- * @returns {number}
327
- */
328
164
  getLastPedInSeat(seatIndex) {
329
165
  return GetLastPedInVehicleSeat(this.handle, seatIndex);
330
166
  }