@dczy/tie-tools 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/common/date.d.ts +2 -0
- package/dist/common/date.d.ts.map +1 -0
- package/dist/common/index.d.ts +43 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/number.d.ts +2 -0
- package/dist/common/number.d.ts.map +1 -0
- package/dist/common/string.d.ts +2 -0
- package/dist/common/string.d.ts.map +1 -0
- package/dist/common/types.d.ts +63 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/crypt/ecdh/ellipticCrypto.d.ts +25 -0
- package/dist/crypt/ecdh/ellipticCrypto.d.ts.map +1 -0
- package/dist/crypt/ecdh/index.d.ts +28 -0
- package/dist/crypt/ecdh/index.d.ts.map +1 -0
- package/dist/crypt/ecdh/textCoder.d.ts +12 -0
- package/dist/crypt/ecdh/textCoder.d.ts.map +1 -0
- package/dist/crypt/index.d.ts +34 -0
- package/dist/crypt/index.d.ts.map +1 -0
- package/dist/crypt/seed/index.d.ts +19 -0
- package/dist/crypt/seed/index.d.ts.map +1 -0
- package/dist/crypt/sm/index.d.ts +108 -0
- package/dist/crypt/sm/index.d.ts.map +1 -0
- package/dist/crypt/utils.d.ts +12 -0
- package/dist/crypt/utils.d.ts.map +1 -0
- package/dist/date/index.d.ts +13 -0
- package/dist/date/index.d.ts.map +1 -0
- package/dist/deep/index.d.ts +26 -0
- package/dist/deep/index.d.ts.map +1 -0
- package/dist/enum/index.d.ts +24 -0
- package/dist/enum/index.d.ts.map +1 -0
- package/dist/error-report/index.d.ts +11 -0
- package/dist/error-report/index.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/location/gcoord/crs/BD09.d.ts +4 -0
- package/dist/location/gcoord/crs/BD09.d.ts.map +1 -0
- package/dist/location/gcoord/crs/BD09MC.d.ts +4 -0
- package/dist/location/gcoord/crs/BD09MC.d.ts.map +1 -0
- package/dist/location/gcoord/crs/EPSG3857.d.ts +4 -0
- package/dist/location/gcoord/crs/EPSG3857.d.ts.map +1 -0
- package/dist/location/gcoord/crs/GCJ02.d.ts +4 -0
- package/dist/location/gcoord/crs/GCJ02.d.ts.map +1 -0
- package/dist/location/gcoord/crs/WGS84.d.ts +1 -0
- package/dist/location/gcoord/crs/WGS84.d.ts.map +1 -0
- package/dist/location/gcoord/crs/index.d.ts +31 -0
- package/dist/location/gcoord/crs/index.d.ts.map +1 -0
- package/dist/location/gcoord/geojson.d.ts +200 -0
- package/dist/location/gcoord/geojson.d.ts.map +1 -0
- package/dist/location/gcoord/helper.d.ts +69 -0
- package/dist/location/gcoord/helper.d.ts.map +1 -0
- package/dist/location/gcoord/index.d.ts +26 -0
- package/dist/location/gcoord/index.d.ts.map +1 -0
- package/dist/location/gcoord/transform.d.ts +10 -0
- package/dist/location/gcoord/transform.d.ts.map +1 -0
- package/dist/location/index.d.ts +37 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/pin-yin/index.d.ts +21 -0
- package/dist/pin-yin/index.d.ts.map +1 -0
- package/dist/requests/index.d.ts +41 -0
- package/dist/requests/index.d.ts.map +1 -0
- package/dist/requests/interceptors/index.d.ts +4 -0
- package/dist/requests/interceptors/index.d.ts.map +1 -0
- package/dist/requests/interceptors/request.d.ts +5 -0
- package/dist/requests/interceptors/request.d.ts.map +1 -0
- package/dist/requests/interceptors/response.d.ts +5 -0
- package/dist/requests/interceptors/response.d.ts.map +1 -0
- package/dist/requests/interceptors/util.d.ts +41 -0
- package/dist/requests/interceptors/util.d.ts.map +1 -0
- package/dist/storage/index.d.ts +25 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/tie-tools.cjs +2 -0
- package/dist/tie-tools.js +2580 -0
- package/dist/tree/index.d.ts +76 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/uri/index.d.ts +61 -0
- package/dist/uri/index.d.ts.map +1 -0
- package/dist/validate/index.d.ts +11 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":"AAQA,OAAO,EAAG,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createGuid, getValueByPath, parseJsonObjects } from "@dczy/tie-core";
|
|
2
|
+
declare class DcToolsCommon {
|
|
3
|
+
/**
|
|
4
|
+
* 生成Guid
|
|
5
|
+
*/
|
|
6
|
+
guid(): string;
|
|
7
|
+
/**
|
|
8
|
+
* 动态加载css或者js
|
|
9
|
+
* @param url css 或 js 链接
|
|
10
|
+
* @param targetName {'script' | 'link'} script对应js,link 对应css
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
loadCssOrJs(url: string, targetName?: 'script' | 'link'): Promise<boolean>;
|
|
14
|
+
private checkCssJsLoad;
|
|
15
|
+
/**
|
|
16
|
+
* JSON,HTML字符串不同类型,显示不同颜色
|
|
17
|
+
* @param json
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
syntaxHighlight(json: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* 根据字符串数据名称获取对象的值,
|
|
23
|
+
* @param data Object 或者是 Array
|
|
24
|
+
* @param path path值可以是单属性如'name',可以是链式属性如`data.0.property1.property2`
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
getValByPath(data: unknown, path: string): any;
|
|
28
|
+
asyncLoadJs(): {
|
|
29
|
+
loadJs: (url: string, param: {
|
|
30
|
+
callback?: Function;
|
|
31
|
+
containerId: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
checkJsIsLoad: (url: string) => boolean;
|
|
34
|
+
};
|
|
35
|
+
parseJsonOb(payload: string): any[];
|
|
36
|
+
}
|
|
37
|
+
export { createGuid, getValueByPath, parseJsonObjects };
|
|
38
|
+
export * from "./types";
|
|
39
|
+
export * from "./number";
|
|
40
|
+
export * from "./string";
|
|
41
|
+
export * from "./date";
|
|
42
|
+
export declare const DcCommon: DcToolsCommon;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAE7E,cAAM,aAAa;IACjB;;OAEG;IACH,IAAI;IAGJ;;;;;OAKG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,QAAQ,GAAG,MAAiB;IAqBjE,OAAO,CAAC,cAAc;IActB;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM;IAkB5B;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;IAG9C,WAAW;sBAEY,MAAM,SAAS;YAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE;6BAsBpD,MAAM;;IAmBpC,WAAW,CAAC,OAAO,EAAE,MAAM;CAG5B;AAGD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAA;AACvD,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,eAAO,MAAM,QAAQ,eAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/common/number.ts"],"names":[],"mappings":"AAwEA,OAAO,EAAG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/common/string.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAG,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface String {
|
|
3
|
+
/** 字母小写*/
|
|
4
|
+
firstToLower: () => String;
|
|
5
|
+
/** 首字母大写*/
|
|
6
|
+
firstToUpper: () => String;
|
|
7
|
+
/** 字符串替换,全部 */
|
|
8
|
+
replaceAllNew: (form: string, to: string) => String;
|
|
9
|
+
}
|
|
10
|
+
interface Date {
|
|
11
|
+
/**
|
|
12
|
+
* 日期格式化
|
|
13
|
+
* @param {String} fmt 需要转换的格式 如 yyyy-MM-dd、yyyy-MM-dd HH:mm:ss
|
|
14
|
+
* @returns string
|
|
15
|
+
*/
|
|
16
|
+
format: (fmt: string) => String;
|
|
17
|
+
}
|
|
18
|
+
interface Number {
|
|
19
|
+
/**
|
|
20
|
+
* 加法
|
|
21
|
+
* @param {any} val 加数
|
|
22
|
+
* @param {any} fixed 小数位
|
|
23
|
+
* @returns Number
|
|
24
|
+
*/
|
|
25
|
+
plus: (val: any, fixed?: number) => number;
|
|
26
|
+
/**
|
|
27
|
+
* 减法
|
|
28
|
+
* @param {any} val 减数
|
|
29
|
+
* @param {any} fixed 小数位
|
|
30
|
+
* @returns Number
|
|
31
|
+
*/
|
|
32
|
+
minus: (val: any, fixed?: number) => number;
|
|
33
|
+
/**
|
|
34
|
+
* 除法
|
|
35
|
+
* @param {any} val 除数
|
|
36
|
+
* @param {any} fixed 小数位
|
|
37
|
+
* @returns Number
|
|
38
|
+
*/
|
|
39
|
+
div: (val: any, fixed?: number) => number;
|
|
40
|
+
/**
|
|
41
|
+
* 取余
|
|
42
|
+
* @param {any} val 除数
|
|
43
|
+
* @param {any} fixed 小数位
|
|
44
|
+
* @returns Number
|
|
45
|
+
*/
|
|
46
|
+
mod: (val: any, fixed?: number) => number;
|
|
47
|
+
/**
|
|
48
|
+
* 乘法
|
|
49
|
+
* @param {any} val 乘数
|
|
50
|
+
* @param {any} fixed 小数位
|
|
51
|
+
* @returns Number
|
|
52
|
+
*/
|
|
53
|
+
times: (val: any, fixed?: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* 保留小数位
|
|
56
|
+
* @param {any} fixed 小数位,
|
|
57
|
+
* @returns Number
|
|
58
|
+
*/
|
|
59
|
+
round: (fixed: number) => number;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU;QACV,YAAY,EAAE,MAAM,MAAM,CAAA;QAC1B,WAAW;QACX,YAAY,EAAE,MAAM,MAAM,CAAA;QAC1B,eAAe;QACf,aAAa,EAAE,CAAC,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,KAAK,MAAM,CAAA;KACjD;IACD,UAAU,IAAI;QACZ;;;;UAIE;QACF,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;KAChC;IACD,UAAU,MAAM;QACd;;;;;WAKG;QACH,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;QAC1C;;;;;WAKG;QACH,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;QAC3C;;;;;WAKG;QACH,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;QACzC;;;;;WAKG;QACH,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;QACzC;;;;;WAKG;QACH,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;QAC3C;;;;WAIG;QACH,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;KACjC;CACF;AACD,OAAO,EAAG,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ec as EcTypes } from "elliptic";
|
|
2
|
+
type HexString = string;
|
|
3
|
+
export declare class ElipticCrypto {
|
|
4
|
+
private _ec;
|
|
5
|
+
private keys;
|
|
6
|
+
private readonly namedCurve;
|
|
7
|
+
constructor(namedCurve: "secp256k1" | "p192" | "p224" | "p256" | "p384" | "p521" | "curve25519" | "ed25519");
|
|
8
|
+
private get ec();
|
|
9
|
+
generateKey(): {
|
|
10
|
+
publicKey: string;
|
|
11
|
+
privateKey: string;
|
|
12
|
+
};
|
|
13
|
+
improtPublicKey(removatePublicKey: HexString | ArrayBuffer): EcTypes.KeyPair;
|
|
14
|
+
encrypto(privateKey: HexString, removatePublicKey: HexString, iv: HexString, decodeText: string): any;
|
|
15
|
+
decrypto(privateKey: HexString, removatePublicKey: HexString, iv: HexString, encodeText: string): string;
|
|
16
|
+
decryptoBuffer(privateKey: HexString, removatePublicKey: HexString, iv: HexString, encodeText: ArrayBuffer): string;
|
|
17
|
+
arrayBufferToHex(buffer: ArrayBuffer): HexString;
|
|
18
|
+
aesEncrypt(str: string, secretKey: string, aesIv: string, padding: boolean): any;
|
|
19
|
+
aesDecrypt(data: string, secretKey: string, aesIv: string, padding: boolean): string;
|
|
20
|
+
decodeBase64(base64Str: string): string;
|
|
21
|
+
base64ToArrayBuffer(base64: string): ArrayBuffer;
|
|
22
|
+
getConfusePublicKey(base64RemovateStr: string): string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=ellipticCrypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipticCrypto.d.ts","sourceRoot":"","sources":["../../../src/crypt/ecdh/ellipticCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,OAAO,EAAE,MAA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
|
|
5
|
+
private crypto;
|
|
6
|
+
constructor();
|
|
7
|
+
generateKey(): Promise<CryptoKeyPair>;
|
|
8
|
+
exprotKeyJwk(key: CryptoKey): Promise<JsonWebKey>;
|
|
9
|
+
exprotKeyToHexString(key: CryptoKey): Promise<string>;
|
|
10
|
+
exprotKeyToBase64String(key: CryptoKey): Promise<string>;
|
|
11
|
+
improtKeyJwk(publicKeyData: JsonWebKey, usages?: KeyUsage[]): Promise<CryptoKey>;
|
|
12
|
+
improtPublicKey(removatePublicKey: HexString | ArrayBuffer): Promise<CryptoKey>;
|
|
13
|
+
deriveSecretKey(privateKey: CryptoKey, removatePublicKey: CryptoKey): Promise<CryptoKey>;
|
|
14
|
+
encrypto(privateKey: CryptoKey, removatePublicKey: CryptoKey, iv: HexString, decodeText: string): Promise<Base64String>;
|
|
15
|
+
encryptoWithShared(shared: CryptoKey, iv: HexString, decodeText: string): Promise<Base64String>;
|
|
16
|
+
decryptoBuffer(privateKey: CryptoKey, removatePublicKey: CryptoKey, iv: HexString, encodeBuffer: ArrayBuffer): Promise<string>;
|
|
17
|
+
decrypto(privateKey: CryptoKey, removatePublicKey: CryptoKey, iv: HexString, encodeText: string): Promise<string>;
|
|
18
|
+
decryptoWithShared(shared: CryptoKey, iv: HexString, encodeText: string): Promise<string>;
|
|
19
|
+
private encodeTextToArrayBuffer;
|
|
20
|
+
getConfusePublicKey(base64RemovateStr: string): string;
|
|
21
|
+
hexToArrayBuffer(hexString: string): ArrayBuffer;
|
|
22
|
+
base64ToArrayBuffer(base64: string): ArrayBuffer;
|
|
23
|
+
arrayBufferToHex(buffer: ArrayBuffer): HexString;
|
|
24
|
+
arrayBufferToBase64(buffer: ArrayBuffer): Base64String;
|
|
25
|
+
decodeBase64(base64Str: string): string;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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E,MAAM;IAQlC,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS;IAGhD,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY;IAWtD,YAAY,CAAC,SAAS,EAAE,MAAM;CAQ/B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class TextEncoder {
|
|
2
|
+
encode(input: string): Uint8Array;
|
|
3
|
+
}
|
|
4
|
+
export declare class TextDecoder {
|
|
5
|
+
encoding: string;
|
|
6
|
+
constructor(encoding?: string);
|
|
7
|
+
decode(input: ArrayBuffer, options?: {
|
|
8
|
+
stream?: boolean;
|
|
9
|
+
}): string;
|
|
10
|
+
private decodeUTF8;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=textCoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textCoder.d.ts","sourceRoot":"","sources":["../../../src/crypt/ecdh/textCoder.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACtB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;CA6BlC;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,MAAM,CAAC;gBAEL,QAAQ,GAAE,MAAgB;IAItC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM;IAOlE,OAAO,CAAC,UAAU;CAsCnB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DcEcdhCrypto } from "./ecdh";
|
|
2
|
+
import { ElipticCrypto } from "./ecdh/ellipticCrypto";
|
|
3
|
+
import { DcSM } from "./sm";
|
|
4
|
+
import { DcSeed } from "./seed";
|
|
5
|
+
declare class DcToolsCrypt {
|
|
6
|
+
/**
|
|
7
|
+
* jwt 解码
|
|
8
|
+
* @param token
|
|
9
|
+
* @returns undefined | object
|
|
10
|
+
*/
|
|
11
|
+
jwtDecode(token: string): any;
|
|
12
|
+
/**
|
|
13
|
+
* 加密字符串成base64
|
|
14
|
+
* @param input
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
base64Encode(input: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* base64字符串解码
|
|
20
|
+
* @param input
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
base64Decode(input: string): string;
|
|
24
|
+
compatibilityAtob(): (param: string) => string;
|
|
25
|
+
}
|
|
26
|
+
export declare const DcCrypt: {
|
|
27
|
+
Tools: DcToolsCrypt;
|
|
28
|
+
Ecdh: DcEcdhCrypto;
|
|
29
|
+
Ecc: ElipticCrypto;
|
|
30
|
+
sm: DcSM;
|
|
31
|
+
seed: DcSeed;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crypt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B,cAAM,YAAY;IAChB;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM;IAM1B;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM;IAM1B,iBAAiB,YACM,MAAM,KAAK,MAAM;CAuCzC;AAED,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HexString } from '../utils';
|
|
2
|
+
export declare class DcSeed {
|
|
3
|
+
private separator;
|
|
4
|
+
getSeedKey(seed: string): {
|
|
5
|
+
seedKey: Uint8Array<ArrayBuffer>;
|
|
6
|
+
seedIv: Uint8Array<ArrayBuffer>;
|
|
7
|
+
};
|
|
8
|
+
generateSeedKey(seed: string, timestamp?: number): {
|
|
9
|
+
seedCryptKey: string;
|
|
10
|
+
rawKey: string;
|
|
11
|
+
};
|
|
12
|
+
reverseCalculateKey(timeStampedKey: string, seed: string): {
|
|
13
|
+
timestamp: number;
|
|
14
|
+
rawKey: string;
|
|
15
|
+
};
|
|
16
|
+
encrypt(seed: string, ivHex: HexString, plainText: string): string;
|
|
17
|
+
decrypt(seed: string, ivHex: HexString, plainText: string): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypt/seed/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,qBAAa,MAAM;IACf,OAAO,CAAC,SAAS,CAAe;IAChC,UAAU,CAAC,IAAI,EAAE,MAAM;;;;IAgBvB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;;IAyBhD,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;IAsCxD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM;IAczD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM;CAwB5D"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { SM2, SM4 } from "gm-crypto";
|
|
2
|
+
import type { HexString, Base64String } from "../utils";
|
|
3
|
+
export declare class DcSM {
|
|
4
|
+
publicKey: string;
|
|
5
|
+
privateKey: string;
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* 生成 SM2 密钥对
|
|
9
|
+
* @returns {object} 密钥对对象,包含公钥和私钥
|
|
10
|
+
* */
|
|
11
|
+
generateKeyPair(): {
|
|
12
|
+
privateKey: string;
|
|
13
|
+
publicKey: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 使用 SM2 算法对字符串进行加密,对应的publickey是当前实例的公钥
|
|
17
|
+
* @param data 待加密的字符串
|
|
18
|
+
* @param cipherMode SM2加密模式,默认为 C1C3C2 模式
|
|
19
|
+
* @returns 加密后的十六进制字符串
|
|
20
|
+
* */
|
|
21
|
+
encrypt(data: string, cipherMode?: SM2.constants): HexString;
|
|
22
|
+
/**
|
|
23
|
+
* 使用 SM2 算法对字符串进行加密
|
|
24
|
+
* @param data 待加密的字符串
|
|
25
|
+
* @param publicKey SM2公钥 hex字符串
|
|
26
|
+
* @param cipherMode SM2加密模式,默认为 C1C3C2 模式
|
|
27
|
+
* @returns 加密后的十六进制字符串
|
|
28
|
+
* */
|
|
29
|
+
encryptWithKey(data: string, publicKey: HexString, cipherMode?: SM2.constants): HexString;
|
|
30
|
+
/**
|
|
31
|
+
* 使用 SM2 算法对字符串进行加密,对应的publickey是当前实例的公钥
|
|
32
|
+
* @param data 待加密的字符串
|
|
33
|
+
* @param cipherMode SM2加密模式,默认为 C1C3C2 模式
|
|
34
|
+
* @returns 加密后的十六进制字符串
|
|
35
|
+
* */
|
|
36
|
+
encryptBase64(data: string, cipherMode?: SM2.constants): Base64String;
|
|
37
|
+
/**
|
|
38
|
+
* 使用 SM2 算法对字符串进行加密
|
|
39
|
+
* @param data 待加密的字符串
|
|
40
|
+
* @param publicKey SM2公钥 hex字符串
|
|
41
|
+
* @param cipherMode SM2加密模式,默认为 C1C3C2 模式
|
|
42
|
+
* @returns 加密后的十六进制字符串
|
|
43
|
+
* */
|
|
44
|
+
encryptBase64WithKey(data: string, publicKey: HexString, cipherMode?: SM2.constants): Base64String;
|
|
45
|
+
/**
|
|
46
|
+
* 使用 SM2 算法对 Base64 编码的密文进行解密,对应的privateKey是当前实例的公钥
|
|
47
|
+
* @param data 待解密的Base64字符串
|
|
48
|
+
* @param cipherMode SM2解密模式,默认为 C1C3C2 模式
|
|
49
|
+
* @returns 解密后的明文字符串
|
|
50
|
+
* */
|
|
51
|
+
decrypt(data: HexString, cipherMode?: SM2.constants): string;
|
|
52
|
+
/**
|
|
53
|
+
* 使用 SM2 算法对 Base64 编码的密文进行解密
|
|
54
|
+
* @param data 待解密的Base64字符串
|
|
55
|
+
* @param privateKey SM2私钥 hex字符串
|
|
56
|
+
* @param cipherMode SM2解密模式,默认为 C1C3C2 模式
|
|
57
|
+
* @returns 解密后的明文字符串
|
|
58
|
+
* */
|
|
59
|
+
decryptWithKey(data: HexString, privateKey: HexString, cipherMode?: SM2.constants): string;
|
|
60
|
+
/**
|
|
61
|
+
* 使用 SM2 算法对 Base64 编码的密文进行解密,对应的privateKey是当前实例的公钥
|
|
62
|
+
* @param data 待解密的Base64字符串
|
|
63
|
+
* @param cipherMode SM2解密模式,默认为 C1C3C2 模式
|
|
64
|
+
* @returns 解密后的明文字符串
|
|
65
|
+
* */
|
|
66
|
+
decryptBase64(data: Base64String, cipherMode?: SM2.constants): string;
|
|
67
|
+
/**
|
|
68
|
+
* 使用 SM2 算法对 Base64 编码的密文进行解密
|
|
69
|
+
* @param data 待解密的Base64字符串
|
|
70
|
+
* @param privateKey SM2私钥 hex字符串
|
|
71
|
+
* @param cipherMode SM2解密模式,默认为 C1C3C2 模式
|
|
72
|
+
* @returns 解密后的明文字符串
|
|
73
|
+
*/
|
|
74
|
+
decryptBase64WithKey(data: Base64String, privateKey: HexString, cipherMode?: SM2.constants): string;
|
|
75
|
+
/**
|
|
76
|
+
* 使用 SM4 算法对字符串进行加密
|
|
77
|
+
* @param data 要计算摘要的字符串
|
|
78
|
+
* @param key SM4密钥 hex字符串
|
|
79
|
+
* @param mode SM4模式,默认使用ECB模式
|
|
80
|
+
* @returns 计算得到的SM4摘要的base64字符串
|
|
81
|
+
* */
|
|
82
|
+
encryptHexSM4(plainText: string, key: HexString, mode?: SM4.constants): Base64String;
|
|
83
|
+
/**
|
|
84
|
+
* 使用 SM4 算法对字符串进行加密
|
|
85
|
+
* @param data 要计算摘要的字符串
|
|
86
|
+
* @param key SM4密钥 非hex字符串
|
|
87
|
+
* @param mode SM4模式,默认使用ECB模式
|
|
88
|
+
* @returns 计算得到的SM4摘要的base64字符串
|
|
89
|
+
* */
|
|
90
|
+
encryptSM4(plainText: string, key: string, mode?: SM4.constants): Base64String;
|
|
91
|
+
/**
|
|
92
|
+
* 使用 SM4 算法对 Base64 编码的密文进行解密
|
|
93
|
+
* @param encryptedBase64 - 待解密的 Base64 编码的密文
|
|
94
|
+
* @param key - SM4 解密所需的密钥,hex字符串
|
|
95
|
+
* @param mode - SM4 解密模式,默认为 ECB 模式
|
|
96
|
+
* @returns 解密后的明文字符串
|
|
97
|
+
*/
|
|
98
|
+
decryptHexSM4(encryptedBase64: Base64String, key: HexString, mode?: SM4.constants): string;
|
|
99
|
+
/**
|
|
100
|
+
* 使用 SM4 算法对 Base64 编码的密文进行解密
|
|
101
|
+
* @param encryptedBase64 - 待解密的 Base64 编码的密文
|
|
102
|
+
* @param key - SM4 解密所需的密钥,非hex字符串
|
|
103
|
+
* @param mode - SM4 解密模式,默认为 ECB 模式
|
|
104
|
+
* @returns 解密后的明文字符串
|
|
105
|
+
*/
|
|
106
|
+
decryptSM4(encryptedBase64: Base64String, key: string, mode?: SM4.constants): string;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypt/sm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxD,qBAAa,IAAI;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,E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jG;;;;;;OAMG;IACH,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,GAAE,GAAG,CAAC,SAA6B,GAAG,MAAM;IAU7G;;;;;;OAMG;IACH,UAAU,CAAC,eAAe,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,SAA6B,GAAG,MAAM;CAUxG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type HexString = string;
|
|
2
|
+
type Base64String = string;
|
|
3
|
+
declare function hexToBase64(hex: string): string;
|
|
4
|
+
declare function base64ToHex(base64: string): string;
|
|
5
|
+
declare function hexToArrayBuffer(hexString: string): ArrayBuffer;
|
|
6
|
+
declare function base64ToArrayBuffer(base64: string): ArrayBuffer;
|
|
7
|
+
declare function arrayBufferToHex(buffer: ArrayBuffer): HexString;
|
|
8
|
+
declare function arrayBufferToBase64(buffer: ArrayBuffer): Base64String;
|
|
9
|
+
declare function decodeBase64(base64Str: string): string;
|
|
10
|
+
declare function stringToHex(str: string): HexString;
|
|
11
|
+
export { HexString, Base64String, hexToBase64, base64ToHex, hexToArrayBuffer, base64ToArrayBuffer, arrayBufferToHex, arrayBufferToBase64, decodeBase64, stringToHex };
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/crypt/utils.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,CAAC;AACxB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,UAG/B;AACD,iBAAS,WAAW,CAAC,MAAM,EAAE,MAAM,UAGlC;AACD,iBAAS,gBAAgB,CAAC,SAAS,EAAE,MAAM,eAY1C;AACD,iBAAS,mBAAmB,CAAC,MAAM,EAAE,MAAM,eAO1C;AACD,iBAAS,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAExD;AACD,iBAAS,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAS9D;AACD,iBAAS,YAAY,CAAC,SAAS,EAAE,MAAM,UAOtC;AACD,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAQ3C;AACD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACZ,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { formatDate } from "@dczy/tie-core";
|
|
2
|
+
export declare class DcToolsDate {
|
|
3
|
+
/**
|
|
4
|
+
* 日期格式化
|
|
5
|
+
* @param {Date,String} time 需要转换的时间
|
|
6
|
+
* @param {String} fmt 需要转换的格式 如 yyyy-MM-dd、yyyy-MM-dd HH:mm:ss
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
format(time: string | Date, fmt: string): string;
|
|
10
|
+
}
|
|
11
|
+
export { formatDate };
|
|
12
|
+
export declare const DcDate: DcToolsDate;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/date/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,qBAAa,WAAW;IACtB;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM;CAGxC;AAED,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB,eAAO,MAAM,MAAM,aAAoB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cloneArrayWithItem, cloneArrayWithItems, deepClone } from "@dczy/tie-core";
|
|
2
|
+
declare class DefineDeep {
|
|
3
|
+
/**
|
|
4
|
+
* 对象数组深拷贝
|
|
5
|
+
* @param {Array,Object} source 需要深拷贝的对象数组
|
|
6
|
+
* @param {Array} noClone 不需要深拷贝的属性集合
|
|
7
|
+
*/
|
|
8
|
+
clone<T = any>(source: any, noClone?: string[]): T;
|
|
9
|
+
/**
|
|
10
|
+
* 数组深拷贝后push
|
|
11
|
+
* @param source
|
|
12
|
+
* @param items
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
pushArray<T extends any[]>(source: T, items: T): T;
|
|
16
|
+
/**
|
|
17
|
+
* 数组深拷贝后push
|
|
18
|
+
* @param source
|
|
19
|
+
* @param item
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
push<TItem extends any>(source: TItem[], item: TItem): TItem[];
|
|
23
|
+
}
|
|
24
|
+
export { cloneArrayWithItem, cloneArrayWithItems, deepClone };
|
|
25
|
+
export declare const DcDeep: DefineDeep;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deep/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEnF,cAAM,UAAU;IACd;;;;OAIG;IACH,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAE,MAAM,EAAO,GAAG,CAAC;IAItD;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAI9C;;;;;OAKG;IACH,IAAI,CAAC,KAAK,SAAS,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK;CAGrD;AAED,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,SAAS,EAAE,CAAA;AAC7D,eAAO,MAAM,MAAM,YAAmB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type EnumItemType = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
type EnumTypeConstraint = {
|
|
7
|
+
[key: string]: EnumItemType;
|
|
8
|
+
};
|
|
9
|
+
type EnumType<T extends EnumTypeConstraint> = {
|
|
10
|
+
[P in keyof T]: T[P];
|
|
11
|
+
};
|
|
12
|
+
declare class DcEnumItem<T extends EnumTypeConstraint> {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
private Enum;
|
|
15
|
+
constructor(enumOptions: EnumType<T>);
|
|
16
|
+
getSelf: (id: number | string) => EnumItemType;
|
|
17
|
+
getArray: () => EnumItemType[];
|
|
18
|
+
}
|
|
19
|
+
type ExtendedProperties<T> = {
|
|
20
|
+
[P in keyof T]: number | string;
|
|
21
|
+
};
|
|
22
|
+
export declare function DcEnum<T extends EnumTypeConstraint>(enumOptions: EnumType<T>): DcEnumItem<T> & ExtendedProperties<T>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enum/index.ts"],"names":[],"mappings":"AACA,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AACD,KAAK,kBAAkB,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAC5B,CAAA;AACD,KAAK,QAAQ,CAAC,CAAC,SAAS,kBAAkB,IAAI;KAC3C,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,CAAA;AAED,cAAM,UAAU,CAAC,CAAC,SAAS,kBAAkB;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,OAAO,CAAC,IAAI,CAAa;gBACb,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAQpC,OAAO,GAAI,IAAI,MAAM,GAAG,MAAM,kBAa7B;IACD,QAAQ,uBAWP;CACF;AAED,KAAK,kBAAkB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM;CAAE,CAAA;AAEhE,wBAAgB,MAAM,CAAC,CAAC,SAAS,kBAAkB,EACjD,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,GACvB,UAAU,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAGvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface DcErrorReportConfig {
|
|
2
|
+
reportUrl: string;
|
|
3
|
+
reportPrefix?: string;
|
|
4
|
+
reportKey?: string;
|
|
5
|
+
otherReportData?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
declare function DcErrorReport(config?: DcErrorReportConfig): void;
|
|
10
|
+
export { DcErrorReport, DcErrorReportConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-report/index.ts"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAA;CACF;AAED,iBAAS,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,QAsDlD;AAED,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./common";
|
|
2
|
+
export * from "./date";
|
|
3
|
+
export * from "./deep";
|
|
4
|
+
export * from "./location";
|
|
5
|
+
export * from "./tree";
|
|
6
|
+
export * from "./uri";
|
|
7
|
+
export * from "./pin-yin";
|
|
8
|
+
export * from "./validate";
|
|
9
|
+
export * from "./storage";
|
|
10
|
+
export * from "./crypt";
|
|
11
|
+
export * from "./requests";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BD09.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/BD09.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMtC,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAWrD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAYrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BD09MC.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/BD09MC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAyFtC,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAUtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAUtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EPSG3857.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/EPSG3857.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAKtD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAmB1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GCJ02.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/GCJ02.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA6CtC,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAQtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAsBtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=WGS84.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WGS84.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/WGS84.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare enum CRSTypes {
|
|
2
|
+
WGS84 = "WGS84",
|
|
3
|
+
WGS1984 = "WGS84",
|
|
4
|
+
EPSG4326 = "WGS84",
|
|
5
|
+
GCJ02 = "GCJ02",
|
|
6
|
+
AMap = "GCJ02",
|
|
7
|
+
BD09 = "BD09",
|
|
8
|
+
BD09LL = "BD09",
|
|
9
|
+
Baidu = "BD09",
|
|
10
|
+
BMap = "BD09",
|
|
11
|
+
BD09MC = "BD09MC",
|
|
12
|
+
BD09Meter = "BD09MC",
|
|
13
|
+
EPSG3857 = "EPSG3857",
|
|
14
|
+
EPSG900913 = "EPSG3857",
|
|
15
|
+
EPSG102100 = "EPSG3857",
|
|
16
|
+
WebMercator = "EPSG3857",
|
|
17
|
+
WM = "EPSG3857"
|
|
18
|
+
}
|
|
19
|
+
export interface CRS {
|
|
20
|
+
to: {
|
|
21
|
+
[key in keyof typeof CRSTypes]?: Function;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const WGS84: CRS;
|
|
25
|
+
export declare const GCJ02: CRS;
|
|
26
|
+
export declare const BD09: CRS;
|
|
27
|
+
export declare const EPSG3857: CRS;
|
|
28
|
+
export declare const BD09MC: CRS;
|
|
29
|
+
export declare const crsMap: Record<CRSTypes, CRS>;
|
|
30
|
+
export default crsMap;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/location/gcoord/crs/index.ts"],"names":[],"mappings":"AAMA,oBAAY,QAAQ;IAElB,KAAK,UAAU;IACf,OAAO,UAAQ;IACf,QAAQ,UAAQ;IAGhB,KAAK,UAAU;IACf,IAAI,UAAQ;IAGZ,IAAI,SAAS;IACb,MAAM,SAAO;IACb,KAAK,SAAO;IACZ,IAAI,SAAO;IAGX,MAAM,WAAW;IACjB,SAAS,WAAS;IAGlB,QAAQ,aAAa;IACrB,UAAU,aAAW;IACrB,UAAU,aAAW;IACrB,WAAW,aAAW;IACtB,EAAE,aAAW;CACd;AAED,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE;SACD,GAAG,IAAI,MAAM,OAAO,QAAQ,CAAC,CAAC,EAAE,QAAQ;KAC1C,CAAC;CACH;AAED,eAAO,MAAM,KAAK,EAAE,GAOnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,GAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,GAOlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,GAYtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,GAYpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,GAAG,CAMxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|