@aitianyu.cn/types 0.0.13 → 0.1.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/lib/{utilities/coding → coding}/Error.js +44 -44
- package/dist/lib/{utilities/coding → coding}/Path.js +210 -198
- package/dist/lib/{utilities/core → core}/Errors.js +86 -86
- package/dist/lib/{utilities/core → core}/Language.js +561 -559
- package/dist/lib/{utilities/core → core}/Log.js +112 -108
- package/dist/lib/{utilities/core → core}/TypeConvertion.js +25 -25
- package/dist/lib/{utilities/core → core}/interface/ITJSON.js +3 -3
- package/dist/lib/{utilities/core → core}/interface/ITianyuType.js +3 -3
- package/dist/lib/{utilities/core → core}/object/ArrayHelper.js +35 -35
- package/dist/lib/core/object/Bytes.js +21 -0
- package/dist/lib/{utilities/core → core}/object/Calculater.js +240 -230
- package/dist/lib/core/object/DataView.js +23 -0
- package/dist/lib/core/object/Integer.js +117 -0
- package/dist/lib/core/object/Json.js +35 -0
- package/dist/lib/{utilities/core/object/Helper.js → core/object/ObjectHelper.js} +202 -201
- package/dist/lib/core/object/StringHelper.js +61 -0
- package/dist/lib/{utilities/core → core}/type/TArray.js +8 -7
- package/dist/lib/{utilities/core → core}/type/TBoolean.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TJSON.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TNumber.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TObject.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TString.js +7 -7
- package/dist/lib/index.js +70 -54
- package/dist/lib/security/Base32.js +104 -0
- package/dist/lib/security/Guid.js +26 -0
- package/dist/lib/{utilities/security → security}/Hash.js +16 -15
- package/dist/lib/security/QRCode.js +46 -0
- package/dist/lib/security/RSA.js +62 -0
- package/dist/lib/security/SHA.js +67 -0
- package/dist/lib/types/AreaCode.js +269 -269
- package/dist/lib/types/Exception.js +19 -19
- package/dist/lib/types/Logs.js +20 -20
- package/dist/lib/types/Object.js +3 -3
- package/dist/lib/types/PathBase.js +109 -109
- package/dist/lib/types/Security.js +10 -10
- package/dist/lib/types/TMap.js +139 -138
- package/dist/lib/types/Types.js +3 -3
- package/dist/lib/types/index.js +17 -17
- package/dist/types/{utilities/coding → coding}/Error.d.ts +27 -27
- package/dist/types/{utilities/coding → coding}/Path.d.ts +61 -61
- package/dist/types/{utilities/core → core}/Errors.d.ts +47 -47
- package/dist/types/{utilities/core → core}/Language.d.ts +17 -17
- package/dist/types/{utilities/core → core}/Log.d.ts +12 -12
- package/dist/types/{utilities/core → core}/TypeConvertion.d.ts +2 -2
- package/dist/types/{utilities/core → core}/interface/ITJSON.d.ts +5 -5
- package/dist/types/{utilities/core → core}/interface/ITianyuType.d.ts +5 -5
- package/dist/types/{utilities/core → core}/object/ArrayHelper.d.ts +11 -11
- package/dist/types/core/object/Bytes.d.ts +13 -0
- package/dist/types/{utilities/core → core}/object/Calculater.d.ts +22 -22
- package/dist/types/core/object/DataView.d.ts +11 -0
- package/dist/types/core/object/Integer.d.ts +71 -0
- package/dist/types/core/object/Json.d.ts +22 -0
- package/dist/types/{utilities/core/object/Helper.d.ts → core/object/ObjectHelper.d.ts} +39 -39
- package/dist/types/core/object/StringHelper.d.ts +21 -0
- package/dist/types/{utilities/core → core}/type/TArray.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TBoolean.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TJSON.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TNumber.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TObject.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TString.d.ts +3 -3
- package/dist/types/index.d.ts +29 -21
- package/dist/types/security/Base32.d.ts +42 -0
- package/dist/types/security/Guid.d.ts +4 -0
- package/dist/types/{utilities/security → security}/Hash.d.ts +3 -3
- package/dist/types/security/QRCode.d.ts +11 -0
- package/dist/types/security/RSA.d.ts +68 -0
- package/dist/types/security/SHA.d.ts +40 -0
- package/dist/types/types/AreaCode.d.ts +135 -135
- package/dist/types/types/Exception.d.ts +11 -11
- package/dist/types/types/Logs.d.ts +64 -64
- package/dist/types/types/Object.d.ts +18 -18
- package/dist/types/types/PathBase.d.ts +76 -76
- package/dist/types/types/Security.d.ts +23 -23
- package/dist/types/types/TMap.d.ts +80 -80
- package/dist/types/types/Types.d.ts +25 -25
- package/dist/types/types/index.d.ts +9 -9
- package/package.json +57 -51
- package/dist/lib/utilities/coding/index.js +0 -10
- package/dist/lib/utilities/core/index.js +0 -21
- package/dist/lib/utilities/core/object/StringHelper.js +0 -22
- package/dist/lib/utilities/security/Guid.js +0 -20
- package/dist/lib/utilities/security/index.js +0 -8
- package/dist/types/utilities/coding/index.d.ts +0 -3
- package/dist/types/utilities/core/index.d.ts +0 -6
- package/dist/types/utilities/core/object/StringHelper.d.ts +0 -4
- package/dist/types/utilities/security/Guid.d.ts +0 -3
- package/dist/types/utilities/security/index.d.ts +0 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
/**@format */
|
|
2
|
-
export { AreaCode } from "./types/AreaCode";
|
|
3
|
-
export { Exception } from "./types/Exception";
|
|
4
|
-
export { LogLevel, type ILog, type IPerfRecorder } from "./types/Logs";
|
|
5
|
-
export { type IObjectDiffInfo, type ObjectDiffMap } from "./types/Object";
|
|
6
|
-
export { PathBase } from "./types/PathBase";
|
|
7
|
-
export { EncryptOption, type ICipher } from "./types/Security";
|
|
8
|
-
export { TMap } from "./types/TMap";
|
|
9
|
-
export { type MapOfBoolean, type MapOfStrings, type MapOfString, type MapOfType, type CallbackAction, type CallbackActionT, type IComparable, type KeyValuePair, } from "./types/Types";
|
|
10
|
-
export { PathProcessorSourceLostException, PathDirectoryValidationFailException, PathDirAndFileConvertInvaild, } from "./
|
|
11
|
-
export { type PathTargetType, Path } from "./
|
|
12
|
-
export { ArgumentNullOrEmptyException, ObjectCloneFunctionNotSupportException, ObjectMergeStatusCheckFailedException, ObjectDiffApplyInvalidStatusException, ObjectDiffMergeFailedException, } from "./
|
|
13
|
-
export { parseAreaCode, parseAreaString } from "./
|
|
14
|
-
export { Log, Performance } from "./
|
|
15
|
-
export { getBoolean } from "./
|
|
16
|
-
export { ObjectCalculater } from "./
|
|
17
|
-
export { ObjectHelper } from "./
|
|
18
|
-
export { ArrayHelper } from "./
|
|
19
|
-
export { StringHelper } from "./
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
1
|
+
/**@format */
|
|
2
|
+
export { AreaCode } from "./types/AreaCode";
|
|
3
|
+
export { Exception } from "./types/Exception";
|
|
4
|
+
export { LogLevel, type ILog, type IPerfRecorder } from "./types/Logs";
|
|
5
|
+
export { type IObjectDiffInfo, type ObjectDiffMap } from "./types/Object";
|
|
6
|
+
export { PathBase } from "./types/PathBase";
|
|
7
|
+
export { EncryptOption, type ICipher } from "./types/Security";
|
|
8
|
+
export { TMap } from "./types/TMap";
|
|
9
|
+
export { type MapOfBoolean, type MapOfStrings, type MapOfString, type MapOfType, type CallbackAction, type CallbackActionT, type IComparable, type KeyValuePair, } from "./types/Types";
|
|
10
|
+
export { PathProcessorSourceLostException, PathDirectoryValidationFailException, PathDirAndFileConvertInvaild, } from "./coding/Error";
|
|
11
|
+
export { type PathTargetType, Path } from "./coding/Path";
|
|
12
|
+
export { ArgumentNullOrEmptyException, ObjectCloneFunctionNotSupportException, ObjectMergeStatusCheckFailedException, ObjectDiffApplyInvalidStatusException, ObjectDiffMergeFailedException, } from "./core/Errors";
|
|
13
|
+
export { parseAreaCode, parseAreaString } from "./core/Language";
|
|
14
|
+
export { Log, Performance } from "./core/Log";
|
|
15
|
+
export { getBoolean } from "./core/TypeConvertion";
|
|
16
|
+
export { ObjectCalculater } from "./core/object/Calculater";
|
|
17
|
+
export { ObjectHelper } from "./core/object/ObjectHelper";
|
|
18
|
+
export { ArrayHelper } from "./core/object/ArrayHelper";
|
|
19
|
+
export { StringHelper } from "./core/object/StringHelper";
|
|
20
|
+
export { Bytes } from "./core/object/Bytes";
|
|
21
|
+
export { DataView } from "./core/object/DataView";
|
|
22
|
+
export { Integer } from "./core/object/Integer";
|
|
23
|
+
export { Json } from "./core/object/Json";
|
|
24
|
+
export { Base32 } from "./security/Base32";
|
|
25
|
+
export { guid } from "./security/Guid";
|
|
26
|
+
export { hash } from "./security/Hash";
|
|
27
|
+
export { QRCode } from "./security/QRCode";
|
|
28
|
+
export { RSA } from "./security/RSA";
|
|
29
|
+
export { SHA } from "./security/SHA";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Base32 Encoding Type
|
|
4
|
+
*
|
|
5
|
+
* @field RFC3548
|
|
6
|
+
* @field RFC4648
|
|
7
|
+
* @field RFC4648-HEX
|
|
8
|
+
* @field Crockford
|
|
9
|
+
*/
|
|
10
|
+
export type EncodingType = "RFC3548" | "RFC4648" | "RFC4648-HEX" | "Crockford";
|
|
11
|
+
/** Base32 Encoding Lib */
|
|
12
|
+
export declare class Base32 {
|
|
13
|
+
private static RFC4648_CHS;
|
|
14
|
+
private static RFC4648_HEX_CHS;
|
|
15
|
+
private static CROCKFORD_CHS;
|
|
16
|
+
/**
|
|
17
|
+
* To encode the buffer to be a Base32 encoded string
|
|
18
|
+
*
|
|
19
|
+
* @param data input source buffer
|
|
20
|
+
* @param encoding encoding type
|
|
21
|
+
* @returns return the encoded string
|
|
22
|
+
*/
|
|
23
|
+
static encode(data: ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray, encoding: EncodingType): string;
|
|
24
|
+
/**
|
|
25
|
+
* Decode the input string to be an array buffer
|
|
26
|
+
*
|
|
27
|
+
* @param input source string
|
|
28
|
+
* @param encoding encoding type
|
|
29
|
+
* @returns return the target array buffer
|
|
30
|
+
*/
|
|
31
|
+
static decode(input: string, encoding: EncodingType): ArrayBuffer;
|
|
32
|
+
/**
|
|
33
|
+
* Get a random string which is encoded by given encoding type
|
|
34
|
+
*
|
|
35
|
+
* @param size random bytes size
|
|
36
|
+
* @param encoding encoding type
|
|
37
|
+
* @returns return encoded random string
|
|
38
|
+
*/
|
|
39
|
+
static random(size: number, encoding?: EncodingType): string;
|
|
40
|
+
private static getAlphabet;
|
|
41
|
+
private static readChar;
|
|
42
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/**@format */
|
|
2
|
-
/** Generate a hash code number of the string */
|
|
3
|
-
export declare function hash(source: string): number;
|
|
1
|
+
/**@format */
|
|
2
|
+
/** Generate a hash code number of the string */
|
|
3
|
+
export declare function hash(source: string): number;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import { RSAKeyPairOptions } from "crypto";
|
|
6
|
+
/**
|
|
7
|
+
* RSA Key formatting type
|
|
8
|
+
*
|
|
9
|
+
* @field pem string formatting key
|
|
10
|
+
* @field der buffer data key
|
|
11
|
+
*/
|
|
12
|
+
export type RSAKeyFormatType = "pem" | "der";
|
|
13
|
+
/** RSA key generation Map */
|
|
14
|
+
export interface RSAKeyGenerationMap {
|
|
15
|
+
pem: string;
|
|
16
|
+
der: Buffer;
|
|
17
|
+
}
|
|
18
|
+
/** RSA Key generation return type */
|
|
19
|
+
export type RSAKeyGenerationReturnType<K extends RSAKeyFormatType> = RSAKeyGenerationMap[K];
|
|
20
|
+
/** RSA Generation result */
|
|
21
|
+
export interface RSAGenerationResult<priKey extends RSAKeyFormatType, pubKey extends RSAKeyFormatType> {
|
|
22
|
+
/** RSA private key */
|
|
23
|
+
privateKey: RSAKeyGenerationReturnType<priKey>;
|
|
24
|
+
/** RSA public key */
|
|
25
|
+
publicKey: RSAKeyGenerationReturnType<pubKey>;
|
|
26
|
+
}
|
|
27
|
+
/** RSA Lib */
|
|
28
|
+
export declare class RSA {
|
|
29
|
+
/**
|
|
30
|
+
* To get a new RSA public key and private key
|
|
31
|
+
*
|
|
32
|
+
* @param options RSA key generation option
|
|
33
|
+
* @returns return new RSA key
|
|
34
|
+
*/
|
|
35
|
+
static new<priKey extends RSAKeyFormatType = "pem", pubKey extends RSAKeyFormatType = "pem">(options: RSAKeyPairOptions<priKey, pubKey>): RSAGenerationResult<priKey, pubKey>;
|
|
36
|
+
/**
|
|
37
|
+
* To encode a value with public key, the encoded data can be decoded by private key
|
|
38
|
+
*
|
|
39
|
+
* @param data input data
|
|
40
|
+
* @param publicKey encoding public key
|
|
41
|
+
* @returns return encoded buffer
|
|
42
|
+
*/
|
|
43
|
+
static encodepub(data: globalThis.DataView, publicKey: string | Buffer): Buffer;
|
|
44
|
+
/**
|
|
45
|
+
* To encode a value with private key, the encoded data can be decoded by public key
|
|
46
|
+
*
|
|
47
|
+
* @param data input data
|
|
48
|
+
* @param publicKey encoding private key
|
|
49
|
+
* @returns return encoded buffer
|
|
50
|
+
*/
|
|
51
|
+
static encodepri(data: globalThis.DataView, privateKey: string | Buffer): Buffer;
|
|
52
|
+
/**
|
|
53
|
+
* To decode a value with public key, the value is encoded by private key
|
|
54
|
+
*
|
|
55
|
+
* @param data input data
|
|
56
|
+
* @param publicKey decoding public key
|
|
57
|
+
* @returns return decoded buffer
|
|
58
|
+
*/
|
|
59
|
+
static decodepub(data: globalThis.DataView, publicKey: string | Buffer): Buffer;
|
|
60
|
+
/**
|
|
61
|
+
* To decode a value with private key, the value is encoded by public key
|
|
62
|
+
*
|
|
63
|
+
* @param data input data
|
|
64
|
+
* @param privateKey decoding private key
|
|
65
|
+
* @returns return decoded buffer
|
|
66
|
+
*/
|
|
67
|
+
static decodepri(data: globalThis.DataView, privateKey: string | Buffer): Buffer;
|
|
68
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import Stream from "stream";
|
|
6
|
+
/** SHA Lib */
|
|
7
|
+
export declare class SHA {
|
|
8
|
+
/**
|
|
9
|
+
* Calculate SHA256 code of data based on specified string encoding.
|
|
10
|
+
*
|
|
11
|
+
* @param data source data
|
|
12
|
+
* @param encoding string encoding type, default encoding type is 'utf-8', only used when data type is string
|
|
13
|
+
* @returns return the SHA256 code buffer
|
|
14
|
+
*/
|
|
15
|
+
static sha256(data: string | Buffer, encoding?: NodeJS.BufferEncoding): Buffer;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate SHA512 code of data based on specified string encoding.
|
|
18
|
+
*
|
|
19
|
+
* @param data source data
|
|
20
|
+
* @param encoding string encoding type, default encoding type is 'utf-8', only used when data type is string
|
|
21
|
+
* @returns return the SHA256 code buffer
|
|
22
|
+
*/
|
|
23
|
+
static sha512(data: string | Buffer, encoding?: NodeJS.BufferEncoding): Buffer;
|
|
24
|
+
private static sha;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate SHA256 code of data based on a stream
|
|
27
|
+
*
|
|
28
|
+
* @param stream data stream
|
|
29
|
+
* @returns return the encoded buffer
|
|
30
|
+
*/
|
|
31
|
+
static stream256(stream: Stream): Promise<Buffer>;
|
|
32
|
+
/**
|
|
33
|
+
* Calculate SHA512 code of data based on a stream
|
|
34
|
+
*
|
|
35
|
+
* @param stream data stream
|
|
36
|
+
* @returns return the encoded buffer
|
|
37
|
+
*/
|
|
38
|
+
static stream512(stream: Stream): Promise<Buffer>;
|
|
39
|
+
private static streamSHA;
|
|
40
|
+
}
|
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
/**@format */
|
|
2
|
-
/** International Area name and its code */
|
|
3
|
-
export declare enum AreaCode {
|
|
4
|
-
unknown = 0,
|
|
5
|
-
af_ZA = 1078,
|
|
6
|
-
sq_AL = 1052,
|
|
7
|
-
am_AM = 1118,
|
|
8
|
-
ar_DZ = 5121,
|
|
9
|
-
ar_BH = 15361,
|
|
10
|
-
ar_EG = 3073,
|
|
11
|
-
ar_IQ = 2049,
|
|
12
|
-
ar_JO = 11265,
|
|
13
|
-
ar_KW = 13313,
|
|
14
|
-
ar_LB = 12289,
|
|
15
|
-
ar_LY = 4097,
|
|
16
|
-
ar_MA = 6145,
|
|
17
|
-
ar_OM = 8193,
|
|
18
|
-
ar_QA = 16385,
|
|
19
|
-
ar_SA = 1025,
|
|
20
|
-
ar_SY = 10241,
|
|
21
|
-
ar_TN = 7169,
|
|
22
|
-
ar_AE = 14337,
|
|
23
|
-
ar_YE = 9217,
|
|
24
|
-
hy_AM = 1067,
|
|
25
|
-
as_AS = 1101,
|
|
26
|
-
az_AZ_Cyrl = 2092,
|
|
27
|
-
az_AZ_Latn = 2093,
|
|
28
|
-
eu_ES = 1069,
|
|
29
|
-
be_BY = 1059,
|
|
30
|
-
bg_BG = 1026,
|
|
31
|
-
ca_ES = 1027,
|
|
32
|
-
zh_HK = 3076,
|
|
33
|
-
zh_MO = 5124,
|
|
34
|
-
zh_CN = 2052,
|
|
35
|
-
zh_SG = 4100,
|
|
36
|
-
zh_TW = 1028,
|
|
37
|
-
hr_HR = 1050,
|
|
38
|
-
cd_CZ = 1029,
|
|
39
|
-
da_DK = 1030,
|
|
40
|
-
nl_BE = 2067,
|
|
41
|
-
nl_NL = 1043,
|
|
42
|
-
en_AU = 3081,
|
|
43
|
-
en_BZ = 10249,
|
|
44
|
-
en_CA = 4105,
|
|
45
|
-
en_CB = 9225,
|
|
46
|
-
en_IE = 6153,
|
|
47
|
-
en_IN = 16393,
|
|
48
|
-
en_JM = 8201,
|
|
49
|
-
en_NZ = 5129,
|
|
50
|
-
en_PH = 13321,
|
|
51
|
-
en_ZA = 7177,
|
|
52
|
-
en_TT = 11273,
|
|
53
|
-
en_ZW = 12297,
|
|
54
|
-
en_US = 1033,
|
|
55
|
-
en_UK = 2057,
|
|
56
|
-
et_EE = 1061,
|
|
57
|
-
fo_FO = 1080,
|
|
58
|
-
fi_FI = 1035,
|
|
59
|
-
fr_BE = 2060,
|
|
60
|
-
fr_CA = 11276,
|
|
61
|
-
fr_FR = 1036,
|
|
62
|
-
fr_LU = 5132,
|
|
63
|
-
fr_MC = 6156,
|
|
64
|
-
fr_CH = 4108,
|
|
65
|
-
gl_ES = 1110,
|
|
66
|
-
de_AT = 3079,
|
|
67
|
-
de_DE = 1031,
|
|
68
|
-
de_LI = 5127,
|
|
69
|
-
de_LU = 4103,
|
|
70
|
-
de_CH = 2055,
|
|
71
|
-
gu_IN = 1095,
|
|
72
|
-
he_IL = 1037,
|
|
73
|
-
hi_IN = 1081,
|
|
74
|
-
hu_HU = 1038,
|
|
75
|
-
is_IS = 1039,
|
|
76
|
-
id_ID = 1057,
|
|
77
|
-
it_IT = 1040,
|
|
78
|
-
it_CH = 2064,
|
|
79
|
-
ja_JP = 1041,
|
|
80
|
-
kn_IN = 1099,
|
|
81
|
-
kk_KZ = 1087,
|
|
82
|
-
ko_KR = 1042,
|
|
83
|
-
ky_KZ = 1088,
|
|
84
|
-
lv_LV = 1062,
|
|
85
|
-
lt_LT = 1063,
|
|
86
|
-
ms_BN = 2110,
|
|
87
|
-
ms_MY = 1086,
|
|
88
|
-
mr_IN = 1102,
|
|
89
|
-
mn_MN = 2128,
|
|
90
|
-
nb_NO = 1044,
|
|
91
|
-
nn_NO = 2068,
|
|
92
|
-
pl_PL = 1045,
|
|
93
|
-
pt_BR = 1046,
|
|
94
|
-
pt_PT = 2070,
|
|
95
|
-
pa_IN = 1094,
|
|
96
|
-
ro_MO = 2072,
|
|
97
|
-
ro_RO = 1048,
|
|
98
|
-
ru_RU = 1049,
|
|
99
|
-
ru_MO = 2073,
|
|
100
|
-
sa_IN = 1103,
|
|
101
|
-
sr_SP_Cyrl = 3098,
|
|
102
|
-
sr_SP_Latn = 2074,
|
|
103
|
-
sk_SK = 1051,
|
|
104
|
-
sl_SI = 1060,
|
|
105
|
-
es_AR = 11274,
|
|
106
|
-
es_BO = 16394,
|
|
107
|
-
es_CL = 13322,
|
|
108
|
-
es_CO = 9226,
|
|
109
|
-
es_CR = 5130,
|
|
110
|
-
es_DO = 7178,
|
|
111
|
-
es_EC = 12298,
|
|
112
|
-
es_SV = 17418,
|
|
113
|
-
es_GT = 4106,
|
|
114
|
-
es_HN = 18442,
|
|
115
|
-
es_MX = 2058,
|
|
116
|
-
es_NI = 19466,
|
|
117
|
-
es_PA = 6154,
|
|
118
|
-
es_PY = 15370,
|
|
119
|
-
es_PE = 10250,
|
|
120
|
-
es_PR = 20490,
|
|
121
|
-
es_ES = 1034,
|
|
122
|
-
es_UY = 14346,
|
|
123
|
-
es_VE = 8202,
|
|
124
|
-
sw_KE = 1089,
|
|
125
|
-
sv_FI = 2077,
|
|
126
|
-
sv_SE = 1053,
|
|
127
|
-
ta_IN = 1097,
|
|
128
|
-
tt_RU = 1092,
|
|
129
|
-
te_IN = 1098,
|
|
130
|
-
th_TH = 1054,
|
|
131
|
-
tr_TR = 1055,
|
|
132
|
-
uz_UZ_Cyrl = 2115,
|
|
133
|
-
uz_UZ_Latn = 1091,
|
|
134
|
-
vi_VN = 1066
|
|
135
|
-
}
|
|
1
|
+
/**@format */
|
|
2
|
+
/** International Area name and its code */
|
|
3
|
+
export declare enum AreaCode {
|
|
4
|
+
unknown = 0,
|
|
5
|
+
af_ZA = 1078,
|
|
6
|
+
sq_AL = 1052,
|
|
7
|
+
am_AM = 1118,
|
|
8
|
+
ar_DZ = 5121,
|
|
9
|
+
ar_BH = 15361,
|
|
10
|
+
ar_EG = 3073,
|
|
11
|
+
ar_IQ = 2049,
|
|
12
|
+
ar_JO = 11265,
|
|
13
|
+
ar_KW = 13313,
|
|
14
|
+
ar_LB = 12289,
|
|
15
|
+
ar_LY = 4097,
|
|
16
|
+
ar_MA = 6145,
|
|
17
|
+
ar_OM = 8193,
|
|
18
|
+
ar_QA = 16385,
|
|
19
|
+
ar_SA = 1025,
|
|
20
|
+
ar_SY = 10241,
|
|
21
|
+
ar_TN = 7169,
|
|
22
|
+
ar_AE = 14337,
|
|
23
|
+
ar_YE = 9217,
|
|
24
|
+
hy_AM = 1067,
|
|
25
|
+
as_AS = 1101,
|
|
26
|
+
az_AZ_Cyrl = 2092,
|
|
27
|
+
az_AZ_Latn = 2093,
|
|
28
|
+
eu_ES = 1069,
|
|
29
|
+
be_BY = 1059,
|
|
30
|
+
bg_BG = 1026,
|
|
31
|
+
ca_ES = 1027,
|
|
32
|
+
zh_HK = 3076,
|
|
33
|
+
zh_MO = 5124,
|
|
34
|
+
zh_CN = 2052,
|
|
35
|
+
zh_SG = 4100,
|
|
36
|
+
zh_TW = 1028,
|
|
37
|
+
hr_HR = 1050,
|
|
38
|
+
cd_CZ = 1029,
|
|
39
|
+
da_DK = 1030,
|
|
40
|
+
nl_BE = 2067,
|
|
41
|
+
nl_NL = 1043,
|
|
42
|
+
en_AU = 3081,
|
|
43
|
+
en_BZ = 10249,
|
|
44
|
+
en_CA = 4105,
|
|
45
|
+
en_CB = 9225,
|
|
46
|
+
en_IE = 6153,
|
|
47
|
+
en_IN = 16393,
|
|
48
|
+
en_JM = 8201,
|
|
49
|
+
en_NZ = 5129,
|
|
50
|
+
en_PH = 13321,
|
|
51
|
+
en_ZA = 7177,
|
|
52
|
+
en_TT = 11273,
|
|
53
|
+
en_ZW = 12297,
|
|
54
|
+
en_US = 1033,
|
|
55
|
+
en_UK = 2057,
|
|
56
|
+
et_EE = 1061,
|
|
57
|
+
fo_FO = 1080,
|
|
58
|
+
fi_FI = 1035,
|
|
59
|
+
fr_BE = 2060,
|
|
60
|
+
fr_CA = 11276,
|
|
61
|
+
fr_FR = 1036,
|
|
62
|
+
fr_LU = 5132,
|
|
63
|
+
fr_MC = 6156,
|
|
64
|
+
fr_CH = 4108,
|
|
65
|
+
gl_ES = 1110,
|
|
66
|
+
de_AT = 3079,
|
|
67
|
+
de_DE = 1031,
|
|
68
|
+
de_LI = 5127,
|
|
69
|
+
de_LU = 4103,
|
|
70
|
+
de_CH = 2055,
|
|
71
|
+
gu_IN = 1095,
|
|
72
|
+
he_IL = 1037,
|
|
73
|
+
hi_IN = 1081,
|
|
74
|
+
hu_HU = 1038,
|
|
75
|
+
is_IS = 1039,
|
|
76
|
+
id_ID = 1057,
|
|
77
|
+
it_IT = 1040,
|
|
78
|
+
it_CH = 2064,
|
|
79
|
+
ja_JP = 1041,
|
|
80
|
+
kn_IN = 1099,
|
|
81
|
+
kk_KZ = 1087,
|
|
82
|
+
ko_KR = 1042,
|
|
83
|
+
ky_KZ = 1088,
|
|
84
|
+
lv_LV = 1062,
|
|
85
|
+
lt_LT = 1063,
|
|
86
|
+
ms_BN = 2110,
|
|
87
|
+
ms_MY = 1086,
|
|
88
|
+
mr_IN = 1102,
|
|
89
|
+
mn_MN = 2128,
|
|
90
|
+
nb_NO = 1044,
|
|
91
|
+
nn_NO = 2068,
|
|
92
|
+
pl_PL = 1045,
|
|
93
|
+
pt_BR = 1046,
|
|
94
|
+
pt_PT = 2070,
|
|
95
|
+
pa_IN = 1094,
|
|
96
|
+
ro_MO = 2072,
|
|
97
|
+
ro_RO = 1048,
|
|
98
|
+
ru_RU = 1049,
|
|
99
|
+
ru_MO = 2073,
|
|
100
|
+
sa_IN = 1103,
|
|
101
|
+
sr_SP_Cyrl = 3098,
|
|
102
|
+
sr_SP_Latn = 2074,
|
|
103
|
+
sk_SK = 1051,
|
|
104
|
+
sl_SI = 1060,
|
|
105
|
+
es_AR = 11274,
|
|
106
|
+
es_BO = 16394,
|
|
107
|
+
es_CL = 13322,
|
|
108
|
+
es_CO = 9226,
|
|
109
|
+
es_CR = 5130,
|
|
110
|
+
es_DO = 7178,
|
|
111
|
+
es_EC = 12298,
|
|
112
|
+
es_SV = 17418,
|
|
113
|
+
es_GT = 4106,
|
|
114
|
+
es_HN = 18442,
|
|
115
|
+
es_MX = 2058,
|
|
116
|
+
es_NI = 19466,
|
|
117
|
+
es_PA = 6154,
|
|
118
|
+
es_PY = 15370,
|
|
119
|
+
es_PE = 10250,
|
|
120
|
+
es_PR = 20490,
|
|
121
|
+
es_ES = 1034,
|
|
122
|
+
es_UY = 14346,
|
|
123
|
+
es_VE = 8202,
|
|
124
|
+
sw_KE = 1089,
|
|
125
|
+
sv_FI = 2077,
|
|
126
|
+
sv_SE = 1053,
|
|
127
|
+
ta_IN = 1097,
|
|
128
|
+
tt_RU = 1092,
|
|
129
|
+
te_IN = 1098,
|
|
130
|
+
th_TH = 1054,
|
|
131
|
+
tr_TR = 1055,
|
|
132
|
+
uz_UZ_Cyrl = 2115,
|
|
133
|
+
uz_UZ_Latn = 1091,
|
|
134
|
+
vi_VN = 1066
|
|
135
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**@format */
|
|
2
|
-
/** Exception base class */
|
|
3
|
-
export declare class Exception extends Error {
|
|
4
|
-
constructor(msg?: string, options?: ErrorOptions);
|
|
5
|
-
/**
|
|
6
|
-
* Get a string of the Exception object
|
|
7
|
-
*
|
|
8
|
-
* @returns return an error message
|
|
9
|
-
*/
|
|
10
|
-
toString(): string;
|
|
11
|
-
}
|
|
1
|
+
/**@format */
|
|
2
|
+
/** Exception base class */
|
|
3
|
+
export declare class Exception extends Error {
|
|
4
|
+
constructor(msg?: string, options?: ErrorOptions);
|
|
5
|
+
/**
|
|
6
|
+
* Get a string of the Exception object
|
|
7
|
+
*
|
|
8
|
+
* @returns return an error message
|
|
9
|
+
*/
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/**@format */
|
|
2
|
-
/** Tianyu Log Level */
|
|
3
|
-
export declare enum LogLevel {
|
|
4
|
-
/** Debug mode log */
|
|
5
|
-
DEBUG = 0,
|
|
6
|
-
/** error msg */
|
|
7
|
-
ERROR = 1,
|
|
8
|
-
/** fatal error msg */
|
|
9
|
-
FATAL = 2,
|
|
10
|
-
/** info log */
|
|
11
|
-
INFO = 3,
|
|
12
|
-
/** warning log */
|
|
13
|
-
WARNING = 4,
|
|
14
|
-
/** default log */
|
|
15
|
-
LOG = 5
|
|
16
|
-
}
|
|
17
|
-
/** Tianyu Log Interface */
|
|
18
|
-
export interface ILog {
|
|
19
|
-
/**
|
|
20
|
-
* Write a console log with specified log level
|
|
21
|
-
*
|
|
22
|
-
* @param msg the message body
|
|
23
|
-
* @param level the console log level, if not be specified, to print as default log
|
|
24
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
25
|
-
*/
|
|
26
|
-
log(msg: string, level?: LogLevel, timer?: boolean): void;
|
|
27
|
-
/**
|
|
28
|
-
* Write a console info log
|
|
29
|
-
* @param msg the message body
|
|
30
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
31
|
-
*/
|
|
32
|
-
info(msg: string, timer?: boolean): void;
|
|
33
|
-
/**
|
|
34
|
-
* Write a console warning log
|
|
35
|
-
* @param msg the message body
|
|
36
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
37
|
-
*/
|
|
38
|
-
warn(msg: string, timer?: boolean): void;
|
|
39
|
-
/**
|
|
40
|
-
* Write a console debug log
|
|
41
|
-
* @param msg the message body
|
|
42
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
43
|
-
*/
|
|
44
|
-
debug(msg: string, timer?: boolean): void;
|
|
45
|
-
/**
|
|
46
|
-
* Write a console error message
|
|
47
|
-
* @param msg the message body
|
|
48
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
49
|
-
*/
|
|
50
|
-
error(msg: string, timer?: boolean): void;
|
|
51
|
-
/**
|
|
52
|
-
* Write a console fatal message
|
|
53
|
-
* @param msg the message body
|
|
54
|
-
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
55
|
-
*/
|
|
56
|
-
fatal(msg: string, timer?: boolean): void;
|
|
57
|
-
}
|
|
58
|
-
/** Tianyu Performance recorder */
|
|
59
|
-
export interface IPerfRecorder {
|
|
60
|
-
/** the recording id */
|
|
61
|
-
id: string;
|
|
62
|
-
/** the start time number */
|
|
63
|
-
start: number;
|
|
64
|
-
}
|
|
1
|
+
/**@format */
|
|
2
|
+
/** Tianyu Log Level */
|
|
3
|
+
export declare enum LogLevel {
|
|
4
|
+
/** Debug mode log */
|
|
5
|
+
DEBUG = 0,
|
|
6
|
+
/** error msg */
|
|
7
|
+
ERROR = 1,
|
|
8
|
+
/** fatal error msg */
|
|
9
|
+
FATAL = 2,
|
|
10
|
+
/** info log */
|
|
11
|
+
INFO = 3,
|
|
12
|
+
/** warning log */
|
|
13
|
+
WARNING = 4,
|
|
14
|
+
/** default log */
|
|
15
|
+
LOG = 5
|
|
16
|
+
}
|
|
17
|
+
/** Tianyu Log Interface */
|
|
18
|
+
export interface ILog {
|
|
19
|
+
/**
|
|
20
|
+
* Write a console log with specified log level
|
|
21
|
+
*
|
|
22
|
+
* @param msg the message body
|
|
23
|
+
* @param level the console log level, if not be specified, to print as default log
|
|
24
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
25
|
+
*/
|
|
26
|
+
log(msg: string, level?: LogLevel, timer?: boolean): void;
|
|
27
|
+
/**
|
|
28
|
+
* Write a console info log
|
|
29
|
+
* @param msg the message body
|
|
30
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
31
|
+
*/
|
|
32
|
+
info(msg: string, timer?: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Write a console warning log
|
|
35
|
+
* @param msg the message body
|
|
36
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
37
|
+
*/
|
|
38
|
+
warn(msg: string, timer?: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Write a console debug log
|
|
41
|
+
* @param msg the message body
|
|
42
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
43
|
+
*/
|
|
44
|
+
debug(msg: string, timer?: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Write a console error message
|
|
47
|
+
* @param msg the message body
|
|
48
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
49
|
+
*/
|
|
50
|
+
error(msg: string, timer?: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* Write a console fatal message
|
|
53
|
+
* @param msg the message body
|
|
54
|
+
* @param timer a boolean value indicates whether needs to add a timestamp for the log
|
|
55
|
+
*/
|
|
56
|
+
fatal(msg: string, timer?: boolean): void;
|
|
57
|
+
}
|
|
58
|
+
/** Tianyu Performance recorder */
|
|
59
|
+
export interface IPerfRecorder {
|
|
60
|
+
/** the recording id */
|
|
61
|
+
id: string;
|
|
62
|
+
/** the start time number */
|
|
63
|
+
start: number;
|
|
64
|
+
}
|