@cybermp-community/client-types 2.3.7 → 2.4.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.
- package/LICENSE +14 -16
- package/{README → README.md} +6 -5
- package/dist/classes.d.ts +0 -20
- package/dist/mp-classes.d.ts +0 -3
- package/dist/precomputed/cef.d.ts +5 -1
- package/dist/precomputed/{classes.d.ts → classes/extend.d.ts} +8 -22
- package/dist/precomputed/classes/index.d.ts +2 -0
- package/dist/precomputed/classes/screens.d.ts +37 -0
- package/dist/precomputed/events.d.ts +9 -7
- package/dist/precomputed/index.d.ts +1 -1
- package/dist/precomputed/mp.d.ts +1 -1
- package/package.json +10 -6
package/LICENSE
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
Creative Commons Attribution-ShareAlike 4.0 International
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 CyberMP Community Developers
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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.
|
package/{README → README.md}
RENAMED
|
@@ -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
|
-
- **
|
|
11
|
-
- **[
|
|
12
|
-
- **[
|
|
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
|
|
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 {
|
package/dist/mp-classes.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 '
|
|
3
|
-
import type { MpClasses } from '
|
|
4
|
-
import * as CyberEnums from '
|
|
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
|
-
|
|
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
|
-
|
|
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,37 @@
|
|
|
1
|
+
import type { MpClasses } from '../../mp-classes.d.ts';
|
|
2
|
+
import type * as CyberEnums from '../../enums';
|
|
3
|
+
|
|
4
|
+
export class LoadingScreenSystem {
|
|
5
|
+
GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
|
|
6
|
+
GetLoadingScreenProgress(): number;
|
|
7
|
+
OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class MultiplayerSystem {
|
|
11
|
+
/**
|
|
12
|
+
* Removes game object classes (e.g., T extends gameObject, playerPuppet, NpcPuppet) from the map.
|
|
13
|
+
* @param objectClassMap Array of class names to delete.
|
|
14
|
+
*/
|
|
15
|
+
DeclareDeletedObjects(objectClassMap: Array<keyof MpClasses>): void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Removes game objects by their unique hashes from the map.
|
|
19
|
+
* @param objectHashMap Array of unique game object hashes to delete.
|
|
20
|
+
*/
|
|
21
|
+
DeletedObjectsByUniqueHash(objectHashMap: string[]): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enables or disables synchronization of default effects, as defined by the CyberMP platform.
|
|
25
|
+
* @param value Whether to use the default effects.
|
|
26
|
+
*/
|
|
27
|
+
UseDefaultEffectsByPlatform(value: boolean): void;
|
|
28
|
+
|
|
29
|
+
SetDefaultSpawnPosition(position: Vector3, yaw: number): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module '../../mp-classes.d.ts' {
|
|
33
|
+
export interface MpClasses {
|
|
34
|
+
LoadingScreenSystem: typeof LoadingScreenSystem;
|
|
35
|
+
MultiplayerSystem: typeof MultiplayerSystem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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.
|
package/dist/precomputed/mp.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cybermp-community/client-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "TypeScript type definitions for the CyberMP client-side environment.",
|
|
5
|
-
"license": "
|
|
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
|
-
"
|
|
36
|
-
"
|
|
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
|
|
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
|
-
"@
|
|
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",
|