@cybermp-community/client-types 2.5.2 → 2.5.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.
- package/dist/precomputed/cef.ts +16 -2
- package/dist/precomputed/classes/extend.d.ts +157 -96
- package/dist/precomputed/classes/index.ts +2 -2
- package/dist/precomputed/classes/screens.d.ts +67 -46
- package/dist/precomputed/commands.ts +17 -0
- package/dist/precomputed/discord.ts +20 -0
- package/dist/precomputed/enums.ts +1662 -1630
- package/dist/precomputed/events/cef.ts +28 -0
- package/dist/precomputed/events/index.ts +34 -42
- package/dist/precomputed/events/map.ts +110 -19
- package/dist/precomputed/exports.ts +48 -12
- package/dist/precomputed/game.d.ts +142 -47
- package/dist/precomputed/index.ts +1 -0
- package/dist/precomputed/local-storage.ts +27 -0
- package/dist/precomputed/local.ts +103 -0
- package/dist/precomputed/meta.ts +61 -7
- package/dist/precomputed/mp.d.ts +60 -79
- package/dist/precomputed/network.ts +79 -0
- package/dist/precomputed/resources.d.ts +64 -0
- package/dist/precomputed/voice-chat.ts +64 -0
- package/package.json +4 -2
package/dist/precomputed/cef.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controls the game's built-in CEF browser — focus routing, cursor capture, and URL navigation.
|
|
3
|
+
*/
|
|
1
4
|
export interface MpCef {
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param
|
|
6
|
+
* Switches keyboard input focus to the web view or back to the game engine.
|
|
7
|
+
* @param focus - `true` to route input into the web view, `false` to return control to the game.
|
|
8
|
+
* @param cursor - If `true`, shows and locks the OS cursor; if `false`, hides it.
|
|
5
9
|
*/
|
|
6
10
|
setFocus(focus: boolean, cursor?: boolean): void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns whether the CEF web view currently holds input focus.
|
|
14
|
+
* @returns `true` if the web view has focus, `false` otherwise.
|
|
15
|
+
*/
|
|
7
16
|
isInFocus(): boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Navigates the web view to the given URL or local file path.
|
|
20
|
+
* @param url - Fully qualified URL or local asset path to load.
|
|
21
|
+
*/
|
|
8
22
|
setUrl(url: string): void;
|
|
9
23
|
}
|
|
@@ -1,102 +1,163 @@
|
|
|
1
|
-
|
|
2
1
|
// biome-ignore-all lint: Precomputed
|
|
3
2
|
import type { UnwrapClass } from '../../game.d.ts';
|
|
4
3
|
import type { MpClasses } from '../../mp-classes.d.ts';
|
|
5
4
|
import * as CyberEnums from '../../enums';
|
|
6
5
|
|
|
7
6
|
declare module '../../classes.d.ts' {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
7
|
+
export interface entEntity {
|
|
8
|
+
GetMorphTargets(): entMorphTargetWeightEntry[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface worldWeatherScriptInterface extends IScriptable {
|
|
12
|
+
SetWeather(weather: CyberEnums.EWeatherState, blendTime?: number, priority?: number): void;
|
|
13
|
+
ResetWeather(forceRestore?: boolean, blendTime?: number): void;
|
|
14
|
+
GetWeatherState(): worldWeatherState;
|
|
15
|
+
GetEnvironmentDefinition(): worldEnvironmentDefinition;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface vehicleBaseObject extends gameObject {
|
|
19
|
+
/**
|
|
20
|
+
* Returns whether gravity is currently applied to this vehicle.
|
|
21
|
+
* @returns `true` if gravity is active, `false` otherwise.
|
|
22
|
+
*/
|
|
23
|
+
HasGravity(): boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Enables or disables gravity on this vehicle.
|
|
27
|
+
* @param enable - `true` to enable gravity, `false` to disable.
|
|
28
|
+
* @returns `true` if the state was changed successfully.
|
|
29
|
+
*/
|
|
30
|
+
EnableGravity(enable: boolean): boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Applies an instantaneous velocity impulse to the vehicle.
|
|
34
|
+
* @param velocity - Linear velocity to add.
|
|
35
|
+
* @param angularVelocity - Angular velocity to add.
|
|
36
|
+
* @returns `true` if the impulse was applied.
|
|
37
|
+
*/
|
|
38
|
+
AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Directly sets the vehicle's current linear and angular velocity.
|
|
42
|
+
* @param velocity - Target linear velocity.
|
|
43
|
+
* @param angularVelocity - Target angular velocity.
|
|
44
|
+
* @param switchIndex - Configuration index flag.
|
|
45
|
+
* @returns `true` if the velocity was updated successfully.
|
|
46
|
+
*/
|
|
47
|
+
ChangeLinelyVelocity(velocity: Vector3, angularVelocity: Vector3, switchIndex: number): boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns the vehicle's current linear velocity vector.
|
|
51
|
+
*/
|
|
52
|
+
GetVelocity(): Vector3;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns the vehicle's current angular (rotational) velocity vector.
|
|
56
|
+
*/
|
|
57
|
+
GetAngularVelocity(): Vector3;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns the physics simulation state bitmask for this vehicle.
|
|
61
|
+
*/
|
|
62
|
+
GetPhysicsState(): number;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Returns whether the vehicle is currently in contact with the ground.
|
|
66
|
+
* @returns `true` if grounded, `false` if airborne.
|
|
67
|
+
*/
|
|
68
|
+
IsOnGround(): boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns the vehicle's axis-aligned bounding box used for collision.
|
|
72
|
+
*/
|
|
73
|
+
GetBoundaryBox(): Box;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Called when this vehicle's network owner changes.
|
|
77
|
+
*/
|
|
78
|
+
VehicleOwnerWasChanged(): void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface gameMappinSystem extends gamemappinsIMappinSystem {
|
|
82
|
+
TrackMappin(id: gameNewMappinID): void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type OnlyExtendingScriptableSystem<T> = {
|
|
86
|
+
[K in keyof T as T[K] extends typeof gameScriptableSystem ? K : never]: T[K];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export interface gameScriptableSystemsContainer<Map = OnlyExtendingScriptableSystem<MpClasses>> {
|
|
90
|
+
Get<N extends keyof Map>(systemName: N): UnwrapClass<Map[N]>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export namespace redResourceReferenceScriptToken {
|
|
94
|
+
export function GetHash(value: any): bigint;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface inkISystemRequestsHandler {
|
|
98
|
+
StartMainMenu(): void;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// TODO: Research
|
|
102
|
+
export interface gamePuppet {
|
|
103
|
+
GetGender(): CyberEnums.RedscriptPlayerGender;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ScriptedPuppet {
|
|
107
|
+
GetGender(): CyberEnums.RedscriptPlayerGender;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface gamePuppetPS {
|
|
111
|
+
GetGender(): CyberEnums.RedscriptPlayerGender;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface entEntity {
|
|
115
|
+
/**
|
|
116
|
+
* Returns the active morph target weight entries for this entity's mesh.
|
|
117
|
+
*/
|
|
118
|
+
GetMorphWeights(): entMorphTargetWeightEntry[];
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Rebuilds the entity's visual representation using the provided component list.
|
|
122
|
+
* @param arr - Components to attach during reassembly.
|
|
123
|
+
*/
|
|
124
|
+
ReassembleWithComponents(arr: entIComponent[]): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Teleports the entity (ped or game object) to the given world position.
|
|
128
|
+
* @param position - Target world position.
|
|
129
|
+
* @param rotation - Optional orientation in Euler angles (Pitch, Roll, Yaw).
|
|
130
|
+
*/
|
|
131
|
+
TeleportPed(position: Vector3, rotation?: EulerAngles): void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface AimingStateDecisions {
|
|
135
|
+
OnItemEquipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
136
|
+
OnItemUnequipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface AimingStateEvents {
|
|
140
|
+
OnItemEquipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
141
|
+
OnItemUnequipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface ApplyStatGroupEffectorCallback {
|
|
145
|
+
OnItemEquipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
146
|
+
OnItemUnequipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface gameuiICharacterCustomizationSystem {
|
|
150
|
+
/**
|
|
151
|
+
* Sets the player's gender in the character customization system.
|
|
152
|
+
* @param gender - Target gender enum value.
|
|
153
|
+
* @param savedPos - If `true`, the current camera/position state is preserved.
|
|
154
|
+
*/
|
|
155
|
+
SetPlayerGender(gender: CyberEnums.EPlayerGender, savedPos?: boolean): void;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Called after the player's gender has been successfully changed.
|
|
159
|
+
* @param gender - The new gender value.
|
|
160
|
+
*/
|
|
161
|
+
OnPlayerGenderChanged(gender: CyberEnums.EPlayerGender): void;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './extend';
|
|
2
|
+
export * from './screens';
|
|
@@ -1,46 +1,67 @@
|
|
|
1
|
-
import type { MpClasses } from
|
|
2
|
-
import type * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
import type { MpClasses } from '../../mp-classes.d.ts';
|
|
2
|
+
import type * as M from '../../common.d.ts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Exposes loading screen state and progress.
|
|
6
|
+
* Accessible via `mp.game.ScriptGameInstance.GetLoadingScreenSystem()`.
|
|
7
|
+
* @category Natives
|
|
8
|
+
*/
|
|
9
|
+
export class LoadingScreenSystem {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the current loading screen state.
|
|
12
|
+
* @returns State enum value.
|
|
13
|
+
*/
|
|
14
|
+
GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the current loading progress as a number from 0 to 100.
|
|
18
|
+
*/
|
|
19
|
+
GetLoadingScreenProgress(): number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Called when the loading screen transitions to a new state.
|
|
23
|
+
* @param newState - The state being transitioned into.
|
|
24
|
+
*/
|
|
25
|
+
OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class MultiplayerSystem {
|
|
29
|
+
/**
|
|
30
|
+
* Marks game object classes as deleted, removing them from the multiplayer world state.
|
|
31
|
+
* @param objectClassMap - Class names from `MpClasses` to remove.
|
|
32
|
+
*/
|
|
33
|
+
DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Removes specific game objects from network replication by their unique hash identifiers.
|
|
37
|
+
* @param objectHashMap - Array of entity hashes to delete.
|
|
38
|
+
*/
|
|
39
|
+
DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Enables or disables the platform's default effect synchronization.
|
|
43
|
+
* @param value - `true` to use default sync effects, `false` to disable.
|
|
44
|
+
*/
|
|
45
|
+
UseDefaultEffectsByPlatform(value: boolean): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Sets the fallback spawn position used when no explicit position is provided.
|
|
49
|
+
* @param position - World coordinates.
|
|
50
|
+
* @param yaw - Facing angle in degrees.
|
|
51
|
+
*/
|
|
52
|
+
SetDefaultSpawnPosition(position: Vector3, yaw: number): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare module '../../mp-classes.d.ts' {
|
|
56
|
+
export interface MpClasses {
|
|
57
|
+
LoadingScreenSystem: typeof LoadingScreenSystem;
|
|
58
|
+
MultiplayerSystem: typeof MultiplayerSystem;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module '../../classes.d.ts' {
|
|
63
|
+
export namespace ScriptGameInstance {
|
|
64
|
+
function GetLoadingScreenSystem(): M.Handle<LoadingScreenSystem>;
|
|
65
|
+
function GetMultiplayerSystem(): M.Handle<MultiplayerSystem>;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers and removes client-side console commands.
|
|
3
|
+
*/
|
|
4
|
+
export interface MpCommands {
|
|
5
|
+
/**
|
|
6
|
+
* Registers a console command.
|
|
7
|
+
* @param commandName - Command name without the leading "/".
|
|
8
|
+
* @param callback - Handler called with the executing player's ID and the parsed argument list.
|
|
9
|
+
*/
|
|
10
|
+
add(commandName: string, callback: (id: number, args: string[]) => void): void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Removes a previously registered console command.
|
|
14
|
+
* @param commandName - Command name without the leading "/".
|
|
15
|
+
*/
|
|
16
|
+
remove(commandName: string): void;
|
|
17
|
+
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord integration — rich presence updates and OAuth2 authorization.
|
|
3
|
+
*/
|
|
1
4
|
export interface MpDiscord {
|
|
2
5
|
updateRichPresence(state?: string, details?: string): void;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Runs Discord's OAuth2 authorization flow and returns an authorization code
|
|
9
|
+
* that can be exchanged for an access token server-side.
|
|
10
|
+
* @param discordAppId - Your Discord application's client ID.
|
|
11
|
+
* @param scopes - Space-separated OAuth2 scopes (e.g., `"identify guilds"`).
|
|
12
|
+
* @returns The authorization code string.
|
|
13
|
+
*/
|
|
14
|
+
getOAuth2Token(discordAppId: string, scopes: string): string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use {@link getOAuth2Token} instead.
|
|
18
|
+
* @param discordAppId - Your Discord application's client ID.
|
|
19
|
+
* @param scopes - Space-separated OAuth2 scopes (e.g., `"identify guilds"`).
|
|
20
|
+
* @returns The authorization code string.
|
|
21
|
+
*/
|
|
22
|
+
getCodeAuthorization(discordAppId: string, scopes: string): string;
|
|
3
23
|
}
|