@cybermp/client-types 2.2.1 → 2.2.2
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/out/game.d.ts +1 -4
- package/package.json +4 -4
- package/precomputed/cef.d.ts +19 -0
- package/precomputed/enums.ts +10 -1
- package/precomputed/events.d.ts +174 -3
- package/precomputed/game.d.ts +473 -172
- package/precomputed/local-storage.d.ts +28 -0
- package/precomputed/meta.d.ts +60 -0
- package/precomputed/mp.d.ts +180 -12
- package/precomputed/voice-chat.d.ts +63 -0
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface providing access to persistent client-side key-value storage.
|
|
3
|
+
* Data saved here remains available across different game sessions and server reconnections.
|
|
4
|
+
*/
|
|
1
5
|
export interface MpLocalStorage {
|
|
6
|
+
/**
|
|
7
|
+
* Associates a string value with a specific key in the storage database.
|
|
8
|
+
* If the key already exists, its value will be overwritten.
|
|
9
|
+
* @param key - The unique identifier name for the storage entry.
|
|
10
|
+
* @param value - The plaintext string data payload to be stored.
|
|
11
|
+
*/
|
|
2
12
|
set(key: string, value: string): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the stored string value associated with the specified key.
|
|
16
|
+
* @param key - The unique identifier name of the entry to fetch.
|
|
17
|
+
* @returns The stored string value, or an empty string/null if the key does not exist.
|
|
18
|
+
*/
|
|
3
19
|
get(key: string): string;
|
|
4
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Permanently removes a specific key-value entry from the storage map.
|
|
23
|
+
* @param key - The unique identifier name of the entry to delete.
|
|
24
|
+
*/
|
|
5
25
|
delete(key: string): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Clears all keys and values currently held in this resource's local storage instance.
|
|
29
|
+
*/
|
|
6
30
|
deleteAll(): void;
|
|
7
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Explicitly flushes the current state of the in-memory storage data down to the physical disk.
|
|
34
|
+
* Use this to ensure volatile data isn't lost if the game client unexpectedly crashes.
|
|
35
|
+
*/
|
|
8
36
|
save(): void;
|
|
9
37
|
}
|
package/precomputed/meta.d.ts
CHANGED
|
@@ -1,18 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface managing cross-resource and synchronized state metadata across the network layer.
|
|
3
|
+
* Allows attaching arbitrary data structures to globals, specific players, the local player, or synchronized network entities.
|
|
4
|
+
*/
|
|
1
5
|
export interface MpMeta {
|
|
6
|
+
/**
|
|
7
|
+
* Sets a global metadata value accessible across the entire runtime environment.
|
|
8
|
+
* @param key - The unique identifier string for the metadata entry.
|
|
9
|
+
* @param value - The data payload to store (can be any serializable object or primitive).
|
|
10
|
+
* @param sync - Optional flag. If `true`, synchronizes this metadata across the network to all other clients.
|
|
11
|
+
*/
|
|
2
12
|
setGlobalMeta(key: string, value: any, sync?: boolean): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a global metadata value by its key.
|
|
16
|
+
* @template T - The expected type of the returned metadata value.
|
|
17
|
+
* @param key - The unique identifier string of the metadata entry to look up.
|
|
18
|
+
* @returns The stored global metadata value cast to type T, or undefined if it does not exist.
|
|
19
|
+
*/
|
|
3
20
|
getGlobalMeta<T = any>(key: string): T;
|
|
4
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Assigns a metadata value to a specific remote player using their unique player network ID.
|
|
24
|
+
* @param playerId - The network identification integer of the target player.
|
|
25
|
+
* @param key - The unique identifier string for this player's metadata entry.
|
|
26
|
+
* @param value - The data payload to attach to the player.
|
|
27
|
+
* @param sync - Optional flag. If `true`, syncs this change to all other connected clients over the network.
|
|
28
|
+
*/
|
|
5
29
|
setPlayerMeta(
|
|
6
30
|
playerId: number,
|
|
7
31
|
key: string,
|
|
8
32
|
value: any,
|
|
9
33
|
sync?: boolean,
|
|
10
34
|
): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a metadata value attached to a specific remote player.
|
|
38
|
+
* @template T - The expected type of the returned metadata value.
|
|
39
|
+
* @param playerId - The network identification integer of the target player.
|
|
40
|
+
* @param key - The unique identifier string of the player's metadata entry.
|
|
41
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
42
|
+
*/
|
|
11
43
|
getPlayerMeta<T = any>(playerId: number, key: string): T;
|
|
12
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Sets a metadata value restricted or assigned specifically to the local player instance.
|
|
47
|
+
* @param key - The unique identifier string for the local player's metadata entry.
|
|
48
|
+
* @param value - The data payload to store.
|
|
49
|
+
* @param sync - Optional flag. If `true`, relays this local metadata state out to the server and other clients.
|
|
50
|
+
*/
|
|
13
51
|
setLocalPlayerMeta(key: string, value: any, sync?: boolean): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a metadata value attached specifically to the local player instance.
|
|
55
|
+
* @template T - The expected type of the returned metadata value.
|
|
56
|
+
* @param key - The unique identifier string of the local player's metadata entry.
|
|
57
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
58
|
+
*/
|
|
14
59
|
getLocalPlayerMeta<T = any>(key: string): T;
|
|
15
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Attaches a metadata state payload to any synchronized network entity (e.g., vehicles, props, peds) using its network ID.
|
|
63
|
+
* @param netId - The network-assigned unique identifier tracking the target entity.
|
|
64
|
+
* @param key - The unique identifier string for the entity's metadata entry.
|
|
65
|
+
* @param value - The data payload to attach to the entity.
|
|
66
|
+
* @param sync - Optional flag. If `true`, synchronizes this entity metadata property to all clients tracking this object.
|
|
67
|
+
*/
|
|
16
68
|
setEntityMeta(netId: number, key: string, value: any, sync?: boolean): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves a metadata value associated with a synchronized network entity.
|
|
72
|
+
* @template T - The expected type of the returned metadata value.
|
|
73
|
+
* @param netId - The network-assigned unique identifier tracking the target entity.
|
|
74
|
+
* @param key - The unique identifier string of the entity's metadata entry.
|
|
75
|
+
* @returns The stored metadata value cast to type T, or undefined if it does not exist.
|
|
76
|
+
*/
|
|
17
77
|
getEntityMeta<T = any>(netId: number, key: string): T;
|
|
18
78
|
}
|
package/precomputed/mp.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MpClasses, MpGlobals } from '../out/game';
|
|
2
2
|
import type { MpCef } from './cef';
|
|
3
3
|
import type { MpDiscord } from './discord';
|
|
4
4
|
import type { MpEvents } from './events';
|
|
5
|
+
import type { MpGame } from './game';
|
|
5
6
|
import type { MpLocalStorage } from './local-storage';
|
|
6
7
|
import type { MpMeta } from './meta';
|
|
7
8
|
import type { MpVoiceChat } from './voice-chat';
|
|
@@ -9,48 +10,143 @@ import type { MpVoiceChat } from './voice-chat';
|
|
|
9
10
|
type ServerVector3 = [number, number, number];
|
|
10
11
|
type ServerVector4 = [number, number, number, number];
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The main client-side manager interface for CyberMP.
|
|
15
|
+
* Aggregates all core subsystems, network synchronization mappers, local entity spawning arrays, and launcher-level APIs.
|
|
16
|
+
*/
|
|
12
17
|
export interface MpClient {
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Access interface for native game engines, classes, and global engine parameters.
|
|
20
|
+
*/
|
|
21
|
+
game: MpGame & MpGlobals & MpClasses;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The client event communication system bridge.
|
|
25
|
+
*/
|
|
14
26
|
events: MpEvents;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Metadata state synchronization manager across entities and network profiles.
|
|
30
|
+
*/
|
|
15
31
|
meta: MpMeta;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Integrated structural client voice communication management interface.
|
|
35
|
+
*/
|
|
16
36
|
voiceChat: MpVoiceChat;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Controls and interfaces with the embedded Chromium Embedded Framework web views.
|
|
40
|
+
*/
|
|
17
41
|
cef: MpCef;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Provides access to Discord rich presence and authentications integration layers.
|
|
45
|
+
*/
|
|
18
46
|
discord: MpDiscord;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Provides access to local key-value data storage states spanning resource restarts.
|
|
50
|
+
*/
|
|
19
51
|
localStorage: MpLocalStorage;
|
|
20
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Returns an array of game engine handling entities currently within the local player's streaming radius.
|
|
55
|
+
* @param objName - The engine pool target class filter type to look up.
|
|
56
|
+
* @returns An array containing the local runtime engine IDs matching the target pool.
|
|
57
|
+
*/
|
|
21
58
|
getStreamedPool(
|
|
22
59
|
objName: 'CVehicle' | 'CPed' | 'CPickup' | 'CObject',
|
|
23
60
|
): number[];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets an array containing all active remote network players currently streaming inside the local user's zone.
|
|
64
|
+
* @returns An array of native game engine entity IDs.
|
|
65
|
+
*/
|
|
24
66
|
getStreamedPlayers(): number[];
|
|
25
67
|
|
|
26
68
|
/**
|
|
27
|
-
*
|
|
69
|
+
* Resolves a network sync ID into its corresponding local native game engine entity reference handle for a vehicle.
|
|
70
|
+
* @param id - The unique synchronization network ID assigned by the server host.
|
|
71
|
+
* @returns The corresponding local native game engine vehicle handle ID.
|
|
28
72
|
*/
|
|
29
73
|
getVehicleGameIdByNetworkId(id: number): number;
|
|
30
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Resolves a network sync ID into its corresponding local native game engine entity reference handle for a player.
|
|
77
|
+
* @param id - The unique synchronization network ID assigned by the server host.
|
|
78
|
+
* @returns The corresponding local native game engine player handle ID.
|
|
79
|
+
*/
|
|
31
80
|
getPlayerGameIdByNetworkId(id: number): number;
|
|
32
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Resolves a network sync ID into its corresponding local native game engine entity reference handle for a static object.
|
|
84
|
+
* @param id - The unique synchronization network ID assigned by the server host.
|
|
85
|
+
* @returns The corresponding local native game engine object handle ID.
|
|
86
|
+
*/
|
|
33
87
|
getObjectGameIdByNetworkId(id: number): number;
|
|
34
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Translates a native vehicle game handle into its global shared replication network sync ID.
|
|
91
|
+
* @param hash - The local native game engine entity instance handle.
|
|
92
|
+
* @returns The synchronized network ID assigned to that vehicle.
|
|
93
|
+
*/
|
|
35
94
|
getVehicleNetworkIdByGameId(hash: number): number;
|
|
36
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Translates a native player character entity handle into its global shared replication network sync ID.
|
|
98
|
+
* @param hash - The local native game engine entity instance handle.
|
|
99
|
+
* @returns The synchronized network ID assigned to that player.
|
|
100
|
+
*/
|
|
37
101
|
getPlayerNetworkIdByGameId(hash: number): number;
|
|
38
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Translates a native object or entity prop handle into its global shared replication network sync ID.
|
|
105
|
+
* @param hash - The local native game engine entity instance handle.
|
|
106
|
+
* @returns The synchronized network ID assigned to that object.
|
|
107
|
+
*/
|
|
39
108
|
getObjectNetworkIdByGameId(hash: number): number;
|
|
40
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Translates a native pedestrian/NPC handle into its global shared replication network sync ID.
|
|
112
|
+
* @param hash - The local native game engine entity instance handle.
|
|
113
|
+
* @returns The synchronized network ID assigned to that pedestrian.
|
|
114
|
+
*/
|
|
41
115
|
getPedNetworkIdByGameId(hash: number): number;
|
|
42
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Resolves a network sync ID into its corresponding local native game engine entity reference handle for a pedestrian.
|
|
119
|
+
* @param id - The unique synchronization network ID assigned by the server host.
|
|
120
|
+
* @returns The corresponding local native game engine pedestrian handle ID.
|
|
121
|
+
*/
|
|
43
122
|
getPedGameIdByNetworkId(hash: number): number;
|
|
44
123
|
|
|
45
124
|
/**
|
|
46
|
-
*
|
|
125
|
+
* Assigns the spawn coordinates and rotation tracking data for spawnLocalPlayer function.
|
|
126
|
+
* @param x - Horizontal grid position coordinate value.
|
|
127
|
+
* @param y - Vertical grid position coordinate value.
|
|
128
|
+
* @param z - Height grid elevation coordinate value.
|
|
129
|
+
* @param yaw - The horizontal rotation layout angle in degrees.
|
|
47
130
|
*/
|
|
48
131
|
setSpawnDataLocalPlayer(x: number, y: number, z: number, yaw: number): void;
|
|
49
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Spawns local player based on data setted by {@link setSpawnDataLocalPlayer}
|
|
135
|
+
* @returns `true` if the spawn lifecycle sequence initiated successfully, otherwise `false`.
|
|
136
|
+
*/
|
|
50
137
|
spawnLocalPlayer(): boolean;
|
|
51
138
|
|
|
52
139
|
/**
|
|
53
|
-
*
|
|
140
|
+
* Instantiates a localized ped entity.
|
|
141
|
+
* This entity remains completely un-synchronized and invisible to other remote clients.
|
|
142
|
+
* @param skinHash - Asset model signature key hash.
|
|
143
|
+
* @param appHash - Visual appearance setup key components variation hash.
|
|
144
|
+
* @param x - Horizontal coordinate space.
|
|
145
|
+
* @param y - Vertical coordinate space.
|
|
146
|
+
* @param z - Elevation height space coordinate.
|
|
147
|
+
* @param yaw - Rotational alignment facing angle.
|
|
148
|
+
* @param streaming - Controls if engine virtualization automatically handles streaming boundaries tracking.
|
|
149
|
+
* @returns The resulting unique local game entity handle ID.
|
|
54
150
|
*/
|
|
55
151
|
spawnLocalPed(
|
|
56
152
|
skinHash: number | bigint,
|
|
@@ -62,6 +158,20 @@ export interface MpClient {
|
|
|
62
158
|
streaming: boolean,
|
|
63
159
|
): number;
|
|
64
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Instantiates a localized vehicle entity inside the engine environment.
|
|
163
|
+
* This entity remains completely un-synchronized and invisible to other remote clients.
|
|
164
|
+
* @param skinHash - Asset model signature key hash.
|
|
165
|
+
* @param appHash - Visual appearance setup key components variation hash.
|
|
166
|
+
* @param x - Horizontal coordinate space.
|
|
167
|
+
* @param y - Vertical coordinate space.
|
|
168
|
+
* @param z - Elevation height space coordinate.
|
|
169
|
+
* @param roll - Longitudinal rotation axis orientation angle.
|
|
170
|
+
* @param pitch - Lateral rotation axis orientation angle.
|
|
171
|
+
* @param yaw - Directional heading alignment angle.
|
|
172
|
+
* @param streaming - Controls if engine virtualization automatically handles streaming boundaries tracking.
|
|
173
|
+
* @returns The resulting unique local game entity handle ID.
|
|
174
|
+
*/
|
|
65
175
|
spawnLocalVehicle(
|
|
66
176
|
skinHash: number | bigint,
|
|
67
177
|
appHash: number | bigint,
|
|
@@ -74,6 +184,20 @@ export interface MpClient {
|
|
|
74
184
|
streaming: boolean,
|
|
75
185
|
): number;
|
|
76
186
|
|
|
187
|
+
/**
|
|
188
|
+
* Instantiates a localized world object or dynamic prop entity inside the engine environment.
|
|
189
|
+
* This entity remains completely un-synchronized and invisible to other remote clients.
|
|
190
|
+
* @param skinHash - Asset model signature key hash.
|
|
191
|
+
* @param appHash - Visual appearance setup key components variation hash.
|
|
192
|
+
* @param x - Horizontal coordinate space.
|
|
193
|
+
* @param y - Vertical coordinate space.
|
|
194
|
+
* @param z - Elevation height space coordinate.
|
|
195
|
+
* @param roll - Longitudinal rotation axis orientation angle.
|
|
196
|
+
* @param pitch - Lateral rotation axis orientation angle.
|
|
197
|
+
* @param yaw - Directional heading alignment angle.
|
|
198
|
+
* @param streaming - Controls if engine virtualization automatically handles streaming boundaries tracking.
|
|
199
|
+
* @returns The resulting unique local game entity handle ID.
|
|
200
|
+
*/
|
|
77
201
|
spawnLocalObject(
|
|
78
202
|
skinHash: bigint | number,
|
|
79
203
|
appHash: bigint | number,
|
|
@@ -86,52 +210,96 @@ export interface MpClient {
|
|
|
86
210
|
streaming: boolean,
|
|
87
211
|
): number;
|
|
88
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Forces immediate engine de-allocation and cleanup deletion maps targeting an isolated local pedestrian.
|
|
215
|
+
* @param hash - Unique local game engine entity instance handle to clear.
|
|
216
|
+
*/
|
|
89
217
|
despawnLocalPed(hash: number): void;
|
|
90
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Forces immediate engine de-allocation and cleanup deletion maps targeting an isolated local vehicle.
|
|
221
|
+
* @param hash - Unique local game engine entity instance handle to clear.
|
|
222
|
+
*/
|
|
91
223
|
despawnLocalVehicle(hash: number): void;
|
|
92
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Forces immediate engine de-allocation and cleanup deletion maps targeting an isolated local object.
|
|
227
|
+
* @param hash - Unique local game engine entity instance handle to clear.
|
|
228
|
+
*/
|
|
93
229
|
despawnLocalObject(hash: number): void;
|
|
94
230
|
|
|
95
231
|
/**
|
|
96
|
-
*
|
|
232
|
+
* Requests a secure Discord authentication OAuth2 user token via embedded client game SDK pathways.
|
|
233
|
+
* @deprecated This method is unstable and may cause engine synchronization pauses. Use {@link getDiscordCodeAuthorization} instead.
|
|
234
|
+
* @param discordAppId - The registered client registration application client ID string.
|
|
235
|
+
* @returns Token string payload containing user authorization tokens.
|
|
97
236
|
*/
|
|
98
237
|
getDiscordOAuth2Token(discordAppId: string): string;
|
|
99
238
|
|
|
100
239
|
/**
|
|
101
|
-
*
|
|
240
|
+
* Requests a preferred secure authentication application code payload via Discord's authorization flow.
|
|
241
|
+
* @deprecated
|
|
242
|
+
* @param discordAppId - The registered client registration application client ID string.
|
|
243
|
+
* @param scopes - Separated validation permission request keyword groups strings (e.g., `"identify guilds"`).
|
|
244
|
+
* @returns An authentication code string convertible into access tokens server-side.
|
|
102
245
|
*/
|
|
103
246
|
getDiscordCodeAuthorization(discordAppId: string, scopes: string): string;
|
|
104
247
|
|
|
105
248
|
/**
|
|
106
|
-
* Returns current server
|
|
249
|
+
* Returns the endpoint address configuration tracking string of the current server session.
|
|
250
|
+
* @returns Endpoint routing connection destination details string (e.g., `"127.0.0.1:4430"`).
|
|
107
251
|
*/
|
|
108
252
|
getCurrentServerEndpoint(): string;
|
|
109
253
|
|
|
110
254
|
/**
|
|
111
|
-
*
|
|
255
|
+
* Extracts the unique global player numeric index ID matching an active native local player entity handle.
|
|
256
|
+
* @param playerHash - The target local engine character object handle tracking number.
|
|
257
|
+
* @returns Network server-side entity tracking index ID number.
|
|
112
258
|
*/
|
|
113
259
|
getPlayerServerId(playerHash: number): number;
|
|
114
260
|
|
|
115
261
|
/**
|
|
116
|
-
*
|
|
262
|
+
* Queries environment configuration arrays to fetch string system variable values defined inside config manifest structures.
|
|
263
|
+
* @param varName - Target environmental variable path identifier name key string.
|
|
264
|
+
* @returns The corresponding variable value matching that name string.
|
|
117
265
|
*/
|
|
118
266
|
getVar(varName: string): string;
|
|
119
267
|
|
|
120
268
|
/**
|
|
121
|
-
*
|
|
269
|
+
* Queries environment configuration arrays to fetch integer variable values defined inside config manifest structures.
|
|
270
|
+
* @param varName - Target environmental variable path identifier name key string.
|
|
271
|
+
* @returns The variable evaluation value parsed into a numerical integer.
|
|
122
272
|
*/
|
|
123
273
|
getVarInt(varName: string): number;
|
|
124
274
|
|
|
125
275
|
/**
|
|
126
|
-
*
|
|
276
|
+
* Retrieves total execution duration elapsed since initialization of the master game engine shell layer tracking loops.
|
|
277
|
+
* @returns Calculated time tracker measurement value in milliseconds.
|
|
127
278
|
*/
|
|
128
279
|
getGameTimer(): number;
|
|
129
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Fetches raw unparsed configurations mapping platform launcher operational states.
|
|
283
|
+
* @returns Unparsed JSON payload string representing client settings configurations.
|
|
284
|
+
*/
|
|
130
285
|
getLauncherSettingsJSON(): string;
|
|
131
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Fetches parsed layout profiles tracking core client options configurations.
|
|
289
|
+
* @returns Object tracking client properties choices.
|
|
290
|
+
*/
|
|
132
291
|
getLauncherSettings(): any;
|
|
133
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Registers a callback execution function that runs continuously on every game engine render frame.
|
|
295
|
+
* @param cb - The logic routine executed on every render cycle.
|
|
296
|
+
* @returns An execution identifier handle index required to disable the execution loop later.
|
|
297
|
+
*/
|
|
134
298
|
setTick(cb: () => any): number;
|
|
135
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Removes and unbinds an active rendering cycle tracking loop execution block.
|
|
302
|
+
* @param tickId - The original registration index key returned by {@link setTick}.
|
|
303
|
+
*/
|
|
136
304
|
clearTick(tickId: number): void;
|
|
137
305
|
}
|
|
@@ -1,23 +1,86 @@
|
|
|
1
1
|
import type * as CyberEnums from '../out/enums';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Interface managing the integrated voice communication subsystem.
|
|
5
|
+
* Provides controls for device routing, audio leveling, capture thresholds, and distance-based 3D spatial attenuation.
|
|
6
|
+
*/
|
|
3
7
|
export interface MpVoiceChat {
|
|
8
|
+
/**
|
|
9
|
+
* Toggles the global operational state of the voice chat system.
|
|
10
|
+
* @param state - `true` to fully initialize and connect to the voice server channels, `false` to shut down capture and playback.
|
|
11
|
+
*/
|
|
4
12
|
enable(state: boolean): void;
|
|
5
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Modifies how the local microphone capture is triggered (e.g., Continuous, Voice Activity, or Push-To-Talk).
|
|
16
|
+
* @param type - The target voice activation mode enumeration value.
|
|
17
|
+
*/
|
|
6
18
|
changeActivationType(type: CyberEnums.EVoiceActivationType): void;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Binds a specific hardware key code or input identifier to trigger microphone transmission when using Push-To-Talk.
|
|
22
|
+
* @param key - The numerical key code or explicit structural input key enum to assign.
|
|
23
|
+
*/
|
|
7
24
|
bindPushToTalkKey(key: number | CyberEnums.EInputKey): void;
|
|
8
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Sets the master playback volume level for inbound remote voice streams.
|
|
28
|
+
* @param value - Volumetric multiplier factor (typically ranging from `0.0` for muted up to `1.0` or higher for boosted gain).
|
|
29
|
+
*/
|
|
9
30
|
setOutputVolume(value: number): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Adjusts the local recording gain modification layer applied to the hardware microphone input before network broadcasting.
|
|
34
|
+
* @param value - Volumetric multiplier factor (typically ranging from `0.0` to `1.0`).
|
|
35
|
+
*/
|
|
10
36
|
setInputVolume(value: number): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the voice activity detection (VAD) audio floor threshold.
|
|
40
|
+
* Captured audio below this amplitude level will be automatically gated and ignored.
|
|
41
|
+
* @param value - The cutoff sensitivity threshold limit.
|
|
42
|
+
*/
|
|
11
43
|
setMicrophoneSensitivity(value: number): void;
|
|
12
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Queries the system multimedia framework to retrieve descriptive text labels of all available physical audio output playback devices.
|
|
47
|
+
* @returns An array containing the plaintext names or driver descriptors of accessible output hardware components.
|
|
48
|
+
*/
|
|
13
49
|
getOutputDevices(): string[];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Queries the system multimedia framework to retrieve descriptive text labels of all available physical audio input recording devices.
|
|
53
|
+
* @returns An array containing the plaintext names or driver descriptors of accessible input hardware components.
|
|
54
|
+
*/
|
|
14
55
|
getInputDevices(): string[];
|
|
15
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Routes the voice playback audio rendering stream into a specific physical output device using its indexed layout match.
|
|
59
|
+
* @param index - The hardware array element position index matching the list returned by {@link getOutputDevices}.
|
|
60
|
+
*/
|
|
16
61
|
setOutputDevice(index: number): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Selects and hooks the physical recording mic input stream into a specific hardware component using its indexed layout match.
|
|
65
|
+
* @param index - The hardware array element position index matching the list returned by {@link getInputDevices}.
|
|
66
|
+
*/
|
|
17
67
|
setInputDevice(index: number): void;
|
|
18
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Configures the local input listening radius or proximity box boundaries.
|
|
71
|
+
* @param distance - Maximum distance measurement units used to bound transmission scopes.
|
|
72
|
+
*/
|
|
19
73
|
setInputDistance(distance: number): void;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sets the maximum linear distance radius over which a remote player's 3D spatialized voice stream will attenuate down to silence.
|
|
77
|
+
* @param distance - Proximity spatial calculation distance limits.
|
|
78
|
+
*/
|
|
20
79
|
setOutputDistance(distance: number): void;
|
|
21
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Evaluates whether the voice client manager is initialized, connected to a voice channel, and operating normally.
|
|
83
|
+
* @returns `true` if the system layer is running and ready, otherwise `false`.
|
|
84
|
+
*/
|
|
22
85
|
isActive(): boolean;
|
|
23
86
|
}
|