@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.
|
@@ -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
|
-
*
|
|
13
|
-
* @param objectHashMap Array of unique game object hashes to delete.
|
|
5
|
+
* Class with custom CyberMP native methods.
|
|
14
6
|
*/
|
|
15
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
53
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
interface gameMappinSystem extends gamemappinsIMappinSystem {
|
|
56
|
+
TrackMappin(id: gameNewMappinID): void;
|
|
57
|
+
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
+
|
|
@@ -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
|
-
|
|
134
|
-
|
|
135
|
-
setTick(cb: () => void | Promise<void>): number;
|
|
145
|
+
setTick(cb: () => any): number;
|
|
136
146
|
|
|
137
147
|
clearTick(tickId: number): void;
|
|
138
148
|
}
|