@cybermp/client-types 1.2.2 → 1.3.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.
@@ -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
+ }
@@ -1,22 +1,28 @@
1
- declare namespace CyberEnums {
2
- /**
3
- * See {@link worldWeatherState#name}
4
- */
5
- declare enum WeatherState {
6
- SUNNY = "24h_weather_sunny",
7
- LIGHT_CLOUDS = "24h_weather_light_clouds",
8
- CLOUDY = "24h_weather_cloudy",
9
- HEAVY_CLOUDS = "24h_weather_heavy_clouds",
10
- FOG = "24h_weather_fog",
11
- RAIN = "24h_weather_rain",
12
- TOXIC_RAIN = "24h_weather_toxic_rain",
13
- POLLUTION = "24h_weather_pollution",
14
- SANDSTORM = "24h_weather_sandstorm",
15
- DEEP_BLUE = "q302_deeb_blue",
16
- LIGHT_RAIN = "q302_light_rain",
17
- SQUAT_MORNING = "q302_squat_morning",
18
- EPILOGUE_CLOUDY_MORNING = "q306_epilogue_cloudy_morning",
19
- RAINY_NIGHT = "q306_rainy_night",
20
- COURIER_CLOUDS = "sa_courier_clouds",
21
- }
22
- }
1
+ declare namespace CyberEnums {
2
+ /**
3
+ * See {@link worldWeatherState#name}
4
+ */
5
+ declare enum WeatherState {
6
+ SUNNY = "24h_weather_sunny",
7
+ LIGHT_CLOUDS = "24h_weather_light_clouds",
8
+ CLOUDY = "24h_weather_cloudy",
9
+ HEAVY_CLOUDS = "24h_weather_heavy_clouds",
10
+ FOG = "24h_weather_fog",
11
+ RAIN = "24h_weather_rain",
12
+ TOXIC_RAIN = "24h_weather_toxic_rain",
13
+ POLLUTION = "24h_weather_pollution",
14
+ SANDSTORM = "24h_weather_sandstorm",
15
+ DEEP_BLUE = "q302_deeb_blue",
16
+ LIGHT_RAIN = "q302_light_rain",
17
+ SQUAT_MORNING = "q302_squat_morning",
18
+ EPILOGUE_CLOUDY_MORNING = "q306_epilogue_cloudy_morning",
19
+ RAINY_NIGHT = "q306_rainy_night",
20
+ COURIER_CLOUDS = "sa_courier_clouds",
21
+ }
22
+
23
+ declare enum VoiceActivationType {
24
+ UNDEFINED = 0,
25
+ VOICE = 1,
26
+ PUSH_TO_TALK = 2,
27
+ }
28
+ }
@@ -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
  */
@@ -1,5 +1,6 @@
1
1
  /// <reference path="./events.d.ts" />
2
2
  /// <reference path="./meta.d.ts" />
3
+ /// <reference path="./voice-chat.d.ts" />
3
4
 
4
5
  declare type ServerVector3 = [number, number, number];
5
6
  declare type ServerVector4 = [number, number, number, number];
@@ -7,6 +8,7 @@ declare type ServerVector4 = [number, number, number, number];
7
8
  declare interface MpGlobalPrecomputed {
8
9
  events: MpEvents;
9
10
  meta: MpMeta;
11
+ voiceChat: MpVoiceChat;
10
12
 
11
13
  /**
12
14
  * Focus or unfocus CEF view.
@@ -0,0 +1,13 @@
1
+ interface MpVoiceChat {
2
+ enable(state: boolean): void;
3
+ changeActivationType(type: CyberEnums.VoiceActivationType): void;
4
+ bindPushToTalkKey(key: number | CyberEnums.EInputKey): void;
5
+ setOutputVolume(value: number): void;
6
+ setMicrophoneSensitivity(value: number): void;
7
+ getOutputDevices(): string[];
8
+ getInputDevices(): string[];
9
+ setOutputDevice(index: number): void;
10
+ setInputDevice(index: number): void;
11
+ setVoiceInputDistance(distance: number): void;
12
+ setVoiceOutputDistance(distance: number): void;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermp/client-types",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "main": "./out/index.d.ts",
6
6
  "files": [
@@ -28,9 +28,9 @@
28
28
  "scripts": {
29
29
  "start": "tsx ./src",
30
30
  "dev": "tsx watch ./src",
31
- "generate-patches": "tsx ./src/generate-patches.ts",
32
- "apply-patches": "tsx ./src/apply-patches.ts",
33
- "prettify-edited": "tsx ./src/prettify-edited.ts",
31
+ "generate-patches": "tsx ./scripts/generate-patches.ts",
32
+ "apply-patches": "tsx ./scripts/apply-patches.ts",
33
+ "prettify-edited": "tsx ./scripts/prettify-edited.ts",
34
34
  "build": "npm run start",
35
35
  "test": "vitest run",
36
36
  "test:dev": "vitest"