@cybermp-community/client-types 2.4.0 → 2.4.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/dist/classes.d.ts
CHANGED
|
@@ -132736,6 +132736,7 @@ export class redResourceReferenceScriptToken<T = any> {
|
|
|
132736
132736
|
static FromName(path: string): redResourceReferenceScriptToken;
|
|
132737
132737
|
static FromString(path: string): redResourceReferenceScriptToken;
|
|
132738
132738
|
static IsValid(path: redResourceReferenceScriptToken): boolean;
|
|
132739
|
+
static IsValid(path: string): boolean;
|
|
132739
132740
|
}
|
|
132740
132741
|
|
|
132741
132742
|
export class redStageMessage {
|
|
@@ -142669,6 +142670,7 @@ export type ResRef<T = any> = T & {
|
|
|
142669
142670
|
export namespace ResRef {
|
|
142670
142671
|
export function FromVariant(variant: any): ResRef;
|
|
142671
142672
|
export function FromPath(path: ResRef): ResRef;
|
|
142673
|
+
export function IsValid(path: ResRef | string): boolean;
|
|
142672
142674
|
}
|
|
142673
142675
|
|
|
142674
142676
|
export type ResAsyncRef<T = any> = T & {
|
|
@@ -1,37 +1,46 @@
|
|
|
1
|
-
import type { MpClasses } from
|
|
2
|
-
import type * as
|
|
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";
|
|
3
5
|
|
|
4
6
|
export class LoadingScreenSystem {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
GetLoadingScreenState(): E.ELoadingScreenState;
|
|
8
|
+
GetLoadingScreenProgress(): number;
|
|
9
|
+
OnLoadingScreenStateChange(newState: E.ELoadingScreenState): void;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export class MultiplayerSystem {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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;
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
SetDefaultSpawnPosition(position: C.Vector3, yaw: number): void;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
declare module
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
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,5 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
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 {
|
|
3
|
-
import type
|
|
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
|
|
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(
|
|
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
|
-
|