@cybermp/client-types 2.2.2 → 2.3.1

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/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "@cybermp/client-types",
3
- "version": "2.2.2",
4
- "description": "",
3
+ "version": "2.3.1",
4
+ "description": "TypeScript type definitions for the CyberMP client-side environment.",
5
5
  "types": "./precomputed/index.d.ts",
6
6
  "files": [
7
7
  "./out",
8
8
  "./precomputed"
9
9
  ],
10
- "keywords": [],
10
+ "keywords": [
11
+ "cybermp",
12
+ "cyberpunk",
13
+ "multiplayer",
14
+ "mp",
15
+ "server",
16
+ "cp2077",
17
+ "types"
18
+ ],
11
19
  "author": "terminaate",
12
20
  "contributors": [
13
21
  "An1by"
@@ -33,6 +41,7 @@
33
41
  "license": "MIT",
34
42
  "devDependencies": {
35
43
  "@types/fs-extra": "^11.0.4",
44
+ "@types/node": "^24.13.1",
36
45
  "@vitest/ui": "4.0.15",
37
46
  "consola": "^3.4.2",
38
47
  "fast-json-patch": "^3.1.1",
@@ -1,24 +1,24 @@
1
- /**
2
- * Interface for managing the game's embedded Chromium Embedded Framework (CEF) web instances.
3
- * Handles display focus layer switching, mouse pointer capturing, and runtime address navigation.
4
- */
5
- export interface MpCef {
6
- /**
7
- * Sets the interaction focus and inputs routing priority over the active browser frame layout.
8
- * @param focus - `true` to pass keyboard input focus into the web view, `false` to return focus to the game engine.
9
- * @param cursor - Optional flag. `true` renders and locks the OS cursor over the game window, `false` hides it.
10
- */
11
- setFocus(focus: boolean, cursor?: boolean): void;
12
-
13
- /**
14
- * Evaluates whether the user's input focus context is currently actively captured by the CEF interface layer.
15
- * @returns `true` if the web view is holding input priority focus, otherwise `false`.
16
- */
17
- isInFocus(): boolean;
18
-
19
- /**
20
- * Instructs the web view instance frame to perform immediate route navigation to a new target path or web address destination.
21
- * @param url - The fully qualified target URL or local asset resource file path string to render.
22
- */
23
- setUrl(url: string): void;
24
- }
1
+ /**
2
+ * Interface for managing the game's embedded Chromium Embedded Framework (CEF) web instances.
3
+ * Handles display focus layer switching, mouse pointer capturing, and runtime address navigation.
4
+ */
5
+ export interface MpCef {
6
+ /**
7
+ * Sets the interaction focus and inputs routing priority over the active browser frame layout.
8
+ * @param focus - `true` to pass keyboard input focus into the web view, `false` to return focus to the game engine.
9
+ * @param cursor - Optional flag. `true` renders and locks the OS cursor over the game window, `false` hides it.
10
+ */
11
+ setFocus(focus: boolean, cursor?: boolean): void;
12
+
13
+ /**
14
+ * Evaluates whether the user's input focus context is currently actively captured by the CEF interface layer.
15
+ * @returns `true` if the web view is holding input priority focus, otherwise `false`.
16
+ */
17
+ isInFocus(): boolean;
18
+
19
+ /**
20
+ * Instructs the web view instance frame to perform immediate route navigation to a new target path or web address destination.
21
+ * @param url - The fully qualified target URL or local asset resource file path string to render.
22
+ */
23
+ setUrl(url: string): void;
24
+ }
@@ -0,0 +1,17 @@
1
+ export interface MpCommands {
2
+ /**
3
+ * Register a command
4
+ * @param commandName Command name without "/".
5
+ * @param callback Callback with player and args.
6
+ */
7
+ add(
8
+ commandName: string,
9
+ callback: (id: number, args: string[]) => void,
10
+ ): void;
11
+
12
+ /**
13
+ * Unregister a command
14
+ * @param commandName Command name without "/".
15
+ */
16
+ remove(commandName: string): void;
17
+ }
@@ -1,3 +1,20 @@
1
- export interface MpDiscord {
2
- updateRichPresence(state?: string, details?: string): void;
3
- }
1
+ export interface MpDiscord {
2
+ updateRichPresence(state?: string, details?: string): void;
3
+
4
+ /**
5
+ * Requests a preferred secure authentication application code payload via Discord's authorization flow.
6
+ * @param discordAppId - The registered client registration application client ID string.
7
+ * @param scopes - Separated validation permission request keyword groups strings (e.g., `"identify guilds"`).
8
+ * @returns An authentication code string convertible into access tokens server-side.
9
+ */
10
+ getOAuth2Token(discordAppId: string, scopes: string): string;
11
+
12
+ /**
13
+ * Requests a preferred secure authentication application code payload via Discord's authorization flow.
14
+ * @deprecated
15
+ * @param discordAppId - The registered client registration application client ID string.
16
+ * @param scopes - Separated validation permission request keyword groups strings (e.g., `"identify guilds"`).
17
+ * @returns An authentication code string convertible into access tokens server-side.
18
+ */
19
+ getCodeAuthorization(discordAppId: string, scopes: string): string;
20
+ }
@@ -1,47 +1,47 @@
1
- /**
2
- * @category Enums
3
- */
4
- export enum EWeatherState {
5
- SUNNY = '24h_weather_sunny',
6
- LIGHT_CLOUDS = '24h_weather_light_clouds',
7
- CLOUDY = '24h_weather_cloudy',
8
- HEAVY_CLOUDS = '24h_weather_heavy_clouds',
9
- FOG = '24h_weather_fog',
10
- RAIN = '24h_weather_rain',
11
- TOXIC_RAIN = '24h_weather_toxic_rain',
12
- POLLUTION = '24h_weather_pollution',
13
- SANDSTORM = '24h_weather_sandstorm',
14
- DEEP_BLUE = 'q302_deeb_blue',
15
- LIGHT_RAIN = 'q302_light_rain',
16
- SQUAT_MORNING = 'q302_squat_morning',
17
- EPILOGUE_CLOUDY_MORNING = 'q306_epilogue_cloudy_morning',
18
- RAINY_NIGHT = 'q306_rainy_night',
19
- COURIER_CLOUDS = 'sa_courier_clouds',
20
- }
21
-
22
- /**
23
- * @category Enums
24
- */
25
- export enum EVoiceActivationType {
26
- UNDEFINED = 0,
27
- VOICE = 1,
28
- PUSH_TO_TALK = 2,
29
- }
30
-
31
- /**
32
- * @category Enums
33
- */
34
- export enum EPlayerGender {
35
- Female = 1,
36
- Male = 2,
37
- }
38
-
39
- /**
40
- * @category Enums
41
- */
42
- export enum ELoadingScreenState {
43
- Started = 1,
44
- Loading,
45
- PreEnded,
46
- Hidden,
47
- }
1
+ /**
2
+ * @category Enums
3
+ */
4
+ export enum EWeatherState {
5
+ SUNNY = '24h_weather_sunny',
6
+ LIGHT_CLOUDS = '24h_weather_light_clouds',
7
+ CLOUDY = '24h_weather_cloudy',
8
+ HEAVY_CLOUDS = '24h_weather_heavy_clouds',
9
+ FOG = '24h_weather_fog',
10
+ RAIN = '24h_weather_rain',
11
+ TOXIC_RAIN = '24h_weather_toxic_rain',
12
+ POLLUTION = '24h_weather_pollution',
13
+ SANDSTORM = '24h_weather_sandstorm',
14
+ DEEP_BLUE = 'q302_deeb_blue',
15
+ LIGHT_RAIN = 'q302_light_rain',
16
+ SQUAT_MORNING = 'q302_squat_morning',
17
+ EPILOGUE_CLOUDY_MORNING = 'q306_epilogue_cloudy_morning',
18
+ RAINY_NIGHT = 'q306_rainy_night',
19
+ COURIER_CLOUDS = 'sa_courier_clouds',
20
+ }
21
+
22
+ /**
23
+ * @category Enums
24
+ */
25
+ export enum EVoiceActivationType {
26
+ UNDEFINED = 0,
27
+ VOICE = 1,
28
+ PUSH_TO_TALK = 2,
29
+ }
30
+
31
+ /**
32
+ * @category Enums
33
+ */
34
+ export enum EPlayerGender {
35
+ Female = 1,
36
+ Male = 2,
37
+ }
38
+
39
+ /**
40
+ * @category Enums
41
+ */
42
+ export enum ELoadingScreenState {
43
+ Started = 1,
44
+ Loading,
45
+ PreEnded,
46
+ Hidden,
47
+ }