@xiaoguomeiyitian/core 1.0.7 → 1.0.9
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/lib_linux_20.jsc +0 -0
- package/dist/lib_linux_22.jsc +0 -0
- package/dist/lib_win32_20.jsc +0 -0
- package/dist/lib_win32_22.jsc +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +71 -1
package/dist/lib_linux_20.jsc
CHANGED
Binary file
|
package/dist/lib_linux_22.jsc
CHANGED
Binary file
|
package/dist/lib_win32_20.jsc
CHANGED
Binary file
|
package/dist/lib_win32_22.jsc
CHANGED
Binary file
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
@@ -1 +1,71 @@
|
|
1
|
-
export declare
|
1
|
+
export declare class Global {
|
2
|
+
constructor();
|
3
|
+
init(entityDefList: any, serviceProto: any, serviceProtoServer: any): Promise<void>;
|
4
|
+
loadByRedis(type: string, id: string): Promise<any>;
|
5
|
+
setToRedis(type: string, id: string, data: any): Promise<void>;
|
6
|
+
getRpc(type: string, serverUrl: string): any;
|
7
|
+
get(type: string, id?: string): any;
|
8
|
+
getByType(type: string): any[];
|
9
|
+
create(type: string, id?: string, cdata?: any): Promise<any>;
|
10
|
+
loadAllFile(source: any): void;
|
11
|
+
loadfile(filePath: string, reChain?: boolean, reload?: boolean): Promise<void>;
|
12
|
+
flushDumpData(): Promise<void>;
|
13
|
+
profiler(time?: number): void;
|
14
|
+
profilerGC(time?: number): void;
|
15
|
+
profilerHeap(password: string): void;
|
16
|
+
getPropType(type: string, prop: string): any;
|
17
|
+
getPropDefault(type: string, prop: string): any;
|
18
|
+
}
|
19
|
+
export declare class Entity {
|
20
|
+
type: string;/** 实体类型 */
|
21
|
+
id: string;/** 实体id */
|
22
|
+
constructor(type: string, id?: string);
|
23
|
+
/**获取属性类型 */
|
24
|
+
getPropType(prop: string): any;
|
25
|
+
/**获取未定义的数据默认值 */
|
26
|
+
getPropDefault(prop: string): any;
|
27
|
+
/**递归地设置对象中的值 */
|
28
|
+
setValueByPath(path: string[], value: any, type: any, ext: any): void;
|
29
|
+
/**递归地获取对象中的值 */
|
30
|
+
getValueByPath(path: string[]): any;
|
31
|
+
/**属性变化 */
|
32
|
+
propChange(prop: string, value: any, key?: string): Promise<void>;
|
33
|
+
/**创建 */
|
34
|
+
create(): Promise<void>;
|
35
|
+
/**实体同步到客户端 */
|
36
|
+
syncEntity(conns?: any[]): void;
|
37
|
+
/**写入数据库 */
|
38
|
+
flush(): Promise<void>;
|
39
|
+
/**销毁 */
|
40
|
+
destroy(): Promise<void>;
|
41
|
+
/**添加定时器 */
|
42
|
+
addOneLoop(funcName: Function, time: number): any;
|
43
|
+
/**清除定时器 */
|
44
|
+
clearOneLoop(timeId: number): void;
|
45
|
+
/**添加循环 */
|
46
|
+
addLoop(funcName: Function, time: number): any;
|
47
|
+
/**清除循环 */
|
48
|
+
clearLoop(timeId: number): void;
|
49
|
+
/**清除所有定时器 */
|
50
|
+
clearAllLoop(): void;
|
51
|
+
onCreate(): void;
|
52
|
+
onPropChange(prop: string, value: any): void;
|
53
|
+
onDestroy(): void;
|
54
|
+
}
|
55
|
+
export declare class RandomGenerator {
|
56
|
+
a: number;
|
57
|
+
c: number;
|
58
|
+
m: number;
|
59
|
+
seed: number; /** 随机种子 */
|
60
|
+
constructor(seed: number);
|
61
|
+
/** 快速幂算法计算 (a^n) % m */
|
62
|
+
fastPow(a: any, n: any, m: any): number;
|
63
|
+
/** 获取第n次的随机值 (0-1之间) */
|
64
|
+
getNthRandom(n: any): number;
|
65
|
+
/** 获取第n次的随机整数 [min, max] */
|
66
|
+
getNthRandomInt(n: any, min: any, max: any): number;
|
67
|
+
}
|
68
|
+
/** 拷贝文件或目录 */
|
69
|
+
export declare function copyDir(sourceDir: string, destDir: string): Promise<void>;
|
70
|
+
/** 删除文件或者目录 */
|
71
|
+
export declare function delFiles(dir: string, exts?: string[]): Promise<void>;
|