light-h5-core-lib 2.8.1 → 2.8.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/LightCore.ts ADDED
@@ -0,0 +1,49 @@
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
+ import {BeizerUtil} from "./common/util/BeizerUtil";
10
+ import {MD5} from "./common/md5/MD5";
11
+ import PromiseUtil from "./common/util/PromiseUtil";
12
+ import Crc32Util from "./common/util/Crc32Util";
13
+ import {BooleanUtil} from "./common/util/BooleanUtil";
14
+ import {NumberUtil} from "./common/util/NumberUtil";
15
+ import {SelfDecrypt} from "./common/util/SelfDecrypt";
16
+
17
+ module.exports = {
18
+ PoolObj: PoolObj,
19
+ BaseSingleton: BaseSingleton,
20
+ MD5: MD5,
21
+ BitUtil: BitUtil,
22
+ DateUtil: DateUtil,
23
+ FloatDigitUtil: FloatDigitUtil,
24
+ RandomNumUtil: RandomNumUtil,
25
+ StringUtil: StringUtil,
26
+ UniqueIDUtil: UniqueIDUtil,
27
+ BeizerUtil: BeizerUtil,
28
+ PromiseUtil: PromiseUtil,
29
+ Crc32Util: Crc32Util,
30
+ BooleanUtil: BooleanUtil,
31
+ NumberUtil: NumberUtil,
32
+ SelfDecrypt: SelfDecrypt,
33
+ };
34
+
35
+ export {PoolObj};
36
+ export {BaseSingleton};
37
+ export {MD5};
38
+ export {BitUtil};
39
+ export {DateUtil};
40
+ export {FloatDigitUtil};
41
+ export {RandomNumUtil};
42
+ export {StringUtil};
43
+ export {UniqueIDUtil};
44
+ export {BeizerUtil};
45
+ export {PromiseUtil};
46
+ export {Crc32Util};
47
+ export {BooleanUtil};
48
+ export {NumberUtil};
49
+ export {SelfDecrypt};
@@ -0,0 +1,28 @@
1
+ import {IDestroy} from "./IDestroy";
2
+
3
+ /**
4
+ * 泛型单例基类
5
+ * @author Aonaufly
6
+ */
7
+ export abstract class BaseSingleton<T> implements IDestroy {
8
+ private static _instance: any = null;
9
+
10
+ public static getInstance<T>(c: { new(): T }): T {
11
+ if (this._instance == null) {
12
+ this._instance = new c();
13
+ this._instance.ctor();
14
+ }
15
+ return this._instance;
16
+ }
17
+
18
+ /**
19
+ * 相当于构造函数
20
+ */
21
+ protected ctor(): void {
22
+
23
+ }
24
+
25
+ public destroy(): void {
26
+ BaseSingleton._instance = null;
27
+ }
28
+ }
@@ -0,0 +1,5 @@
1
+ import { IDestroy } from "./IDestroy";
2
+
3
+ export interface IClear extends IDestroy {
4
+ clear(): void;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface IDestroy {
2
+ destroy(): void;
3
+ }