@nativewrappers/common 0.0.49 → 0.0.50

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Remco Troost <d0p3t>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.49",
7
+ "version": "0.0.50",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/nativewrappers/fivem.git"
package/utils/Vector.d.ts CHANGED
@@ -205,8 +205,8 @@ declare class Vector {
205
205
  * @returns The magnitude of the vector.
206
206
  */
207
207
  static Length<T extends VectorType, U extends VectorLike>(this: T, obj: U): number;
208
- readonly type: unknown;
209
- readonly [size]: number;
208
+ type: unknown;
209
+ [size]: number;
210
210
  x: number;
211
211
  y: number;
212
212
  z: number | undefined;
@@ -308,6 +308,7 @@ declare class Vector {
308
308
  */
309
309
  export declare class Vector2 extends Vector {
310
310
  readonly type = ClassTypes.Vector2;
311
+ readonly [size]: number;
311
312
  static readonly Zero: Vector2;
312
313
  /**
313
314
  * Constructs a new 2D vector.
@@ -328,6 +329,7 @@ export declare class Vector2 extends Vector {
328
329
  */
329
330
  export declare class Vector3 extends Vector implements Vec3 {
330
331
  readonly type = ClassTypes.Vector3;
332
+ readonly [size]: number;
331
333
  z: number;
332
334
  static readonly Zero: Vector3;
333
335
  static readonly UnitX: Vector3;
@@ -376,6 +378,7 @@ export declare class Vector3 extends Vector implements Vec3 {
376
378
  */
377
379
  export declare class Vector4 extends Vector {
378
380
  readonly type = ClassTypes.Vector4;
381
+ readonly [size]: number;
379
382
  z: number;
380
383
  w: number;
381
384
  static readonly Zero: Vector4;
package/utils/Vector.js CHANGED
@@ -286,14 +286,6 @@ class Vector {
286
286
  }
287
287
  this.x = x;
288
288
  this.y = y;
289
- if (z !== undefined) {
290
- this.z = z;
291
- ++this[size];
292
- }
293
- if (w !== undefined) {
294
- this.w = w;
295
- ++this[size];
296
- }
297
289
  }
298
290
  *[Symbol.iterator]() {
299
291
  yield this.x;
@@ -440,6 +432,7 @@ export class Vector2 extends Vector {
440
432
  // DO NOT USE, ONLY EXPOSED BECAUSE TS IS TRASH, THIS TYPE IS NOT GUARANTEED
441
433
  // TO EXIST, CHANGING IT WILL BREAK STUFF
442
434
  type = ClassTypes.Vector2;
435
+ [size] = 2;
443
436
  static Zero = new Vector2(0, 0);
444
437
  /**
445
438
  * Constructs a new 2D vector.
@@ -468,6 +461,7 @@ export class Vector3 extends Vector {
468
461
  // DO NOT USE, ONLY EXPOSED BECAUSE TS IS TRASH, THIS TYPE IS NOT GUARANTEED
469
462
  // TO EXIST, CHANGING IT WILL BREAK STUFF
470
463
  type = ClassTypes.Vector3;
464
+ [size] = 3;
471
465
  z = 0;
472
466
  static Zero = new Vector3(0, 0, 0);
473
467
  static UnitX = new Vector3(1.0, 0.0, 0.0);
@@ -491,6 +485,7 @@ export class Vector3 extends Vector {
491
485
  */
492
486
  constructor(x, y = x, z = y) {
493
487
  super(x, y, z);
488
+ this.z = z;
494
489
  }
495
490
  /**
496
491
  * Creates a new vector based on the provided parameters.
@@ -530,6 +525,7 @@ export class Vector4 extends Vector {
530
525
  // DO NOT USE, ONLY EXPOSED BECAUSE TS IS TRASH, THIS TYPE IS NOT GUARANTEED
531
526
  // TO EXIST, CHANGING IT WILL BREAK STUFF
532
527
  type = ClassTypes.Vector4;
528
+ [size] = 4;
533
529
  z = 0;
534
530
  w = 0;
535
531
  static Zero = new Vector4(0, 0, 0, 0);
@@ -542,6 +538,8 @@ export class Vector4 extends Vector {
542
538
  */
543
539
  constructor(x, y = x, z = y, w = z) {
544
540
  super(x, y, z, w);
541
+ this.z = w;
542
+ this.w = w;
545
543
  }
546
544
  /**
547
545
  * Creates a new vector based on the provided parameters.