@cybermp-community/client-types 2.2.0 → 2.3.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/dist/classes.d.ts +7412 -8804
- package/dist/game.d.ts +79 -74
- package/dist/mp-classes.d.ts +2 -281
- package/dist/mp.d.ts +1 -1
- package/dist/precomputed/classes.d.ts +83 -0
- package/dist/precomputed/game.d.ts +3 -86
- package/dist/precomputed/index.d.ts +9 -8
- package/dist/precomputed/voice-chat.d.ts +4 -2
- package/package.json +11 -7
package/dist/mp.d.ts
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
|
|
2
|
+
import type { UnwrapClass } from './game.d.ts';
|
|
3
|
+
import type { MpClasses } from '../mp-classes.d.ts';
|
|
4
|
+
import * as CyberEnums from '../enums';
|
|
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' {
|
|
13
|
+
export interface entEntity {
|
|
14
|
+
GetMorphTargets(): entMorphTargetWeightEntry[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface worldWeatherScriptInterface extends IScriptable {
|
|
18
|
+
SetWeather(
|
|
19
|
+
weather: CyberEnums.EWeatherState,
|
|
20
|
+
blendTime?: number,
|
|
21
|
+
priority?: number,
|
|
22
|
+
): void;
|
|
23
|
+
ResetWeather(forceRestore?: boolean, blendTime?: number): void;
|
|
24
|
+
GetWeatherState(): worldWeatherState;
|
|
25
|
+
GetEnvironmentDefinition(): worldEnvironmentDefinition;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface vehicleBaseObject extends gameObject {
|
|
29
|
+
HasGravity(): boolean;
|
|
30
|
+
EnableGravity(enable: boolean): boolean;
|
|
31
|
+
AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
|
|
32
|
+
ChangeLinelyVelocity(
|
|
33
|
+
velocity: Vector3,
|
|
34
|
+
angularVelocity: Vector3,
|
|
35
|
+
switchIndex: number,
|
|
36
|
+
): boolean;
|
|
37
|
+
GetVelocity(): Vector3;
|
|
38
|
+
GetAngularVelocity(): Vector3;
|
|
39
|
+
GetPhysicsState(): number;
|
|
40
|
+
IsOnGround(): boolean;
|
|
41
|
+
GetBoundaryBox(): Box;
|
|
42
|
+
VehicleOwnerWasChanged(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface gameMappinSystem extends gamemappinsIMappinSystem {
|
|
46
|
+
TrackMappin(id: gameNewMappinID): void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type OnlyExtendingScriptableSystem<T> = {
|
|
50
|
+
[K in keyof T as T[K] extends typeof gameScriptableSystem
|
|
51
|
+
? K
|
|
52
|
+
: never]: T[K];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export interface gameScriptableSystemsContainer<
|
|
56
|
+
Map = OnlyExtendingScriptableSystem<MpClasses>,
|
|
57
|
+
> {
|
|
58
|
+
Get<N extends keyof Map>(systemName: N): UnwrapClass<Map[N]>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace redResourceReferenceScriptToken {
|
|
62
|
+
export function GetHash(value: any): bigint;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export namespace ScriptGameInstance {
|
|
66
|
+
export function GetLoadingScreenSystem(): LoadingScreenSystem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface inkISystemRequestsHandler {
|
|
70
|
+
StartMainMenu(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface gameuiICharacterCustomizationSystem {
|
|
74
|
+
SetPlayerGender(gender: CyberEnums.EPlayerGender, savedPos?: boolean): void;
|
|
75
|
+
OnPlayerGenderChanged(gender: CyberEnums.EPlayerGender): void;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare module '../mp-classes.d.ts' {
|
|
80
|
+
export interface MpClasses {
|
|
81
|
+
LoadingScreenSystem: typeof LoadingScreenSystem;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import type { Vector3
|
|
2
|
+
import type { Vector3 } from '../classes.d.ts';
|
|
3
3
|
import type { MpClasses } from '../mp-classes.d.ts';
|
|
4
|
+
import * as CyberEnums from '../enums';
|
|
4
5
|
|
|
5
6
|
// THIS CODE IS FOR PRECOMPUTED TYPES
|
|
6
7
|
export type UnwrapClass<T> = T extends { new(): infer U } ? U : T;
|
|
@@ -62,90 +63,6 @@ export interface CyberMP {
|
|
|
62
63
|
SetDefaultSpawnPosition(position: Vector3, yaw: number): void;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
export class LoadingScreenSystem {
|
|
66
|
-
GetLoadingScreenState(): CyberEnums.ELoadingScreenState;
|
|
67
|
-
GetLoadingScreenProgress(): number;
|
|
68
|
-
OnLoadingScreenStateChange(newState: CyberEnums.ELoadingScreenState): void;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
declare module '../classes/worldWeatherScriptInterface.d.ts' {
|
|
72
|
-
export interface worldWeatherScriptInterface extends IScriptable {
|
|
73
|
-
SetWeather(
|
|
74
|
-
weather: CyberEnums.EWeatherState,
|
|
75
|
-
blendTime?: number,
|
|
76
|
-
priority?: number,
|
|
77
|
-
): void;
|
|
78
|
-
ResetWeather(forceRestore?: boolean, blendTime?: number): void;
|
|
79
|
-
GetWeatherState(): worldWeatherState;
|
|
80
|
-
GetEnvironmentDefinition(): worldEnvironmentDefinition;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
declare module '../classes/vehicleBaseObject.d.ts' {
|
|
85
|
-
export interface vehicleBaseObject extends gameObject {
|
|
86
|
-
HasGravity(): boolean;
|
|
87
|
-
EnableGravity(enable: boolean): boolean;
|
|
88
|
-
AddLinelyVelocity(velocity: Vector3, angularVelocity: Vector3): boolean;
|
|
89
|
-
ChangeLinelyVelocity(
|
|
90
|
-
velocity: Vector3,
|
|
91
|
-
angularVelocity: Vector3,
|
|
92
|
-
switchIndex: number,
|
|
93
|
-
): boolean;
|
|
94
|
-
GetVelocity(): Vector3;
|
|
95
|
-
GetAngularVelocity(): Vector3;
|
|
96
|
-
GetPhysicsState(): number;
|
|
97
|
-
IsOnGround(): boolean;
|
|
98
|
-
GetBoundaryBox(): Box;
|
|
99
|
-
VehicleOwnerWasChanged(): void;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
declare module '../classes/gameMappinSystem.d.ts' {
|
|
104
|
-
export interface gameMappinSystem extends gamemappinsIMappinSystem {
|
|
105
|
-
TrackMappin(id: gameNewMappinID): void;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
declare module '../classes/gameScriptableSystemsContainer.d.ts' {
|
|
110
|
-
|
|
111
|
-
type OnlyExtendingScriptableSystem<T> = {
|
|
112
|
-
[K in keyof T as T[K] extends typeof gameScriptableSystem
|
|
113
|
-
? K
|
|
114
|
-
: never]: T[K];
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export interface gameScriptableSystemsContainer<
|
|
118
|
-
Map = OnlyExtendingScriptableSystem<MpClasses>,
|
|
119
|
-
> {
|
|
120
|
-
Get<N extends keyof Map>(systemName: N): UnwrapClass<Map[N]>;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
declare module '../classes/ScriptGameInstance.d.ts' {
|
|
125
|
-
export namespace ScriptGameInstance {
|
|
126
|
-
export function GetLoadingScreenSystem(): LoadingScreenSystem;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
declare module '../classes/inkISystemRequestsHandler.d.ts' {
|
|
131
|
-
export interface inkISystemRequestsHandler {
|
|
132
|
-
StartMainMenu(): void;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
declare module '../classes/gameuiICharacterCustomizationSystem.d.ts' {
|
|
137
|
-
export interface gameuiICharacterCustomizationSystem {
|
|
138
|
-
SetPlayerGender(gender: CyberEnums.EPlayerGender, savedPos?: boolean): void;
|
|
139
|
-
OnPlayerGenderChanged(gender: CyberEnums.EPlayerGender): void;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare module '../mp-classes.d.ts' {
|
|
144
|
-
export interface MpClasses {
|
|
145
|
-
LoadingScreenSystem: typeof LoadingScreenSystem;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
66
|
declare module '../game.d.ts' {
|
|
150
67
|
export interface MpGame {
|
|
151
68
|
CyberMP: CyberMP;
|
|
@@ -196,7 +113,7 @@ declare module '../game.d.ts' {
|
|
|
196
113
|
* @param type Model name type
|
|
197
114
|
* @returns Model hash
|
|
198
115
|
*/
|
|
199
|
-
getHashFromName(name: string, type: 'tweakdbid' | 'cname'): string;
|
|
116
|
+
getHashFromName(name: string, type: 'tweakdbid' | 'cname' | 'resref'): string;
|
|
200
117
|
|
|
201
118
|
/**
|
|
202
119
|
* Overrides method function inside selected class.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
1
|
+
export type * from './classes.d.ts';
|
|
2
|
+
export type * from './cef.d.ts';
|
|
3
|
+
export type * from './discord.d.ts';
|
|
4
|
+
export type * from './events.d.ts';
|
|
5
|
+
export type * from './game.d.ts';
|
|
6
|
+
export type * from './local-storage.d.ts';
|
|
7
|
+
export type * from './meta.d.ts';
|
|
8
|
+
export type * from './mp.d.ts';
|
|
9
|
+
export type * from './voice-chat.d.ts';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as CyberEnums from '../enums';
|
|
2
|
+
|
|
1
3
|
export interface MpVoiceChat {
|
|
2
4
|
enable(state: boolean): void;
|
|
3
5
|
|
|
@@ -14,8 +16,8 @@ export interface MpVoiceChat {
|
|
|
14
16
|
setOutputDevice(index: number): void;
|
|
15
17
|
setInputDevice(index: number): void;
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
setInputDistance(distance: number): void;
|
|
20
|
+
setOutputDistance(distance: number): void;
|
|
19
21
|
|
|
20
22
|
isActive(): boolean;
|
|
21
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cybermp-community/client-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "TypeScript type definitions for the CyberMP client-side environment.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -31,11 +31,14 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"codeware:dumper:build": "cd dumper && cargo build --release",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"cyberpunk:
|
|
38
|
-
"generate": "
|
|
34
|
+
"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",
|
|
37
|
+
"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 dumps:generate:codeware",
|
|
39
|
+
"types:apply-modified": "tsx ./scripts/apply-modified.ts",
|
|
40
|
+
"types:generate": "tsx ./src",
|
|
41
|
+
"generate": "bun run dumps:generate && bun run types:apply-modified && bun run types:generate",
|
|
39
42
|
"bump": "npm version patch --no-git-tag-version",
|
|
40
43
|
"pub": "npm publish --access public"
|
|
41
44
|
},
|
|
@@ -53,9 +56,10 @@
|
|
|
53
56
|
"devDependencies": {
|
|
54
57
|
"@types/node": "^20.11.20",
|
|
55
58
|
"consola": "^3.2.3",
|
|
59
|
+
"fs-extra": "^11.3.4",
|
|
56
60
|
"rimraf": "^5.0.5",
|
|
57
61
|
"ts-morph": "^21.0.1",
|
|
58
62
|
"tsx": "^4.7.1",
|
|
59
63
|
"typescript": "^5.3.3"
|
|
60
64
|
}
|
|
61
|
-
}
|
|
65
|
+
}
|