@aitianyu.cn/types 0.1.2 → 0.1.3
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/README.md +44 -0
- package/dist/lib/coding/Error.js +16 -6
- package/dist/lib/coding/Path.js +41 -20
- package/dist/lib/core/Environment.js +14 -0
- package/dist/lib/core/Errors.js +34 -13
- package/dist/lib/core/Language.js +60 -7
- package/dist/lib/core/Log.js +34 -2
- package/dist/lib/core/TypeConvertion.js +20 -0
- package/dist/lib/core/object/ArrayHelper.js +15 -4
- package/dist/lib/core/object/Bytes.js +8 -4
- package/dist/lib/core/object/Calculater.js +109 -44
- package/dist/lib/core/object/DataView.js +13 -4
- package/dist/lib/core/object/Integer.js +57 -36
- package/dist/lib/core/object/Json.js +22 -10
- package/dist/lib/core/object/ObjectHelper.js +38 -14
- package/dist/lib/core/object/StringHelper.js +35 -8
- package/dist/lib/index.js +47 -6
- package/dist/lib/security/Base32.js +22 -13
- package/dist/lib/security/Guid.js +18 -1
- package/dist/lib/security/Hash.js +10 -1
- package/dist/lib/security/QRCode.js +16 -4
- package/dist/lib/security/RSA.js +33 -20
- package/dist/lib/security/SHA.js +25 -15
- package/dist/lib/security/TOTP.js +31 -9
- package/dist/lib/types/AreaCode.js +140 -131
- package/dist/lib/types/Exception.js +17 -3
- package/dist/lib/types/Logs.js +13 -7
- package/dist/lib/types/PathBase.js +43 -23
- package/dist/lib/types/Security.js +6 -1
- package/dist/lib/types/TMap.js +48 -30
- package/dist/types/coding/Error.d.ts +16 -6
- package/dist/types/coding/Path.d.ts +45 -21
- package/dist/types/core/Environment.d.ts +14 -0
- package/dist/types/core/Errors.d.ts +34 -13
- package/dist/types/core/Language.d.ts +33 -7
- package/dist/types/core/Log.d.ts +34 -2
- package/dist/types/core/TypeConvertion.d.ts +20 -0
- package/dist/types/core/interface/ITJSON.d.ts +11 -0
- package/dist/types/core/interface/ITianyuType.d.ts +11 -0
- package/dist/types/core/object/ArrayHelper.d.ts +15 -4
- package/dist/types/core/object/Bytes.d.ts +8 -4
- package/dist/types/core/object/Calculater.d.ts +38 -10
- package/dist/types/core/object/DataView.d.ts +13 -4
- package/dist/types/core/object/Integer.d.ts +57 -36
- package/dist/types/core/object/Json.d.ts +22 -10
- package/dist/types/core/object/ObjectHelper.d.ts +38 -14
- package/dist/types/core/object/StringHelper.d.ts +35 -8
- package/dist/types/index.d.ts +44 -0
- package/dist/types/security/Base32.d.ts +31 -18
- package/dist/types/security/Guid.d.ts +19 -1
- package/dist/types/security/Hash.d.ts +10 -1
- package/dist/types/security/QRCode.d.ts +16 -4
- package/dist/types/security/RSA.d.ts +51 -28
- package/dist/types/security/SHA.d.ts +25 -15
- package/dist/types/security/TOTP.d.ts +31 -9
- package/dist/types/types/AreaCode.d.ts +140 -1
- package/dist/types/types/Exception.d.ts +17 -3
- package/dist/types/types/Logs.d.ts +59 -30
- package/dist/types/types/Object.d.ts +16 -7
- package/dist/types/types/PathBase.d.ts +43 -23
- package/dist/types/types/Security.d.ts +21 -8
- package/dist/types/types/TMap.d.ts +48 -30
- package/dist/types/types/Types.d.ts +42 -10
- package/doc/en/README.md +372 -0
- package/doc/zh/README.md +372 -0
- package/package.json +3 -2
|
@@ -4,65 +4,88 @@
|
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
import { RSAKeyPairOptions } from "crypto";
|
|
6
6
|
/**
|
|
7
|
-
* RSA
|
|
7
|
+
* RSA key output format.
|
|
8
|
+
* RSA 密钥输出格式。
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* - "pem": PEM-encoded string (Base64 with header/footer lines)
|
|
11
|
+
* - "der": DER-encoded binary Buffer
|
|
12
|
+
*
|
|
13
|
+
* - "pem":PEM 编码字符串(带页眉/页脚行的 Base64)
|
|
14
|
+
* - "der":DER 编码的二进制 Buffer
|
|
11
15
|
*/
|
|
12
16
|
export type RSAKeyFormatType = "pem" | "der";
|
|
13
|
-
/** RSA key
|
|
17
|
+
/** Maps RSA key format types to their corresponding return value types. / 将 RSA 密钥格式类型映射到对应返回值类型。 */
|
|
14
18
|
export interface RSAKeyGenerationMap {
|
|
15
19
|
pem: string;
|
|
16
20
|
der: Buffer;
|
|
17
21
|
}
|
|
18
|
-
/**
|
|
22
|
+
/** Helper type that resolves to the correct return type for a given RSA key format. / 解析给定 RSA 密钥格式对应返回类型的帮助类型。 */
|
|
19
23
|
export type RSAKeyGenerationReturnType<K extends RSAKeyFormatType> = RSAKeyGenerationMap[K];
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The result of an RSA key-pair generation operation.
|
|
26
|
+
* Contains both the private key and the public key in their requested formats.
|
|
27
|
+
*
|
|
28
|
+
* RSA 密钥对生成操作的结果。
|
|
29
|
+
* 包含以所请求格式表示的私钥和公钥。
|
|
30
|
+
*/
|
|
21
31
|
export interface RSAGenerationResult<priKey extends RSAKeyFormatType, pubKey extends RSAKeyFormatType> {
|
|
22
|
-
/** RSA private key */
|
|
32
|
+
/** RSA private key in the requested format. / 所请求格式的 RSA 私钥。 */
|
|
23
33
|
privateKey: RSAKeyGenerationReturnType<priKey>;
|
|
24
|
-
/** RSA public key */
|
|
34
|
+
/** RSA public key in the requested format. / 所请求格式的 RSA 公钥。 */
|
|
25
35
|
publicKey: RSAKeyGenerationReturnType<pubKey>;
|
|
26
36
|
}
|
|
27
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* RSA encryption/decryption utility class.
|
|
39
|
+
* Provides key-pair generation and four directional encryption operations
|
|
40
|
+
* (public→private, private→public, and their reverses).
|
|
41
|
+
*
|
|
42
|
+
* RSA 加密/解密工具类。
|
|
43
|
+
* 提供密钥对生成及四种方向的加密操作
|
|
44
|
+
* (公钥→私钥、私钥→公钥,及各自的反向解密)。
|
|
45
|
+
*/
|
|
28
46
|
export declare class RSA {
|
|
29
47
|
/**
|
|
30
|
-
*
|
|
48
|
+
* Generate a new RSA public/private key pair.
|
|
49
|
+
* 生成新的 RSA 公私密钥对。
|
|
31
50
|
*
|
|
32
|
-
* @param options RSA key generation
|
|
33
|
-
* @returns
|
|
51
|
+
* @param options RSA key generation options (modulus length, format, etc.) / RSA 密钥生成选项(模数长度、格式等)
|
|
52
|
+
* @returns an object containing the generated private and public keys / 包含生成的私钥和公钥的对象
|
|
34
53
|
*/
|
|
35
54
|
static new<priKey extends RSAKeyFormatType = "pem", pubKey extends RSAKeyFormatType = "pem">(options: RSAKeyPairOptions<priKey, pubKey>): RSAGenerationResult<priKey, pubKey>;
|
|
36
55
|
/**
|
|
37
|
-
*
|
|
56
|
+
* Encrypt data using the public key (decryptable with the private key).
|
|
57
|
+
* 使用公钥加密数据(可用私钥解密)。
|
|
38
58
|
*
|
|
39
|
-
* @param data
|
|
40
|
-
* @param publicKey
|
|
41
|
-
* @returns
|
|
59
|
+
* @param data the plaintext data to encrypt / 要加密的明文数据
|
|
60
|
+
* @param publicKey the RSA public key / RSA 公钥
|
|
61
|
+
* @returns the encrypted Buffer / 加密后的 Buffer
|
|
42
62
|
*/
|
|
43
63
|
static encodepub(data: globalThis.DataView, publicKey: string | Buffer): Buffer;
|
|
44
64
|
/**
|
|
45
|
-
*
|
|
65
|
+
* Encrypt data using the private key (decryptable with the public key).
|
|
66
|
+
* 使用私钥加密数据(可用公钥解密)。
|
|
46
67
|
*
|
|
47
|
-
* @param data
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
68
|
+
* @param data the plaintext data to encrypt / 要加密的明文数据
|
|
69
|
+
* @param privateKey the RSA private key / RSA 私钥
|
|
70
|
+
* @returns the encrypted Buffer / 加密后的 Buffer
|
|
50
71
|
*/
|
|
51
72
|
static encodepri(data: globalThis.DataView, privateKey: string | Buffer): Buffer;
|
|
52
73
|
/**
|
|
53
|
-
*
|
|
74
|
+
* Decrypt data using the public key (data was encrypted with the private key).
|
|
75
|
+
* 使用公钥解密数据(数据由私钥加密)。
|
|
54
76
|
*
|
|
55
|
-
* @param data
|
|
56
|
-
* @param publicKey
|
|
57
|
-
* @returns
|
|
77
|
+
* @param data the encrypted data / 加密后的数据
|
|
78
|
+
* @param publicKey the RSA public key / RSA 公钥
|
|
79
|
+
* @returns the decrypted Buffer / 解密后的 Buffer
|
|
58
80
|
*/
|
|
59
81
|
static decodepub(data: globalThis.DataView, publicKey: string | Buffer): Buffer;
|
|
60
82
|
/**
|
|
61
|
-
*
|
|
83
|
+
* Decrypt data using the private key (data was encrypted with the public key).
|
|
84
|
+
* 使用私钥解密数据(数据由公钥加密)。
|
|
62
85
|
*
|
|
63
|
-
* @param data
|
|
64
|
-
* @param privateKey
|
|
65
|
-
* @returns
|
|
86
|
+
* @param data the encrypted data / 加密后的数据
|
|
87
|
+
* @param privateKey the RSA private key / RSA 私钥
|
|
88
|
+
* @returns the decrypted Buffer / 解密后的 Buffer
|
|
66
89
|
*/
|
|
67
90
|
static decodepri(data: globalThis.DataView, privateKey: string | Buffer): Buffer;
|
|
68
91
|
}
|
|
@@ -3,37 +3,47 @@
|
|
|
3
3
|
/// <reference types="node" />
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
import Stream from "stream";
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* SHA hash utility class.
|
|
8
|
+
* Provides SHA-256 and SHA-512 hashing for both buffer/string data and Node.js streams.
|
|
9
|
+
*
|
|
10
|
+
* SHA 哈希工具类。
|
|
11
|
+
* 为缓冲区/字符串数据和 Node.js 流提供 SHA-256 和 SHA-512 哈希计算。
|
|
12
|
+
*/
|
|
7
13
|
export declare class SHA {
|
|
8
14
|
/**
|
|
9
|
-
* Calculate
|
|
15
|
+
* Calculate the SHA-256 hash of string or Buffer data.
|
|
16
|
+
* 计算字符串或 Buffer 数据的 SHA-256 哈希值。
|
|
10
17
|
*
|
|
11
|
-
* @param data source data
|
|
12
|
-
* @param encoding string encoding
|
|
13
|
-
* @returns
|
|
18
|
+
* @param data the source data / 源数据
|
|
19
|
+
* @param encoding string encoding used when `data` is a string; defaults to "utf-8" / 当 `data` 为字符串时使用的字符串编码,默认为 "utf-8"
|
|
20
|
+
* @returns the SHA-256 digest as a Buffer / SHA-256 摘要 Buffer
|
|
14
21
|
*/
|
|
15
22
|
static sha256(data: string | Buffer, encoding?: NodeJS.BufferEncoding): Buffer;
|
|
16
23
|
/**
|
|
17
|
-
* Calculate
|
|
24
|
+
* Calculate the SHA-512 hash of string or Buffer data.
|
|
25
|
+
* 计算字符串或 Buffer 数据的 SHA-512 哈希值。
|
|
18
26
|
*
|
|
19
|
-
* @param data source data
|
|
20
|
-
* @param encoding string encoding
|
|
21
|
-
* @returns
|
|
27
|
+
* @param data the source data / 源数据
|
|
28
|
+
* @param encoding string encoding used when `data` is a string; defaults to "utf-8" / 当 `data` 为字符串时使用的字符串编码,默认为 "utf-8"
|
|
29
|
+
* @returns the SHA-512 digest as a Buffer / SHA-512 摘要 Buffer
|
|
22
30
|
*/
|
|
23
31
|
static sha512(data: string | Buffer, encoding?: NodeJS.BufferEncoding): Buffer;
|
|
24
32
|
private static sha;
|
|
25
33
|
/**
|
|
26
|
-
* Calculate
|
|
34
|
+
* Calculate the SHA-256 hash of data provided via a Node.js readable stream.
|
|
35
|
+
* 通过 Node.js 可读流提供的数据计算 SHA-256 哈希值。
|
|
27
36
|
*
|
|
28
|
-
* @param stream data stream
|
|
29
|
-
* @returns
|
|
37
|
+
* @param stream the readable data stream / 可读数据流
|
|
38
|
+
* @returns a Promise that resolves to the SHA-256 digest Buffer / 解析为 SHA-256 摘要 Buffer 的 Promise
|
|
30
39
|
*/
|
|
31
40
|
static stream256(stream: Stream): Promise<Buffer>;
|
|
32
41
|
/**
|
|
33
|
-
* Calculate
|
|
42
|
+
* Calculate the SHA-512 hash of data provided via a Node.js readable stream.
|
|
43
|
+
* 通过 Node.js 可读流提供的数据计算 SHA-512 哈希值。
|
|
34
44
|
*
|
|
35
|
-
* @param stream data stream
|
|
36
|
-
* @returns
|
|
45
|
+
* @param stream the readable data stream / 可读数据流
|
|
46
|
+
* @returns a Promise that resolves to the SHA-512 digest Buffer / 解析为 SHA-512 摘要 Buffer 的 Promise
|
|
37
47
|
*/
|
|
38
48
|
static stream512(stream: Stream): Promise<Buffer>;
|
|
39
49
|
private static streamSHA;
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Time-based One-Time Password (TOTP) utility class.
|
|
4
|
+
* Implements the TOTP algorithm as defined in RFC 6238.
|
|
5
|
+
* Compatible with standard authenticator apps (Google Authenticator, Authy, etc.).
|
|
6
|
+
*
|
|
7
|
+
* 基于时间的一次性密码(TOTP)工具类。
|
|
8
|
+
* 实现 RFC 6238 定义的 TOTP 算法。
|
|
9
|
+
* 与标准认证器应用(Google Authenticator、Authy 等)兼容。
|
|
10
|
+
*/
|
|
3
11
|
export declare class TOTP {
|
|
4
12
|
/**
|
|
5
|
-
*
|
|
13
|
+
* Generate a new TOTP secret key encoded in Base32 (RFC4648).
|
|
14
|
+
* The returned key should be stored securely and associated with a user account.
|
|
6
15
|
*
|
|
7
|
-
*
|
|
16
|
+
* 生成一个以 Base32(RFC4648)编码的新 TOTP 密钥。
|
|
17
|
+
* 返回的密钥应安全存储并与用户账户关联。
|
|
18
|
+
*
|
|
19
|
+
* @returns a Base32-encoded secret key string / Base32 编码的密钥字符串
|
|
8
20
|
*/
|
|
9
21
|
static generate(): string;
|
|
10
22
|
/**
|
|
11
|
-
* Generate TOTP
|
|
23
|
+
* Generate the 6-digit TOTP code for the given secret key and time window.
|
|
24
|
+
* The default time window is the current 30-second interval (standard TOTP).
|
|
25
|
+
*
|
|
26
|
+
* 为给定密钥和时间窗口生成 6 位 TOTP 验证码。
|
|
27
|
+
* 默认时间窗口为当前的 30 秒间隔(标准 TOTP)。
|
|
12
28
|
*
|
|
13
|
-
* @param key
|
|
14
|
-
* @
|
|
29
|
+
* @param key the Base32-encoded secret key / Base32 编码的密钥
|
|
30
|
+
* @param time optional Unix timestamp in milliseconds; defaults to Date.now() / 可选的 Unix 时间戳(毫秒),默认为 Date.now()
|
|
31
|
+
* @returns a 6-digit OTP string / 6 位一次性密码字符串
|
|
15
32
|
*/
|
|
16
33
|
static code(key: string, time?: number): string;
|
|
17
34
|
/**
|
|
18
|
-
* Generate a
|
|
35
|
+
* Generate a new TOTP secret and the corresponding otpauth:// URI for QR code scanning.
|
|
36
|
+
* The URI can be rendered as a QR code so users can add the account to an authenticator app.
|
|
37
|
+
*
|
|
38
|
+
* 生成新的 TOTP 密钥及对应的 otpauth:// URI,用于二维码扫描。
|
|
39
|
+
* 该 URI 可渲染为二维码,方便用户将账户添加到认证器应用。
|
|
19
40
|
*
|
|
20
|
-
* @param user
|
|
21
|
-
* @
|
|
41
|
+
* @param user the account username or email / 账户用户名或邮箱
|
|
42
|
+
* @param project the issuer / service name shown in the authenticator app / 显示在认证器应用中的发行方/服务名称
|
|
43
|
+
* @returns an object containing the secret key and the otpauth:// URL / 包含密钥和 otpauth:// URL 的对象
|
|
22
44
|
*/
|
|
23
45
|
static getUrl(user: string, project?: string): {
|
|
24
46
|
key: string;
|
|
@@ -1,135 +1,274 @@
|
|
|
1
1
|
/**@format */
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* International locale area codes.
|
|
4
|
+
* Each member maps a locale identifier (language_Region) to its Windows LCID numeric value.
|
|
5
|
+
* Used throughout the library to represent language/region settings in a type-safe way.
|
|
6
|
+
*
|
|
7
|
+
* 国际语言环境区域码枚举。
|
|
8
|
+
* 每个成员将语言环境标识符(语言_地区)映射到对应的 Windows LCID 数值。
|
|
9
|
+
* 在整个库中用于以类型安全的方式表示语言/地区设置。
|
|
10
|
+
*/
|
|
3
11
|
export declare enum AreaCode {
|
|
12
|
+
/** Unknown / unrecognised locale. / 未知或无法识别的语言环境。 */
|
|
4
13
|
unknown = 0,
|
|
14
|
+
/** Afrikaans (South Africa) / 南非荷兰语(南非) */
|
|
5
15
|
af_ZA = 1078,
|
|
16
|
+
/** Albanian (Albania) / 阿尔巴尼亚语(阿尔巴尼亚) */
|
|
6
17
|
sq_AL = 1052,
|
|
18
|
+
/** Amharic (Amhara) / 阿姆哈拉语(阿姆哈拉) */
|
|
7
19
|
am_AM = 1118,
|
|
20
|
+
/** Arabic (Algeria) / 阿拉伯语(阿尔及利亚) */
|
|
8
21
|
ar_DZ = 5121,
|
|
22
|
+
/** Arabic (Bahrain) / 阿拉伯语(巴林) */
|
|
9
23
|
ar_BH = 15361,
|
|
24
|
+
/** Arabic (Egypt) / 阿拉伯语(埃及) */
|
|
10
25
|
ar_EG = 3073,
|
|
26
|
+
/** Arabic (Iraq) / 阿拉伯语(伊拉克) */
|
|
11
27
|
ar_IQ = 2049,
|
|
28
|
+
/** Arabic (Jordan) / 阿拉伯语(约旦) */
|
|
12
29
|
ar_JO = 11265,
|
|
30
|
+
/** Arabic (Kuwait) / 阿拉伯语(科威特) */
|
|
13
31
|
ar_KW = 13313,
|
|
32
|
+
/** Arabic (Lebanon) / 阿拉伯语(黎巴嫩) */
|
|
14
33
|
ar_LB = 12289,
|
|
34
|
+
/** Arabic (Libya) / 阿拉伯语(利比亚) */
|
|
15
35
|
ar_LY = 4097,
|
|
36
|
+
/** Arabic (Morocco) / 阿拉伯语(摩洛哥) */
|
|
16
37
|
ar_MA = 6145,
|
|
38
|
+
/** Arabic (Oman) / 阿拉伯语(阿曼) */
|
|
17
39
|
ar_OM = 8193,
|
|
40
|
+
/** Arabic (Qatar) / 阿拉伯语(卡塔尔) */
|
|
18
41
|
ar_QA = 16385,
|
|
42
|
+
/** Arabic (Saudi Arabia) / 阿拉伯语(沙特阿拉伯) */
|
|
19
43
|
ar_SA = 1025,
|
|
44
|
+
/** Arabic (Syria) / 阿拉伯语(叙利亚) */
|
|
20
45
|
ar_SY = 10241,
|
|
46
|
+
/** Arabic (Tunisia) / 阿拉伯语(突尼斯) */
|
|
21
47
|
ar_TN = 7169,
|
|
48
|
+
/** Arabic (United Arab Emirates) / 阿拉伯语(阿联酋) */
|
|
22
49
|
ar_AE = 14337,
|
|
50
|
+
/** Arabic (Yemen) / 阿拉伯语(也门) */
|
|
23
51
|
ar_YE = 9217,
|
|
52
|
+
/** Armenian (Armenia) / 亚美尼亚语(亚美尼亚) */
|
|
24
53
|
hy_AM = 1067,
|
|
54
|
+
/** Assamese (India) / 阿萨姆语(印度) */
|
|
25
55
|
as_AS = 1101,
|
|
56
|
+
/** Azeri — Cyrillic script (Azerbaijan) / 阿塞拜疆语——西里尔字母(阿塞拜疆) */
|
|
26
57
|
az_AZ_Cyrl = 2092,
|
|
58
|
+
/** Azeri — Latin script (Azerbaijan) / 阿塞拜疆语——拉丁字母(阿塞拜疆) */
|
|
27
59
|
az_AZ_Latn = 2093,
|
|
60
|
+
/** Basque (Basque Country) / 巴斯克语(巴斯克地区) */
|
|
28
61
|
eu_ES = 1069,
|
|
62
|
+
/** Belarusian (Belarus) / 白俄罗斯语(白俄罗斯) */
|
|
29
63
|
be_BY = 1059,
|
|
64
|
+
/** Bulgarian (Bulgaria) / 保加利亚语(保加利亚) */
|
|
30
65
|
bg_BG = 1026,
|
|
66
|
+
/** Catalan (Catalonia) / 加泰罗尼亚语(加泰罗尼亚) */
|
|
31
67
|
ca_ES = 1027,
|
|
68
|
+
/** Chinese (Hong Kong SAR) / 中文(香港特别行政区) */
|
|
32
69
|
zh_HK = 3076,
|
|
70
|
+
/** Chinese (Macao SAR) / 中文(澳门特别行政区) */
|
|
33
71
|
zh_MO = 5124,
|
|
72
|
+
/** Chinese Simplified (Mainland China) / 简体中文(中国大陆) */
|
|
34
73
|
zh_CN = 2052,
|
|
74
|
+
/** Chinese (Singapore) / 中文(新加坡) */
|
|
35
75
|
zh_SG = 4100,
|
|
76
|
+
/** Chinese Traditional (Taiwan) / 繁体中文(台湾) */
|
|
36
77
|
zh_TW = 1028,
|
|
78
|
+
/** Croatian (Croatia) / 克罗地亚语(克罗地亚) */
|
|
37
79
|
hr_HR = 1050,
|
|
80
|
+
/** Czech (Czech Republic) / 捷克语(捷克共和国) */
|
|
38
81
|
cd_CZ = 1029,
|
|
82
|
+
/** Danish (Denmark) / 丹麦语(丹麦) */
|
|
39
83
|
da_DK = 1030,
|
|
84
|
+
/** Dutch (Belgium) / 荷兰语(比利时) */
|
|
40
85
|
nl_BE = 2067,
|
|
86
|
+
/** Dutch (Netherlands) / 荷兰语(荷兰) */
|
|
41
87
|
nl_NL = 1043,
|
|
88
|
+
/** English (Australia) / 英语(澳大利亚) */
|
|
42
89
|
en_AU = 3081,
|
|
90
|
+
/** English (Belize) / 英语(伯利兹) */
|
|
43
91
|
en_BZ = 10249,
|
|
92
|
+
/** English (Canada) / 英语(加拿大) */
|
|
44
93
|
en_CA = 4105,
|
|
94
|
+
/** English (Caribbean) / 英语(加勒比地区) */
|
|
45
95
|
en_CB = 9225,
|
|
96
|
+
/** English (Ireland) / 英语(爱尔兰) */
|
|
46
97
|
en_IE = 6153,
|
|
98
|
+
/** English (India) / 英语(印度) */
|
|
47
99
|
en_IN = 16393,
|
|
100
|
+
/** English (Jamaica) / 英语(牙买加) */
|
|
48
101
|
en_JM = 8201,
|
|
102
|
+
/** English (New Zealand) / 英语(新西兰) */
|
|
49
103
|
en_NZ = 5129,
|
|
104
|
+
/** English (Philippines) / 英语(菲律宾) */
|
|
50
105
|
en_PH = 13321,
|
|
106
|
+
/** English (South Africa) / 英语(南非) */
|
|
51
107
|
en_ZA = 7177,
|
|
108
|
+
/** English (Trinidad and Tobago) / 英语(特立尼达和多巴哥) */
|
|
52
109
|
en_TT = 11273,
|
|
110
|
+
/** English (Zimbabwe) / 英语(津巴布韦) */
|
|
53
111
|
en_ZW = 12297,
|
|
112
|
+
/** English (United States) / 英语(美国) */
|
|
54
113
|
en_US = 1033,
|
|
114
|
+
/** English (United Kingdom) / 英语(英国) */
|
|
55
115
|
en_UK = 2057,
|
|
116
|
+
/** Estonian (Estonia) / 爱沙尼亚语(爱沙尼亚) */
|
|
56
117
|
et_EE = 1061,
|
|
118
|
+
/** Faroese (Faroe Islands) / 法罗语(法罗群岛) */
|
|
57
119
|
fo_FO = 1080,
|
|
120
|
+
/** Finnish (Finland) / 芬兰语(芬兰) */
|
|
58
121
|
fi_FI = 1035,
|
|
122
|
+
/** French (Belgium) / 法语(比利时) */
|
|
59
123
|
fr_BE = 2060,
|
|
124
|
+
/** French (Canada) / 法语(加拿大) */
|
|
60
125
|
fr_CA = 11276,
|
|
126
|
+
/** French (France) / 法语(法国) */
|
|
61
127
|
fr_FR = 1036,
|
|
128
|
+
/** French (Luxembourg) / 法语(卢森堡) */
|
|
62
129
|
fr_LU = 5132,
|
|
130
|
+
/** French (Monaco) / 法语(摩纳哥) */
|
|
63
131
|
fr_MC = 6156,
|
|
132
|
+
/** French (Switzerland) / 法语(瑞士) */
|
|
64
133
|
fr_CH = 4108,
|
|
134
|
+
/** Galician (Galicia, Spain) / 加利西亚语(西班牙加利西亚) */
|
|
65
135
|
gl_ES = 1110,
|
|
136
|
+
/** German (Austria) / 德语(奥地利) */
|
|
66
137
|
de_AT = 3079,
|
|
138
|
+
/** German (Germany) / 德语(德国) */
|
|
67
139
|
de_DE = 1031,
|
|
140
|
+
/** German (Liechtenstein) / 德语(列支敦士登) */
|
|
68
141
|
de_LI = 5127,
|
|
142
|
+
/** German (Luxembourg) / 德语(卢森堡) */
|
|
69
143
|
de_LU = 4103,
|
|
144
|
+
/** German (Switzerland) / 德语(瑞士) */
|
|
70
145
|
de_CH = 2055,
|
|
146
|
+
/** Gujarati (India) / 古吉拉特语(印度) */
|
|
71
147
|
gu_IN = 1095,
|
|
148
|
+
/** Hebrew (Israel) / 希伯来语(以色列) */
|
|
72
149
|
he_IL = 1037,
|
|
150
|
+
/** Hindi (India) / 印地语(印度) */
|
|
73
151
|
hi_IN = 1081,
|
|
152
|
+
/** Hungarian (Hungary) / 匈牙利语(匈牙利) */
|
|
74
153
|
hu_HU = 1038,
|
|
154
|
+
/** Icelandic (Iceland) / 冰岛语(冰岛) */
|
|
75
155
|
is_IS = 1039,
|
|
156
|
+
/** Indonesian (Indonesia) / 印度尼西亚语(印度尼西亚) */
|
|
76
157
|
id_ID = 1057,
|
|
158
|
+
/** Italian (Italy) / 意大利语(意大利) */
|
|
77
159
|
it_IT = 1040,
|
|
160
|
+
/** Italian (Switzerland) / 意大利语(瑞士) */
|
|
78
161
|
it_CH = 2064,
|
|
162
|
+
/** Japanese (Japan) / 日语(日本) */
|
|
79
163
|
ja_JP = 1041,
|
|
164
|
+
/** Kannada (India) / 卡纳达语(印度) */
|
|
80
165
|
kn_IN = 1099,
|
|
166
|
+
/** Kazakh (Kazakhstan) / 哈萨克语(哈萨克斯坦) */
|
|
81
167
|
kk_KZ = 1087,
|
|
168
|
+
/** Korean (Korea) / 韩语(韩国) */
|
|
82
169
|
ko_KR = 1042,
|
|
170
|
+
/** Kyrgyz (Kyrgyzstan) / 柯尔克孜语(吉尔吉斯斯坦) */
|
|
83
171
|
ky_KZ = 1088,
|
|
172
|
+
/** Latvian (Latvia) / 拉脱维亚语(拉脱维亚) */
|
|
84
173
|
lv_LV = 1062,
|
|
174
|
+
/** Lithuanian (Lithuania) / 立陶宛语(立陶宛) */
|
|
85
175
|
lt_LT = 1063,
|
|
176
|
+
/** Malay (Brunei) / 马来语(文莱) */
|
|
86
177
|
ms_BN = 2110,
|
|
178
|
+
/** Malay (Malaysia) / 马来语(马来西亚) */
|
|
87
179
|
ms_MY = 1086,
|
|
180
|
+
/** Marathi (India) / 马拉地语(印度) */
|
|
88
181
|
mr_IN = 1102,
|
|
182
|
+
/** Mongolian (Mongolia) / 蒙古语(蒙古国) */
|
|
89
183
|
mn_MN = 2128,
|
|
184
|
+
/** Norwegian Bokmål (Norway) / 挪威书面语(挪威) */
|
|
90
185
|
nb_NO = 1044,
|
|
186
|
+
/** Norwegian Nynorsk (Norway) / 挪威新挪威语(挪威) */
|
|
91
187
|
nn_NO = 2068,
|
|
188
|
+
/** Polish (Poland) / 波兰语(波兰) */
|
|
92
189
|
pl_PL = 1045,
|
|
190
|
+
/** Portuguese (Brazil) / 葡萄牙语(巴西) */
|
|
93
191
|
pt_BR = 1046,
|
|
192
|
+
/** Portuguese (Portugal) / 葡萄牙语(葡萄牙) */
|
|
94
193
|
pt_PT = 2070,
|
|
194
|
+
/** Punjabi (India) / 旁遮普语(印度) */
|
|
95
195
|
pa_IN = 1094,
|
|
196
|
+
/** Romanian (Moldova) / 罗马尼亚语(摩尔多瓦) */
|
|
96
197
|
ro_MO = 2072,
|
|
198
|
+
/** Romanian (Romania) / 罗马尼亚语(罗马尼亚) */
|
|
97
199
|
ro_RO = 1048,
|
|
200
|
+
/** Russian (Russia) / 俄语(俄罗斯) */
|
|
98
201
|
ru_RU = 1049,
|
|
202
|
+
/** Russian (Moldova) / 俄语(摩尔多瓦) */
|
|
99
203
|
ru_MO = 2073,
|
|
204
|
+
/** Sanskrit (India) / 梵语(印度) */
|
|
100
205
|
sa_IN = 1103,
|
|
206
|
+
/** Serbian — Cyrillic script (Serbia) / 塞尔维亚语——西里尔字母(塞尔维亚) */
|
|
101
207
|
sr_SP_Cyrl = 3098,
|
|
208
|
+
/** Serbian — Latin script (Serbia) / 塞尔维亚语——拉丁字母(塞尔维亚) */
|
|
102
209
|
sr_SP_Latn = 2074,
|
|
210
|
+
/** Slovak (Slovakia) / 斯洛伐克语(斯洛伐克) */
|
|
103
211
|
sk_SK = 1051,
|
|
212
|
+
/** Slovenian (Slovenia) / 斯洛文尼亚语(斯洛文尼亚) */
|
|
104
213
|
sl_SI = 1060,
|
|
214
|
+
/** Spanish (Argentina) / 西班牙语(阿根廷) */
|
|
105
215
|
es_AR = 11274,
|
|
216
|
+
/** Spanish (Bolivia) / 西班牙语(玻利维亚) */
|
|
106
217
|
es_BO = 16394,
|
|
218
|
+
/** Spanish (Chile) / 西班牙语(智利) */
|
|
107
219
|
es_CL = 13322,
|
|
220
|
+
/** Spanish (Colombia) / 西班牙语(哥伦比亚) */
|
|
108
221
|
es_CO = 9226,
|
|
222
|
+
/** Spanish (Costa Rica) / 西班牙语(哥斯达黎加) */
|
|
109
223
|
es_CR = 5130,
|
|
224
|
+
/** Spanish (Dominican Republic) / 西班牙语(多米尼加共和国) */
|
|
110
225
|
es_DO = 7178,
|
|
226
|
+
/** Spanish (Ecuador) / 西班牙语(厄瓜多尔) */
|
|
111
227
|
es_EC = 12298,
|
|
228
|
+
/** Spanish (El Salvador) / 西班牙语(萨尔瓦多) */
|
|
112
229
|
es_SV = 17418,
|
|
230
|
+
/** Spanish (Guatemala) / 西班牙语(危地马拉) */
|
|
113
231
|
es_GT = 4106,
|
|
232
|
+
/** Spanish (Honduras) / 西班牙语(洪都拉斯) */
|
|
114
233
|
es_HN = 18442,
|
|
234
|
+
/** Spanish (Mexico) / 西班牙语(墨西哥) */
|
|
115
235
|
es_MX = 2058,
|
|
236
|
+
/** Spanish (Nicaragua) / 西班牙语(尼加拉瓜) */
|
|
116
237
|
es_NI = 19466,
|
|
238
|
+
/** Spanish (Panama) / 西班牙语(巴拿马) */
|
|
117
239
|
es_PA = 6154,
|
|
240
|
+
/** Spanish (Paraguay) / 西班牙语(巴拉圭) */
|
|
118
241
|
es_PY = 15370,
|
|
242
|
+
/** Spanish (Peru) / 西班牙语(秘鲁) */
|
|
119
243
|
es_PE = 10250,
|
|
244
|
+
/** Spanish (Puerto Rico) / 西班牙语(波多黎各) */
|
|
120
245
|
es_PR = 20490,
|
|
246
|
+
/** Spanish (Spain, Traditional Sort) / 西班牙语(西班牙,传统排序) */
|
|
121
247
|
es_ES = 1034,
|
|
248
|
+
/** Spanish (Uruguay) / 西班牙语(乌拉圭) */
|
|
122
249
|
es_UY = 14346,
|
|
250
|
+
/** Spanish (Venezuela) / 西班牙语(委内瑞拉) */
|
|
123
251
|
es_VE = 8202,
|
|
252
|
+
/** Swahili (Kenya) / 斯瓦希里语(肯尼亚) */
|
|
124
253
|
sw_KE = 1089,
|
|
254
|
+
/** Swedish (Finland) / 瑞典语(芬兰) */
|
|
125
255
|
sv_FI = 2077,
|
|
256
|
+
/** Swedish (Sweden) / 瑞典语(瑞典) */
|
|
126
257
|
sv_SE = 1053,
|
|
258
|
+
/** Tamil (India) / 泰米尔语(印度) */
|
|
127
259
|
ta_IN = 1097,
|
|
260
|
+
/** Tatar (Russia) / 鞑靼语(俄罗斯) */
|
|
128
261
|
tt_RU = 1092,
|
|
262
|
+
/** Telugu (India) / 泰卢固语(印度) */
|
|
129
263
|
te_IN = 1098,
|
|
264
|
+
/** Thai (Thailand) / 泰语(泰国) */
|
|
130
265
|
th_TH = 1054,
|
|
266
|
+
/** Turkish (Turkey) / 土耳其语(土耳其) */
|
|
131
267
|
tr_TR = 1055,
|
|
268
|
+
/** Uzbek — Cyrillic script (Uzbekistan) / 乌兹别克语——西里尔字母(乌兹别克斯坦) */
|
|
132
269
|
uz_UZ_Cyrl = 2115,
|
|
270
|
+
/** Uzbek — Latin script (Uzbekistan) / 乌兹别克语——拉丁字母(乌兹别克斯坦) */
|
|
133
271
|
uz_UZ_Latn = 1091,
|
|
272
|
+
/** Vietnamese (Vietnam) / 越南语(越南) */
|
|
134
273
|
vi_VN = 1066
|
|
135
274
|
}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
/**@format */
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Base exception class for all aitianyu custom errors.
|
|
4
|
+
* Extends the built-in Error class and provides a standardized toString output.
|
|
5
|
+
*
|
|
6
|
+
* aitianyu 所有自定义异常的基类。
|
|
7
|
+
* 继承自内置 Error 类,提供标准化的 toString 输出。
|
|
8
|
+
*/
|
|
3
9
|
export declare class Exception extends Error {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new Exception instance.
|
|
12
|
+
* 创建一个新的 Exception 实例。
|
|
13
|
+
*
|
|
14
|
+
* @param msg optional error message / 可选的错误信息
|
|
15
|
+
* @param options optional error options / 可选的错误选项
|
|
16
|
+
*/
|
|
4
17
|
constructor(msg?: string, options?: ErrorOptions);
|
|
5
18
|
/**
|
|
6
|
-
* Get
|
|
19
|
+
* Get the error message string of this Exception.
|
|
20
|
+
* 获取当前异常的错误信息字符串。
|
|
7
21
|
*
|
|
8
|
-
* @returns
|
|
22
|
+
* @returns the error message / 错误信息
|
|
9
23
|
*/
|
|
10
24
|
toString(): string;
|
|
11
25
|
}
|