@cybermp/client-types 1.2.2 → 1.2.3

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.
@@ -1,67 +1,67 @@
1
- /// <reference path="./enums.d.ts" />
2
-
3
- /**
4
- * Class with custom CyberMP native methods.
5
- */
6
- declare interface CyberMP {
7
- /**
8
- * Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
9
- * @param objectClassMap Array of class names to delete.
10
- */
11
- DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
12
-
13
- /**
14
- * Removes game objects by their unique hashes from the map.
15
- * @param objectHashMap Array of unique game object hashes to delete.
16
- */
17
- DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
18
-
19
- /**
20
- * Enables or disables synchronization of default effects, as defined by the CyberMP platform.
21
- * @param value Whether to use the default effects.
22
- */
23
- UseDefaultEffectsByPlatform(value: boolean): void;
24
- }
25
-
26
- declare interface worldWeatherScriptInterface extends IScriptable {
27
- public SetWeather(
28
- weather: CyberEnums.WeatherState,
29
- blendTime?: number,
30
- priority?: number,
31
- ): void;
32
- public ResetWeather(forceRestore?: boolean, blendTime?: number): void;
33
- public GetWeatherState(): worldWeatherState;
34
- public GetEnvironmentDefinition(): worldEnvironmentDefinition;
35
- }
36
-
37
- declare interface vehicleBaseObject extends gameObject {
38
- public HasGravity(): boolean;
39
- public EnableGravity(is_enable: boolean): boolean;
40
- public AddLinelyVelocity(
41
- velocity: Vector3,
42
- angularVelocity: Vector3,
43
- ): boolean;
44
- public ChangeLinelyVelocity(
45
- velocity: Vector3,
46
- angularVelocity: Vector3,
47
- switchIndex: number,
48
- ): boolean;
49
- public GetVelocity(): Vector3;
50
- public GetAngularVelocity(): Vector3;
51
- public GetPhysicsState(): number;
52
- public IsOnGround(): boolean;
53
- public GetBoundaryBox(): Box;
54
- public VehicleOwnerWasChanged(): void;
55
- }
56
-
57
- declare interface gameMappinSystem extends gamemappinsIMappinSystem {
58
- TrackMappin(id: gameNewMappinID): void;
59
- }
60
-
61
- type OnlyExtendingScriptableSystem<T> = {
62
- [K in keyof T as T[K] extends typeof gameScriptableSystem ? K : never]: T[K];
63
- };
64
-
65
- declare interface gameScriptableSystemsContainer<Map = OnlyExtendingScriptableSystem<MpClasses>> {
66
- "Get"<N extends keyof Map>(systemName: N): UnwrapMpClass<Map[N]>;
67
- }
1
+ /// <reference path="./enums.d.ts" />
2
+
3
+ /**
4
+ * Class with custom CyberMP native methods.
5
+ */
6
+ declare interface CyberMP {
7
+ /**
8
+ * Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
9
+ * @param objectClassMap Array of class names to delete.
10
+ */
11
+ DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
12
+
13
+ /**
14
+ * Removes game objects by their unique hashes from the map.
15
+ * @param objectHashMap Array of unique game object hashes to delete.
16
+ */
17
+ DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
18
+
19
+ /**
20
+ * Enables or disables synchronization of default effects, as defined by the CyberMP platform.
21
+ * @param value Whether to use the default effects.
22
+ */
23
+ UseDefaultEffectsByPlatform(value: boolean): void;
24
+ }
25
+
26
+ declare interface worldWeatherScriptInterface extends IScriptable {
27
+ public SetWeather(
28
+ weather: CyberEnums.WeatherState,
29
+ blendTime?: number,
30
+ priority?: number,
31
+ ): void;
32
+ public ResetWeather(forceRestore?: boolean, blendTime?: number): void;
33
+ public GetWeatherState(): worldWeatherState;
34
+ public GetEnvironmentDefinition(): worldEnvironmentDefinition;
35
+ }
36
+
37
+ declare interface vehicleBaseObject extends gameObject {
38
+ public HasGravity(): boolean;
39
+ public EnableGravity(is_enable: boolean): boolean;
40
+ public AddLinelyVelocity(
41
+ velocity: Vector3,
42
+ angularVelocity: Vector3,
43
+ ): boolean;
44
+ public ChangeLinelyVelocity(
45
+ velocity: Vector3,
46
+ angularVelocity: Vector3,
47
+ switchIndex: number,
48
+ ): boolean;
49
+ public GetVelocity(): Vector3;
50
+ public GetAngularVelocity(): Vector3;
51
+ public GetPhysicsState(): number;
52
+ public IsOnGround(): boolean;
53
+ public GetBoundaryBox(): Box;
54
+ public VehicleOwnerWasChanged(): void;
55
+ }
56
+
57
+ declare interface gameMappinSystem extends gamemappinsIMappinSystem {
58
+ TrackMappin(id: gameNewMappinID): void;
59
+ }
60
+
61
+ type OnlyExtendingScriptableSystem<T> = {
62
+ [K in keyof T as T[K] extends typeof gameScriptableSystem ? K : never]: T[K];
63
+ };
64
+
65
+ declare interface gameScriptableSystemsContainer<Map = OnlyExtendingScriptableSystem<MpClasses>> {
66
+ "Get"<N extends keyof Map>(systemName: N): UnwrapMpClass<Map[N]>;
67
+ }
@@ -64,6 +64,11 @@ declare interface MpGamePrecomputed {
64
64
  */
65
65
  onTweak(callback: () => void): void;
66
66
 
67
+ /**
68
+ * Event when tweaks is loaded.
69
+ */
70
+ onInit(callback: () => void): void;
71
+
67
72
  /**
68
73
  * Event when local player has been spawned.
69
74
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermp/client-types",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "",
5
5
  "main": "./out/index.d.ts",
6
6
  "files": [