@cybermp/client-types 1.5.2 → 1.6.0

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.
@@ -0,0 +1,5 @@
1
+ interface MpCef {
2
+ setFocus(focus: boolean, cursor?: boolean): void;
3
+ isInFocus(): boolean;
4
+ setUrl(url: string): void;
5
+ }
@@ -1,64 +1,92 @@
1
- /**
2
- * Class with custom CyberMP native methods.
3
- */
4
- interface CyberMP {
5
- /**
6
- * Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
7
- * @param objectClassMap Array of class names to delete.
8
- */
9
- DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
1
+ import * as CyberEnums from "../enums";
10
2
 
3
+ declare global {
11
4
  /**
12
- * Removes game objects by their unique hashes from the map.
13
- * @param objectHashMap Array of unique game object hashes to delete.
5
+ * Class with custom CyberMP native methods.
14
6
  */
15
- DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
7
+ interface CyberMP {
8
+ /**
9
+ * Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
10
+ * @param objectClassMap Array of class names to delete.
11
+ */
12
+ DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
16
13
 
17
- /**
18
- * Enables or disables synchronization of default effects, as defined by the CyberMP platform.
19
- * @param value Whether to use the default effects.
20
- */
21
- UseDefaultEffectsByPlatform(value: boolean): void;
22
- }
14
+ /**
15
+ * Removes game objects by their unique hashes from the map.
16
+ * @param objectHashMap Array of unique game object hashes to delete.
17
+ */
18
+ DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
23
19
 
24
- interface worldWeatherScriptInterface extends IScriptable {
25
- SetWeather(
26
- weather: CyberEnums.WeatherState,
27
- blendTime?: number,
28
- priority?: number,
29
- ): void;
30
- ResetWeather(forceRestore?: boolean, blendTime?: number): void;
31
- GetWeatherState(): worldWeatherState;
32
- GetEnvironmentDefinition(): worldEnvironmentDefinition;
33
- }
20
+ /**
21
+ * Enables or disables synchronization of default effects, as defined by the CyberMP platform.
22
+ * @param value Whether to use the default effects.
23
+ */
24
+ UseDefaultEffectsByPlatform(value: boolean): void;
25
+ }
34
26
 
35
- interface vehicleBaseObject extends gameObject {
36
- HasGravity(): boolean;
37
- EnableGravity(is_enable: boolean): boolean;
38
- AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
39
- ChangeLinelyVelocity(
40
- velocity: Vector3,
41
- angularVelocity: Vector3,
42
- switchIndex: number,
43
- ): boolean;
44
- GetVelocity(): Vector3;
45
- GetAngularVelocity(): Vector3;
46
- GetPhysicsState(): number;
47
- IsOnGround(): boolean;
48
- GetBoundaryBox(): Box;
49
- VehicleOwnerWasChanged(): void;
50
- }
27
+ interface worldWeatherScriptInterface extends IScriptable {
28
+ SetWeather(
29
+ weather: CyberEnums.WeatherState,
30
+ blendTime?: number,
31
+ priority?: number,
32
+ ): void;
33
+ ResetWeather(forceRestore?: boolean, blendTime?: number): void;
34
+ GetWeatherState(): worldWeatherState;
35
+ GetEnvironmentDefinition(): worldEnvironmentDefinition;
36
+ }
51
37
 
52
- interface gameMappinSystem extends gamemappinsIMappinSystem {
53
- TrackMappin(id: gameNewMappinID): void;
54
- }
38
+ interface vehicleBaseObject extends gameObject {
39
+ HasGravity(): boolean;
40
+ EnableGravity(enable: boolean): boolean;
41
+ AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
42
+ ChangeLinelyVelocity(
43
+ velocity: Vector3,
44
+ angularVelocity: Vector3,
45
+ switchIndex: number,
46
+ ): boolean;
47
+ GetVelocity(): Vector3;
48
+ GetAngularVelocity(): Vector3;
49
+ GetPhysicsState(): number;
50
+ IsOnGround(): boolean;
51
+ GetBoundaryBox(): Box;
52
+ VehicleOwnerWasChanged(): void;
53
+ }
55
54
 
56
- type OnlyExtendingScriptableSystem<T> = {
57
- [K in keyof T as T[K] extends typeof gameScriptableSystem ? K : never]: T[K];
58
- };
55
+ interface gameMappinSystem extends gamemappinsIMappinSystem {
56
+ TrackMappin(id: gameNewMappinID): void;
57
+ }
59
58
 
60
- interface gameScriptableSystemsContainer<
61
- Map = OnlyExtendingScriptableSystem<MpClasses>,
62
- > {
63
- "Get"<N extends keyof Map>(systemName: N): UnwrapMpClass<Map[N]>;
59
+ type OnlyExtendingScriptableSystem<T> = {
60
+ [K in keyof T as T[K] extends typeof gameScriptableSystem
61
+ ? K
62
+ : never]: T[K];
63
+ };
64
+
65
+ interface gameScriptableSystemsContainer<
66
+ Map = OnlyExtendingScriptableSystem<MpClasses>,
67
+ > {
68
+ "Get"<N extends keyof Map>(systemName: N): UnwrapMpClass<Map[N]>;
69
+ }
70
+
71
+ class ScriptGameInstance {
72
+ static GetLoadingScreenSystem(): LoadingScreenSystem;
73
+ }
74
+
75
+ interface LoadingScreenSystem {
76
+ GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
77
+ GetLoadingScreenProgress(): number;
78
+ OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
79
+ }
80
+
81
+ interface inkISystemRequestsHandler {
82
+ StartMainMenu(): void;
83
+ }
84
+
85
+ interface gameuiICharacterCustomizationSystem {
86
+ SetPlayerGender(gender: CyberEnums.EPlayerGender, savedPos?: boolean): void;
87
+ OnPlayerGenderChanged(gender: CyberEnums.EPlayerGender): void;
88
+ }
64
89
  }
90
+
91
+ export { };
92
+
@@ -24,3 +24,15 @@ export enum VoiceActivationType {
24
24
  VOICE = 1,
25
25
  PUSH_TO_TALK = 2,
26
26
  }
27
+
28
+ export enum EPlayerGender {
29
+ Female = 1,
30
+ Male = 2,
31
+ }
32
+
33
+ export enum ELoadingScreenState {
34
+ Started = 1,
35
+ Loading,
36
+ PreEnded,
37
+ Hidden,
38
+ }
@@ -1,6 +1,7 @@
1
1
  /// <reference path="./events.d.ts" />
2
2
  /// <reference path="./meta.d.ts" />
3
3
  /// <reference path="./voice-chat.d.ts" />
4
+ /// <reference path="./cef.d.ts" />
4
5
 
5
6
  type ServerVector3 = [number, number, number];
6
7
  type ServerVector4 = [number, number, number, number];
@@ -9,6 +10,7 @@ interface MpGlobalPrecomputed {
9
10
  events: MpEvents;
10
11
  meta: MpMeta;
11
12
  voiceChat: MpVoiceChat;
13
+ cef: MpCef;
12
14
 
13
15
  getStreamedPool(
14
16
  objName: "CVehicle" | "CPed" | "CPickups" | "CObject",
@@ -17,11 +19,21 @@ interface MpGlobalPrecomputed {
17
19
 
18
20
  /**
19
21
  * Focus or unfocus CEF view.
22
+ * @deprecated use mp.cef instead
20
23
  */
21
24
  setCefInFocusState(justFocus: boolean, withMouse: boolean): void;
22
25
 
26
+ /**
27
+ * @deprecated use mp.cef instead
28
+ */
23
29
  isInCefFocusState(): boolean;
24
30
 
31
+ /**
32
+ *
33
+ * @deprecated use mp.cef api instead
34
+ */
35
+ changeCefViewUrl(newUrl: string): void;
36
+
25
37
  /**
26
38
  * Mapping between network and game IDs.
27
39
  */
@@ -130,9 +142,7 @@ interface MpGlobalPrecomputed {
130
142
 
131
143
  getLauncherSettings(): any;
132
144
 
133
- changeCefViewUrl(newUrl: string): void;
134
-
135
- setTick(cb: () => void | Promise<void>): number;
145
+ setTick(cb: () => any): number;
136
146
 
137
147
  clearTick(tickId: number): void;
138
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermp/client-types",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "",
5
5
  "types": "./out/index.d.ts",
6
6
  "files": [