@cybermp-community/client-types 2.3.7 → 2.4.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/LICENSE CHANGED
@@ -1,21 +1,19 @@
1
- MIT License
1
+ Creative Commons Attribution-ShareAlike 4.0 International
2
2
 
3
3
  Copyright (c) 2026 CyberMP Community Developers
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
6
+ International License. To view a copy of this license, visit
7
+ https://creativecommons.org/licenses/by-sa/4.0/ or send a letter to
8
+ Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
11
9
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
10
+ You are free to:
11
+ - Share: copy and redistribute the material in any medium or format
12
+ - Adapt: remix, transform, and build upon the material for any purpose,
13
+ even commercially
14
14
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
15
+ Under the following terms:
16
+ - Attribution: You must give appropriate credit, provide a link to the
17
+ license, and indicate if changes were made.
18
+ - ShareAlike: If you remix, transform, or build upon the material, you
19
+ must distribute your contributions under the same license as the original.
@@ -4,12 +4,13 @@ This repository contains the TypeScript type definitions for the **[CyberMP](htt
4
4
 
5
5
  These types cover the `mp` object, the game's internal classes, enums, and bitfields.
6
6
 
7
- ### 🖥️ Integrated Libraries
7
+ ### 🖥️ Integrated Libraries (which supports CyberMP)
8
8
  This package includes built-in types for the following essential modding libraries, providing full type safety and IntelliSense for their respective classes and functions:
9
9
 
10
- - **[Codeware](https://github.com/psiberx/cp2077-codeware) v1.19.1**
11
- - **[ArchiveXL](https://github.com/psiberx/cp2077-archive-xl) v1.26.3**
12
- - **[TweakXL](https://github.com/psiberx/cp2077-tweak-xl) v1.11.3**
10
+ - **Cyberpunk 2077 2.31**
11
+ - **[Codeware](https://github.com/psiberx/cp2077-codeware) v1.18.0**
12
+ - **[ArchiveXL](https://github.com/psiberx/cp2077-archive-xl) v1.26.0**
13
+ - **[TweakXL](https://github.com/psiberx/cp2077-tweak-xl) v1.11.0**
13
14
 
14
15
  ## 📦 Installation
15
16
 
@@ -37,4 +38,4 @@ This repository is developed by [CyberMP Community Developers](https://gitlab.co
37
38
 
38
39
  ## ⚖️ License
39
40
 
40
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
41
+ This project is licensed under the СС BY-SA 4.0 License - see the [LICENSE](LICENSE) file for details.
package/dist/classes.d.ts CHANGED
@@ -142692,16 +142692,6 @@ export class ResourceToken {
142692
142692
  RegisterCallback(target: M.Handle<IScriptable>, function1: string): void;
142693
142693
  }
142694
142694
 
142695
- export class SoundBankEntry {
142696
- name: string;
142697
- isResident: boolean;
142698
- resourcePath: ResRef;
142699
- }
142700
-
142701
- export class SoundBanksJson extends CResource {
142702
- soundBanks: SoundBankEntry[];
142703
- }
142704
-
142705
142695
  export class ResetSecuritySystemNetwork extends redEvent {
142706
142696
  }
142707
142697
 
@@ -142882,15 +142872,12 @@ export class Reflection {
142882
142872
  static GetType(name: string): M.Handle<ReflectionType>;
142883
142873
  static GetClass(name: string): M.Handle<ReflectionClass>;
142884
142874
  static GetEnum(name: string): M.Handle<ReflectionEnum>;
142885
- static GetBitfield(name: string): M.Handle<ReflectionBitfield>;
142886
142875
  static GetGlobalFunction(name: string): M.Handle<ReflectionStaticFunc>;
142887
142876
  static GetTypes(): M.Handle<ReflectionType>[];
142888
142877
  static GetClasses(): M.Handle<ReflectionClass>[];
142889
142878
  static GetDerivedClasses(base: string): M.Handle<ReflectionClass>[];
142890
142879
  static GetEnums(): M.Handle<ReflectionEnum>[];
142891
- static GetBitfields(): M.Handle<ReflectionBitfield>[];
142892
142880
  static GetGlobalFunctions(): M.Handle<ReflectionStaticFunc>[];
142893
- Call(name: string, args?: any[]): any;
142894
142881
  }
142895
142882
 
142896
142883
  export class ReflectionClass extends ReflectionType {
@@ -142914,11 +142901,6 @@ export class ReflectionEnum extends ReflectionType {
142914
142901
  AddConstant(name: string, value: bigint): void;
142915
142902
  }
142916
142903
 
142917
- export class ReflectionBitfield extends ReflectionType {
142918
- GetConstants(): M.Handle<ReflectionConst>[];
142919
- IsNative(): boolean;
142920
- }
142921
-
142922
142904
  export class ReflectionConst {
142923
142905
  GetName(): string;
142924
142906
  GetValue(): bigint;
@@ -142957,10 +142939,8 @@ export class ReflectionType {
142957
142939
  IsArray(): boolean;
142958
142940
  IsClass(): boolean;
142959
142941
  IsEnum(): boolean;
142960
- IsBitfield(): boolean;
142961
142942
  AsClass(): M.Handle<ReflectionClass>;
142962
142943
  AsEnum(): M.Handle<ReflectionEnum>;
142963
- AsBitfield(): M.Handle<ReflectionBitfield>;
142964
142944
  }
142965
142945
 
142966
142946
  export class ControllerDelayCallback extends gameDelaySystemScriptedDelayCallbackWrapper {
@@ -15869,8 +15869,6 @@ export interface MpClasses {
15869
15869
  ResRef: typeof C.ResRef;
15870
15870
  ResAsyncRef: typeof C.ResAsyncRef;
15871
15871
  ResourceToken: typeof C.ResourceToken;
15872
- SoundBankEntry: typeof C.SoundBankEntry;
15873
- SoundBanksJson: typeof C.SoundBanksJson;
15874
15872
  ResetSecuritySystemNetwork: typeof C.ResetSecuritySystemNetwork;
15875
15873
  EntityBuilderWrapper: typeof C.EntityBuilderWrapper;
15876
15874
  EntityBuilderTemplateWrapper: typeof C.EntityBuilderTemplateWrapper;
@@ -15892,7 +15890,6 @@ export interface MpClasses {
15892
15890
  Reflection: typeof C.Reflection;
15893
15891
  ReflectionClass: typeof C.ReflectionClass;
15894
15892
  ReflectionEnum: typeof C.ReflectionEnum;
15895
- ReflectionBitfield: typeof C.ReflectionBitfield;
15896
15893
  ReflectionConst: typeof C.ReflectionConst;
15897
15894
  ReflectionFunc: typeof C.ReflectionFunc;
15898
15895
  ReflectionMemberFunc: typeof C.ReflectionMemberFunc;
@@ -1,5 +1,9 @@
1
1
  export interface MpCef {
2
- setFocus(focus: boolean, cursor?: boolean = focus): void;
2
+ /**
3
+ * @param focus Is need to focus CEF.
4
+ * @param cursor By default equals focus.
5
+ */
6
+ setFocus(focus: boolean, cursor?: boolean): void;
3
7
  isInFocus(): boolean;
4
8
  setUrl(url: string): void;
5
9
  }
@@ -1,15 +1,9 @@
1
1
 
2
- import type { UnwrapClass } from './game.d.ts';
3
- import type { MpClasses } from '../mp-classes.d.ts';
4
- import * as CyberEnums from '../enums';
2
+ import type { UnwrapClass } from '../../game.d.ts';
3
+ import type { MpClasses } from '../../mp-classes.d.ts';
4
+ import * as CyberEnums from '../../enums';
5
5
 
6
- export class LoadingScreenSystem {
7
- GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
8
- GetLoadingScreenProgress(): number;
9
- OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
10
- }
11
-
12
- declare module '../classes.d.ts' {
6
+ declare module '../../classes.d.ts' {
13
7
  export interface entEntity {
14
8
  GetMorphTargets(): entMorphTargetWeightEntry[];
15
9
  }
@@ -62,10 +56,6 @@ declare module '../classes.d.ts' {
62
56
  export function GetHash(value: any): bigint;
63
57
  }
64
58
 
65
- export namespace ScriptGameInstance {
66
- export function GetLoadingScreenSystem(): LoadingScreenSystem;
67
- }
68
-
69
59
  export interface inkISystemRequestsHandler {
70
60
  StartMainMenu(): void;
71
61
  }
@@ -84,7 +74,9 @@ declare module '../classes.d.ts' {
84
74
  }
85
75
 
86
76
  export interface entEntity {
87
- ReassembleWithComponents(arr: entIComponent[]): void
77
+ GetMorphWeights(): entMorphTargetWeightEntry[];
78
+ ReassembleWithComponents(arr: entIComponent[]): void;
79
+ TeleportPed(position: Vector3, rotation?: EulerAngles): void;
88
80
  }
89
81
 
90
82
  export interface AimingStateDecisions {
@@ -96,7 +88,7 @@ declare module '../classes.d.ts' {
96
88
  OnItemEquipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
97
89
  OnItemUnequipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
98
90
  }
99
-
91
+
100
92
  export interface ApplyStatGroupEffectorCallback {
101
93
  OnItemEquipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
102
94
  OnItemUnequipped(slot: CyberEnums.AttachmentSlots, item: gameItemID): void;
@@ -106,10 +98,4 @@ declare module '../classes.d.ts' {
106
98
  SetPlayerGender(gender: CyberEnums.PlayerGender, savedPos?: boolean): void;
107
99
  OnPlayerGenderChanged(gender: CyberEnums.PlayerGender): void;
108
100
  }
109
- }
110
-
111
- declare module '../mp-classes.d.ts' {
112
- export interface MpClasses {
113
- LoadingScreenSystem: typeof LoadingScreenSystem;
114
- }
115
101
  }
@@ -0,0 +1,2 @@
1
+ export * from "./extend";
2
+ export * from "./screens";
@@ -0,0 +1,46 @@
1
+ import type { MpClasses } from "../../mp-classes.d.ts";
2
+ import type * as C from "../../classes.d.ts";
3
+ import type * as E from "../../enums";
4
+ import type * as M from "../../common.d.ts";
5
+
6
+ export class LoadingScreenSystem {
7
+ GetLoadingScreenState(): E.ELoadingScreenState;
8
+ GetLoadingScreenProgress(): number;
9
+ OnLoadingScreenStateChange(newState: E.ELoadingScreenState): void;
10
+ }
11
+
12
+ export class MultiplayerSystem {
13
+ /**
14
+ * Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
15
+ * @param objectClassMap Array of class names to delete.
16
+ */
17
+ DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
18
+
19
+ /**
20
+ * Removes game objects by their unique hashes from the map.
21
+ * @param objectHashMap Array of unique game object hashes to delete.
22
+ */
23
+ DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
24
+
25
+ /**
26
+ * Enables or disables synchronization of default effects, as defined by the CyberMP platform.
27
+ * @param value Whether to use the default effects.
28
+ */
29
+ UseDefaultEffectsByPlatform(value: boolean): void;
30
+
31
+ SetDefaultSpawnPosition(position: C.Vector3, yaw: number): void;
32
+ }
33
+
34
+ declare module "../../mp-classes.d.ts" {
35
+ export interface MpClasses {
36
+ LoadingScreenSystem: typeof LoadingScreenSystem;
37
+ MultiplayerSystem: typeof MultiplayerSystem;
38
+ }
39
+ }
40
+
41
+ declare module "../../classes.d.ts" {
42
+ export namespace ScriptGameInstance {
43
+ function GetLoadingScreenSystem(): M.Handle<LoadingScreenSystem>;
44
+ function GetMultiplayerSystem(): M.Handle<MultiplayerSystem>;
45
+ }
46
+ }
@@ -1,17 +1,19 @@
1
+ type Args = any[];
2
+
1
3
  export interface MpEvents {
2
4
  /**
3
5
  * Register a custom event listener.
4
6
  * @param eventName Name of the event.
5
7
  * @param callback Callback function.
6
8
  */
7
- on(eventName: string, callback: (...args: any[]) => void): void;
9
+ on<T extends Array = Args>(eventName: string, callback: (...args: T) => void): void;
8
10
 
9
11
  /**
10
12
  * UnRegister a custom event listener.
11
13
  * @param eventName Name of the event.
12
14
  * @param callback Callback function.
13
15
  */
14
- off(eventName: string, callback: (...args: any[]) => void): void;
16
+ off<T extends Array = Args>(eventName: string, callback: (...args: T) => void): void;
15
17
 
16
18
  /**
17
19
  * Emit a previously registered custom event.
@@ -19,29 +21,29 @@ export interface MpEvents {
19
21
  * @param eventName Name of the event.
20
22
  * @param args Arguments to pass.
21
23
  */
22
- emit(eventName: string, ...args: any[]): void;
24
+ emit<T extends Array = Args>(eventName: string, ...args: T): void;
23
25
 
24
26
  /**
25
27
  * Register a listener for server event on client.
26
28
  */
27
- onServer(eventName: string, callback: (...args: any[]) => void): void;
29
+ onServer<T extends Array = Args>(eventName: string, callback: (...args: T) => void): void;
28
30
 
29
31
  /**
30
32
  * Emit an event to the server.
31
33
  */
32
- emitServer(eventName: string, ...args: any[]): void;
34
+ emitServer<T extends Array = Args>(eventName: string, ...args: T): void;
33
35
 
34
36
  /**
35
37
  * Emit an event to the cef.
36
38
  */
37
- emitCef(eventName: string, ...args: any[]): void;
39
+ emitCef<T extends Array = Args>(eventName: string, ...args: T): void;
38
40
 
39
41
  /**
40
42
  * Register a custom cef event listener.
41
43
  * @param eventName Name of the event.
42
44
  * @param callback Callback function.
43
45
  */
44
- onCef(eventName: string, callback: (...args: any[]) => void): void;
46
+ onCef<T extends Array = Args>(eventName: string, callback: (...args: T) => void): void;
45
47
 
46
48
  /**
47
49
  * Register a command in the client scope.
@@ -1,5 +1,12 @@
1
- export interface MpExports {
2
- [module: string]: {
3
- [name: string]: (...args: unknown[]) => unknown;
4
- };
5
- }
1
+ export type MpExports = MpExternalExports & MpCreateExport;
2
+
3
+ interface MpExternalExports {
4
+ [module: string]: {
5
+ [name: string]: <T extends unknown[] = unknown[], R = unknown>(...args: T) => R | Promise<R>;
6
+ };
7
+ }
8
+
9
+ type MpCreateExport = <T extends unknown[] = unknown[], R = unknown>(
10
+ name: string,
11
+ callback: (...args: T) => R | Promise<R>,
12
+ ) => void;
@@ -1,10 +1,9 @@
1
-
2
- import type { Vector3 } from '../classes.d.ts';
3
- import type { MpClasses } from '../mp-classes.d.ts';
4
- import * as CyberEnums from '../enums';
1
+ import type { Vector3 } from "../classes.d.ts";
2
+ import type { MpClasses } from "../mp-classes.d.ts";
3
+ import type * as CyberEnums from "../enums";
5
4
 
6
5
  // THIS CODE IS FOR PRECOMPUTED TYPES
7
- export type UnwrapClass<T> = T extends { new(): infer U } ? U : T;
6
+ export type UnwrapClass<T> = T extends { new (): infer U } ? U : T;
8
7
 
9
8
  export type OverrideFunction = <
10
9
  C extends keyof MpClasses,
@@ -63,7 +62,7 @@ export interface CyberMP {
63
62
  SetDefaultSpawnPosition(position: Vector3, yaw: number): void;
64
63
  }
65
64
 
66
- declare module '../game.d.ts' {
65
+ declare module "../game.d.ts" {
67
66
  export interface MpGame {
68
67
  CyberMP: CyberMP;
69
68
  TweakDB: TweakDB;
@@ -113,7 +112,21 @@ declare module '../game.d.ts' {
113
112
  * @param type Model name type
114
113
  * @returns Model hash
115
114
  */
116
- getHashFromName(name: string, type: 'tweakdbid' | 'cname' | 'resref'): string;
115
+ getHashFromName(
116
+ name: string,
117
+ type: "tweakdbid" | "cname" | "resref",
118
+ ): string;
119
+
120
+ /**
121
+ * Returns model name.
122
+ * @param name Model hash
123
+ * @param type Model hash type
124
+ * @returns Model name
125
+ */
126
+ getNameFromHash(
127
+ hash: string,
128
+ type: "tweakdbid" | "cname" | "resref",
129
+ ): string;
117
130
 
118
131
  /**
119
132
  * Overrides method function inside selected class.
@@ -177,4 +190,3 @@ declare module '../game.d.ts' {
177
190
  fromVariant<R = any>(obj: any): R;
178
191
  }
179
192
  }
180
-
@@ -1,4 +1,4 @@
1
- export type * from './classes.d.ts';
1
+ export type * from './classes';
2
2
  export type * from './cef.d.ts';
3
3
  export type * from './discord.d.ts';
4
4
  export type * from './events.d.ts';
@@ -123,7 +123,7 @@ declare module '../mp.d.ts' {
123
123
  /**
124
124
  * Returns time in ms since game start.
125
125
  */
126
- getTimer(): number;
126
+ getGameTimer(): number;
127
127
 
128
128
  getLauncherSettingsJSON(): string;
129
129
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cybermp-community/client-types",
3
- "version": "2.3.7",
3
+ "version": "2.4.1",
4
4
  "description": "TypeScript type definitions for the CyberMP client-side environment.",
5
- "license": "MIT",
5
+ "license": "CC BY-SA 4.0",
6
6
  "author": {
7
7
  "name": "An1by",
8
8
  "url": "https://gitlab.com/an1by"
@@ -30,12 +30,15 @@
30
30
  "dist"
31
31
  ],
32
32
  "scripts": {
33
+ "format": "biome format --write .",
34
+ "lint": "biome lint .",
35
+ "check": "biome check .",
33
36
  "redscript:dumper:build": "cd dumper && cargo build --release",
34
37
  "dumps:generate:codeware": "./dumper/target/release/codeware-dumper.exe ./libs/codeware/scripts -r -o ./json/redscript/codeware",
35
- "dunps:generate:tweak-xl": "./dumper/target/release/codeware-dumper.exe ./libs/tweak-xl/scripts -r -o ./json/redscript/tweak-xl",
36
- "dunps:generate:archive-xl": "./dumper/target/release/codeware-dumper.exe ./libs/archive-xl/scripts -r -o ./json/redscript/archive-xl",
38
+ "dumps:generate:tweak-xl": "./dumper/target/release/codeware-dumper.exe ./libs/tweak-xl/scripts -r -o ./json/redscript/tweak-xl",
39
+ "dumps:generate:archive-xl": "./dumper/target/release/codeware-dumper.exe ./libs/archive-xl/scripts -r -o ./json/redscript/archive-xl",
37
40
  "dumps:cyberpunk:download": "tsx ./scripts/download-dumps.ts",
38
- "dumps:generate": "rimraf ./json && bun run dumps:cyberpunk:download && bun run dunps:generate:archive-xl && bun run dunps:generate:tweak-xl && bun run dumps:generate:codeware",
41
+ "dumps:generate": "rimraf ./json && bun run dumps:cyberpunk:download && bun run dumps:generate:archive-xl && bun run dumps:generate:tweak-xl && bun run dumps:generate:codeware",
39
42
  "types:apply-modified": "tsx ./scripts/apply-modified.ts",
40
43
  "types:generate": "tsx ./src",
41
44
  "generate": "bun run dumps:generate && bun run types:apply-modified && bun run types:generate",
@@ -56,7 +59,8 @@
56
59
  "tweakxl"
57
60
  ],
58
61
  "devDependencies": {
59
- "@types/node": "^20.11.20",
62
+ "@biomejs/biome": "^2.0.0",
63
+ "@types/node": "^25.6.0",
60
64
  "consola": "^3.2.3",
61
65
  "fs-extra": "^11.3.4",
62
66
  "rimraf": "^5.0.5",