light-h5-core-lib 2.4.0 → 2.5.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/LightCore.js +24 -22
- package/package.json +1 -1
- package/type/index.d.ts +27 -38
package/LightCore.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { PoolObj } from "./pool/PoolObj";
|
|
2
|
-
import { BaseSingleton } from "./common/base/BaseSingleton";
|
|
3
|
-
import { BitUtil } from "./common/util/BitUtil";
|
|
4
|
-
import { DateUtil } from "./common/util/DateUtil";
|
|
5
|
-
import { FloatDigitUtil } from "./common/util/FloatDigitUtil";
|
|
6
|
-
import { RandomNumUtil } from "./common/util/RandomNumUtil";
|
|
7
|
-
import { StringUtil } from "./common/util/StringUtil";
|
|
8
|
-
import { UniqueIDUtil } from "./common/util/UniqueIDUtil";
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
1
|
+
import { PoolObj as corePoolObj } from "./pool/PoolObj";
|
|
2
|
+
import { BaseSingleton as coreBaseSingleton } from "./common/base/BaseSingleton";
|
|
3
|
+
import { BitUtil as coreBitUtil } from "./common/util/BitUtil";
|
|
4
|
+
import { DateUtil as coreDateUtil } from "./common/util/DateUtil";
|
|
5
|
+
import { FloatDigitUtil as coreFloatDigitUtil } from "./common/util/FloatDigitUtil";
|
|
6
|
+
import { RandomNumUtil as coreRandomNumUtil } from "./common/util/RandomNumUtil";
|
|
7
|
+
import { StringUtil as coreStringUtil } from "./common/util/StringUtil";
|
|
8
|
+
import { UniqueIDUtil as coreUniqueIDUtil } from "./common/util/UniqueIDUtil";
|
|
9
|
+
export var PoolObj = corePoolObj;
|
|
10
|
+
export var BaseSingleton = coreBaseSingleton;
|
|
11
|
+
export var BitUtil = coreBitUtil;
|
|
12
|
+
export var DateUtil = coreDateUtil;
|
|
13
|
+
export var FloatDigitUtil = coreFloatDigitUtil;
|
|
14
|
+
export var RandomNumUtil = coreRandomNumUtil;
|
|
15
|
+
export var StringUtil = coreStringUtil;
|
|
16
|
+
export var UniqueIDUtil = coreUniqueIDUtil;
|
|
17
|
+
// export { a };
|
|
18
|
+
// export { BaseSingleton };
|
|
19
|
+
// export { BitUtil };
|
|
20
|
+
// export { DateUtil };
|
|
21
|
+
// export { FloatDigitUtil };
|
|
22
|
+
// export { RandomNumUtil };
|
|
23
|
+
// export { StringUtil };
|
|
24
|
+
// export { UniqueIDUtil };
|
package/package.json
CHANGED
package/type/index.d.ts
CHANGED
|
@@ -6,11 +6,7 @@ export interface IDestroy {
|
|
|
6
6
|
export interface IClear extends IDestroy {
|
|
7
7
|
clear(): void;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* 对象池(泛型)
|
|
11
|
-
* @author aonaufly
|
|
12
|
-
*/
|
|
13
|
-
export declare class PoolObj<T> implements IClear {
|
|
9
|
+
declare class PoolObj<T> implements IClear {
|
|
14
10
|
private _pool;
|
|
15
11
|
private _cup;
|
|
16
12
|
/**
|
|
@@ -33,17 +29,13 @@ export declare class PoolObj<T> implements IClear {
|
|
|
33
29
|
clear(): void;
|
|
34
30
|
destroy(isCleared?: boolean): void;
|
|
35
31
|
}
|
|
36
|
-
|
|
32
|
+
declare class BaseSingleton<T> {
|
|
37
33
|
private static _instance;
|
|
38
34
|
static getInstance<T>(c: {
|
|
39
35
|
new (): T;
|
|
40
36
|
}): T;
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
* 位操作工具(从右向左←)
|
|
44
|
-
* @author aonaufly
|
|
45
|
-
*/
|
|
46
|
-
export declare class BitUtil {
|
|
38
|
+
declare class BitUtil {
|
|
47
39
|
/**
|
|
48
40
|
* 读取uint类型某位的值, bit从1开始
|
|
49
41
|
*/
|
|
@@ -56,11 +48,7 @@ export declare class BitUtil {
|
|
|
56
48
|
/**获取1的个数 */
|
|
57
49
|
static get1num(value: number): number;
|
|
58
50
|
}
|
|
59
|
-
|
|
60
|
-
* 日期(时间)工具
|
|
61
|
-
* @author aonaufly
|
|
62
|
-
*/
|
|
63
|
-
export declare class DateUtil {
|
|
51
|
+
declare class DateUtil {
|
|
64
52
|
/**
|
|
65
53
|
* 获取指定时间的时间戳 (单位:ms)
|
|
66
54
|
* @param date 如: "2020-3-14 11:30:30"
|
|
@@ -102,11 +90,7 @@ export declare class DateUtil {
|
|
|
102
90
|
*/
|
|
103
91
|
static getTodayAppointTimeStamp(nowSecond: number, hour: number, minute?: number, second?: number, millisecond?: number): number;
|
|
104
92
|
}
|
|
105
|
-
|
|
106
|
-
* Float精度
|
|
107
|
-
* @author aonaufly
|
|
108
|
-
*/
|
|
109
|
-
export declare class FloatDigitUtil {
|
|
93
|
+
declare class FloatDigitUtil {
|
|
110
94
|
/**
|
|
111
95
|
* 确定小数的精度<b style="color:red">2个小数相加会有精度错误</b>
|
|
112
96
|
* @param fNum 小数
|
|
@@ -114,11 +98,7 @@ export declare class FloatDigitUtil {
|
|
|
114
98
|
*/
|
|
115
99
|
static formatFloat(fNum: number, digit: number): number;
|
|
116
100
|
}
|
|
117
|
-
|
|
118
|
-
* 随机数生成工具
|
|
119
|
-
* @author aonaufly
|
|
120
|
-
*/
|
|
121
|
-
export declare class RandomNumUtil {
|
|
101
|
+
declare class RandomNumUtil {
|
|
122
102
|
/**
|
|
123
103
|
* 获取一定方位的随机整数
|
|
124
104
|
*
|
|
@@ -130,11 +110,7 @@ export declare class RandomNumUtil {
|
|
|
130
110
|
*/
|
|
131
111
|
static randomNumBoth(min: number, max: number, isInt?: boolean): number;
|
|
132
112
|
}
|
|
133
|
-
|
|
134
|
-
* 字符串工具
|
|
135
|
-
* @author aonaufly
|
|
136
|
-
*/
|
|
137
|
-
export declare class StringUtil {
|
|
113
|
+
declare class StringUtil {
|
|
138
114
|
/**
|
|
139
115
|
* 字符串的格式化 , 使用 {index = 0}的模式
|
|
140
116
|
* @param str 源字符串
|
|
@@ -149,17 +125,30 @@ export declare class StringUtil {
|
|
|
149
125
|
static string2UTF8Buffer(str: string): ArrayBuffer;
|
|
150
126
|
static buffer2UTF8String: (buffer: ArrayBuffer) => string;
|
|
151
127
|
}
|
|
152
|
-
|
|
153
|
-
* 唯一ID生成器
|
|
154
|
-
* @author Aonaufly
|
|
155
|
-
*/
|
|
156
|
-
export declare class UniqueIDUtil {
|
|
128
|
+
declare class UniqueIDUtil {
|
|
157
129
|
/**生成唯一ID值*/
|
|
158
130
|
static getUniqueId(): string;
|
|
159
131
|
/**生成复合的Key值*/
|
|
160
132
|
static getCompositeKey(key: string | number, uniqueId: string): string;
|
|
161
133
|
}
|
|
162
|
-
|
|
163
|
-
|
|
134
|
+
declare const PoolObj$1: typeof PoolObj;
|
|
135
|
+
declare const BaseSingleton$1: typeof BaseSingleton;
|
|
136
|
+
declare const BitUtil$1: typeof BitUtil;
|
|
137
|
+
declare const DateUtil$1: typeof DateUtil;
|
|
138
|
+
declare const FloatDigitUtil$1: typeof FloatDigitUtil;
|
|
139
|
+
declare const RandomNumUtil$1: typeof RandomNumUtil;
|
|
140
|
+
declare const StringUtil$1: typeof StringUtil;
|
|
141
|
+
declare const UniqueIDUtil$1: typeof UniqueIDUtil;
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
BaseSingleton$1 as BaseSingleton,
|
|
145
|
+
BitUtil$1 as BitUtil,
|
|
146
|
+
DateUtil$1 as DateUtil,
|
|
147
|
+
FloatDigitUtil$1 as FloatDigitUtil,
|
|
148
|
+
PoolObj$1 as PoolObj,
|
|
149
|
+
RandomNumUtil$1 as RandomNumUtil,
|
|
150
|
+
StringUtil$1 as StringUtil,
|
|
151
|
+
UniqueIDUtil$1 as UniqueIDUtil,
|
|
152
|
+
};
|
|
164
153
|
|
|
165
154
|
export {};
|