@nativewrappers/redm 0.0.80 → 0.0.82

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.
Files changed (82) hide show
  1. package/Attribute.js +143 -0
  2. package/Controls.js +22 -0
  3. package/Game.d.ts +2 -2
  4. package/Game.js +18 -0
  5. package/GameConstants.d.ts +1 -1
  6. package/GameConstants.js +24 -0
  7. package/Model.js +153 -0
  8. package/RawControls.d.ts +1 -1
  9. package/RawControls.js +22 -0
  10. package/RelationshipGroup.js +72 -0
  11. package/Volume.d.ts +1 -1
  12. package/Volume.js +32 -0
  13. package/common/Command.js +111 -0
  14. package/common/Convar.js +58 -0
  15. package/common/GlobalData.js +16 -0
  16. package/common/Kvp.js +137 -0
  17. package/common/Resource.js +54 -0
  18. package/common/decors/Events.js +170 -0
  19. package/common/net/NetworkedMap.js +225 -0
  20. package/common/utils/ClassTypes.js +15 -0
  21. package/common/utils/Color.js +33 -0
  22. package/common/utils/Delay.d.ts +1 -0
  23. package/common/utils/Delay.js +6 -0
  24. package/common/utils/Maths.js +18 -0
  25. package/common/utils/Point.d.ts +9 -0
  26. package/common/utils/Point.js +36 -0
  27. package/common/utils/PointF.d.ts +1 -1
  28. package/common/utils/PointF.js +18 -0
  29. package/common/utils/Quaternion.d.ts +1 -1
  30. package/common/utils/Quaternion.js +33 -0
  31. package/common/utils/Vector.js +589 -0
  32. package/common/utils/cleanPlayerName.js +17 -0
  33. package/common/utils/enumValues.js +20 -0
  34. package/common/utils/getStringFromUInt8Array.js +6 -0
  35. package/common/utils/getUInt32FromUint8Array.js +6 -0
  36. package/definitions/Citizen.d.js +0 -0
  37. package/definitions/index.d.js +0 -0
  38. package/definitions/redm.d.js +0 -0
  39. package/entities/BaseEntity.d.ts +1 -1
  40. package/entities/BaseEntity.js +99 -0
  41. package/entities/Entity.d.ts +1 -1
  42. package/entities/Entity.js +99 -0
  43. package/entities/Ped.d.ts +1 -1
  44. package/entities/Ped.js +336 -0
  45. package/entities/Pickup.d.ts +4 -0
  46. package/entities/Pickup.js +14 -0
  47. package/entities/Player.js +57 -0
  48. package/entities/Prop.js +11 -0
  49. package/entities/Vehicle.d.ts +1 -1
  50. package/entities/Vehicle.js +23 -0
  51. package/enums/Attributes.js +56 -0
  52. package/enums/Entity.js +20 -0
  53. package/enums/Keys.js +809 -0
  54. package/enums/Ped.js +31 -0
  55. package/enums/RawKeys.js +234 -0
  56. package/enums/Relationship.js +13 -0
  57. package/enums/VehicleSeat.js +17 -0
  58. package/index.js +52 -3762
  59. package/interfaces/Dimensions.d.ts +1 -1
  60. package/interfaces/Dimensions.js +0 -0
  61. package/package.json +2 -2
  62. package/types/Throwable.js +0 -0
  63. package/utils/Native.js +8 -0
  64. package/world/createDraftVehicle.d.ts +2 -2
  65. package/world/createDraftVehicle.js +32 -0
  66. package/world/createPed.d.ts +2 -2
  67. package/world/createPed.js +28 -0
  68. package/world/createProp.d.ts +1 -1
  69. package/world/createProp.js +28 -0
  70. package/world/createVehicle.d.ts +2 -2
  71. package/world/createVehicle.js +28 -0
  72. package/common/index.d.ts +0 -8
  73. package/common/utils/Vector2.d.ts +0 -1
  74. package/common/utils/Vector3.d.ts +0 -1
  75. package/common/utils/Vector4.d.ts +0 -1
  76. package/common/utils/index.d.ts +0 -12
  77. package/entities/index.d.ts +0 -4
  78. package/enums/index.d.ts +0 -6
  79. package/index.d.ts +0 -12
  80. package/utils/index.d.ts +0 -2
  81. package/world/index.d.ts +0 -4
  82. /package/{game/index.d.ts → common/types.js} +0 -0
@@ -1,4 +1,4 @@
1
- import type { Vector3 } from "../common/utils/Vector3";
1
+ import type { Vector3 } from "../common/utils/Vector";
2
2
  export interface Dimensions {
3
3
  min: Vector3;
4
4
  max: Vector3;
File without changes
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "license": "MIT",
10
10
  "type": "module",
11
- "version": "0.0.80",
11
+ "version": "0.0.82",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/nativewrappers/nativewrappers.git"
@@ -29,6 +29,6 @@
29
29
  "./**/*.d.ts"
30
30
  ],
31
31
  "exports": {
32
- ".": "./index.js"
32
+ "./*": "./*"
33
33
  }
34
34
  }
File without changes
@@ -0,0 +1,8 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const _N = /* @__PURE__ */ __name((hash, ...args) => {
4
+ return Citizen.invokeNative(hash, ...args);
5
+ }, "_N");
6
+ export {
7
+ _N
8
+ };
@@ -1,5 +1,5 @@
1
- import type { Vector3 } from "../common/utils";
2
- import { Vehicle } from "redm/entities";
1
+ import type { Vector3 } from "../common/utils/Vector";
2
+ import { Vehicle } from "redm/entities/Vehicle";
3
3
  import type { Model } from "redm/Model";
4
4
  /**
5
5
  * Creates a vehicle at the specified {@param spawnPos}, you don't need to request the model before this.
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { Vehicle } from "redm/entities/Vehicle";
4
+ import { _N } from "redm/utils/Native";
5
+ async function createDraftVehicle(model, spawnPos, heading, isNetwork = false, bScriptHostVeh = true, bDontAutoCreateDraftAnimals = true, draftAnimalPopGroup = 0, p9 = true) {
6
+ if (!model.IsPed || !model.request(1e3)) {
7
+ return null;
8
+ }
9
+ const draftVehHandle = _N(
10
+ "0x214651FB1DFEBA89",
11
+ model.Hash,
12
+ spawnPos.x,
13
+ spawnPos.y,
14
+ spawnPos.z,
15
+ heading,
16
+ isNetwork,
17
+ bScriptHostVeh,
18
+ bDontAutoCreateDraftAnimals,
19
+ draftAnimalPopGroup,
20
+ p9,
21
+ Citizen.resultAsInteger()
22
+ );
23
+ if (draftVehHandle !== 0) {
24
+ model.markAsNoLongerNeeded();
25
+ return new Vehicle(draftVehHandle);
26
+ }
27
+ return null;
28
+ }
29
+ __name(createDraftVehicle, "createDraftVehicle");
30
+ export {
31
+ createDraftVehicle
32
+ };
@@ -1,5 +1,5 @@
1
- import type { Vector3 } from "../common/utils";
2
- import { Ped } from "redm/entities";
1
+ import type { Vector3 } from "../common/utils/Vector";
2
+ import { Ped } from "redm/entities/Ped";
3
3
  import type { Model } from "redm/Model";
4
4
  /**
5
5
  * Creates a ped at the specified {@param spawnPos}, you don't need to request the model before this.
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { Ped } from "redm/entities/Ped";
4
+ async function createPed(model, spawnPos, heading, isNetwork = false, bScriptHostPed = true, p7 = true, p8 = true) {
5
+ if (!model.IsPed || !model.request(1e3)) {
6
+ return null;
7
+ }
8
+ const pedHandle = CreatePed(
9
+ model.Hash,
10
+ spawnPos.x,
11
+ spawnPos.y,
12
+ spawnPos.z,
13
+ heading,
14
+ isNetwork,
15
+ bScriptHostPed,
16
+ p7,
17
+ p8
18
+ );
19
+ if (pedHandle !== 0) {
20
+ model.markAsNoLongerNeeded();
21
+ return new Ped(pedHandle);
22
+ }
23
+ return null;
24
+ }
25
+ __name(createPed, "createPed");
26
+ export {
27
+ createPed
28
+ };
@@ -1,4 +1,4 @@
1
- import type { Vector3 } from "../common/utils";
1
+ import type { Vector3 } from "../common/utils/Vector";
2
2
  import { Prop } from "redm/entities/Prop";
3
3
  import type { Model } from "redm/Model";
4
4
  /**
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { Prop } from "redm/entities/Prop";
4
+ async function createProp(model, spawnPos, heading, isNetwork = false, bScriptHostProp = true, dynamic = true, p7 = true, p8 = true) {
5
+ if (!model.IsProp || !model.request(1e3)) {
6
+ return null;
7
+ }
8
+ const propHandle = CreateObject(
9
+ model.Hash,
10
+ spawnPos.x,
11
+ spawnPos.y,
12
+ spawnPos.z,
13
+ isNetwork,
14
+ bScriptHostProp,
15
+ dynamic,
16
+ p7,
17
+ p8
18
+ );
19
+ if (propHandle !== 0) {
20
+ model.markAsNoLongerNeeded();
21
+ return new Prop(propHandle);
22
+ }
23
+ return null;
24
+ }
25
+ __name(createProp, "createProp");
26
+ export {
27
+ createProp
28
+ };
@@ -1,5 +1,5 @@
1
- import type { Vector3 } from "../common/utils";
2
- import { Vehicle } from "redm/entities";
1
+ import type { Vector3 } from "../common/utils/Vector";
2
+ import { Vehicle } from "redm/entities/Vehicle";
3
3
  import type { Model } from "redm/Model";
4
4
  /**
5
5
  * Creates a vehicle at the specified {@param spawnPos}, you don't need to request the model before this.
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { Vehicle } from "redm/entities/Vehicle";
4
+ async function createVehicle(model, spawnPos, heading, isNetwork = false, bScriptHostVeh = true, bDontAutoCreateDraftAnimals = true, p8 = true) {
5
+ if (!model.IsPed || !model.request(1e3)) {
6
+ return null;
7
+ }
8
+ const pedHandle = CreateVehicle(
9
+ model.Hash,
10
+ spawnPos.x,
11
+ spawnPos.y,
12
+ spawnPos.z,
13
+ heading,
14
+ isNetwork,
15
+ bScriptHostVeh,
16
+ bDontAutoCreateDraftAnimals,
17
+ p8
18
+ );
19
+ if (pedHandle !== 0) {
20
+ model.markAsNoLongerNeeded();
21
+ return new Vehicle(pedHandle);
22
+ }
23
+ return null;
24
+ }
25
+ __name(createVehicle, "createVehicle");
26
+ export {
27
+ createVehicle
28
+ };
package/common/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./utils";
2
- export * from "./net/NetworkedMap";
3
- export * from "./decors/Events";
4
- export * from "./Convar";
5
- export * from "./Command";
6
- export * from "./Kvp";
7
- export * from "./Resource";
8
- export * from "./utils/index";
@@ -1 +0,0 @@
1
- export { Vector2 } from "./Vector";
@@ -1 +0,0 @@
1
- export { Vector3 } from "./Vector";
@@ -1 +0,0 @@
1
- export { Vector4 } from "./Vector";
@@ -1,12 +0,0 @@
1
- export * from "./Vector2";
2
- export * from "./Vector3";
3
- export * from "./Vector4";
4
- export * from "./PointF";
5
- export * from "./Maths";
6
- export * from "./Quaternion";
7
- export * from "./Color";
8
- export { cleanPlayerName } from "./cleanPlayerName";
9
- export declare const Delay: (milliseconds: number) => Promise<void>;
10
- export { enumValues } from "./enumValues";
11
- export { getStringFromUInt8Array } from "./getStringFromUInt8Array";
12
- export { getUInt32FromUint8Array } from "./getUInt32FromUint8Array";
@@ -1,4 +0,0 @@
1
- export * from "./Entity";
2
- export * from "./Ped";
3
- export * from "./Player";
4
- export * from "./Vehicle";
package/enums/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from "./Attributes";
2
- export * from "./Ped";
3
- export * from "./Relationship";
4
- export * from "./VehicleSeat";
5
- export * from "./Keys";
6
- export * from "./RawKeys";
package/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export * from "./entities/index";
2
- export * from "./enums/index";
3
- export * from "./Volume";
4
- export * from "./Controls";
5
- export * from "./RawControls";
6
- export * from "./Game";
7
- export * from "./world";
8
- export * from "./GameConstants";
9
- export * from "./RelationshipGroup";
10
- export * from "./Attribute";
11
- export * from "./Model";
12
- export * from "./common/index";
package/utils/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./Native";
2
- export { Vector2, Vector3, Vector4, Maths, Color, Quaternion, Delay, enumValues, getStringFromUInt8Array, getUInt32FromUint8Array, } from "../common/utils/index";
package/world/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { createPed } from "./createPed";
2
- export { createProp } from "./createProp";
3
- export { createVehicle } from "./createVehicle";
4
- export { createDraftVehicle } from "./createDraftVehicle";
File without changes