@onekeyfe/hd-shared 0.3.29 → 0.3.31
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/HardwareError.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export interface IHardwareError {
|
|
|
3
3
|
message?: string;
|
|
4
4
|
params?: any;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type ValueOf<P extends object> = P[keyof P];
|
|
7
|
+
type HardwareErrorCodeMessageMapping = {
|
|
8
8
|
[P in ValueOf<typeof HardwareErrorCode>]: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type ErrorCodeUnion = ValueOf<typeof HardwareErrorCode>;
|
|
11
11
|
export declare class HardwareError extends Error {
|
|
12
12
|
errorCode: ErrorCodeUnion;
|
|
13
13
|
message: string;
|
|
@@ -88,7 +88,7 @@ export declare const HardwareErrorCode: {
|
|
|
88
88
|
readonly LowlevelTrasnportConnectError: 900;
|
|
89
89
|
};
|
|
90
90
|
export declare const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping;
|
|
91
|
-
export declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string
|
|
91
|
+
export declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string, params?: any) => HardwareError;
|
|
92
92
|
export declare const serializeError: (payload: any) => any;
|
|
93
93
|
export declare const CreateErrorByMessage: (message: string) => HardwareError;
|
|
94
94
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HardwareError.d.ts","sourceRoot":"","sources":["../src/HardwareError.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,
|
|
1
|
+
{"version":3,"file":"HardwareError.d.ts","sourceRoot":"","sources":["../src/HardwareError.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,KAAK,OAAO,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE5C,KAAK,+BAA+B,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,OAAO,iBAAiB,CAAC,GAAG,MAAM;CAAE,CAAC;AAE5F,KAAK,cAAc,GAAG,OAAO,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAOxD,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAS,EAAE,cAAc,CAAkC;IAE3D,OAAO,SAAM;IAEb,MAAM,EAAE,GAAG,CAAM;gBAEL,aAAa,EAAE,cAAc,GAAG,MAAM;CAmBnD;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0SpB,CAAC;AAEX,eAAO,MAAM,wBAAwB,EAAE,+BA+G7B,CAAC;AAEX,eAAO,MAAM,UAAU,kBACN,cAAc,GAAG,MAAM,YAC5B,MAAM,WACP,GAAG,kBAMb,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,GAAG,QAY1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,MAAM,KAAG,aAOtD,CAAC"}
|
package/dist/deferred.d.ts
CHANGED
package/dist/deferred.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferred.d.ts","sourceRoot":"","sources":["../src/deferred.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"deferred.d.ts","sourceRoot":"","sources":["../src/deferred.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,IAAI;IAC1C,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CAC5B,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CA0BxF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type Deferred<T, I = any, D = any> = {
|
|
2
2
|
id?: I;
|
|
3
3
|
data?: D;
|
|
4
4
|
promise: Promise<T>;
|
|
@@ -12,11 +12,11 @@ interface IHardwareError {
|
|
|
12
12
|
message?: string;
|
|
13
13
|
params?: any;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
type ValueOf<P extends object> = P[keyof P];
|
|
16
|
+
type HardwareErrorCodeMessageMapping = {
|
|
17
17
|
[P in ValueOf<typeof HardwareErrorCode>]: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type ErrorCodeUnion = ValueOf<typeof HardwareErrorCode>;
|
|
20
20
|
declare class HardwareError extends Error {
|
|
21
21
|
errorCode: ErrorCodeUnion;
|
|
22
22
|
message: string;
|
|
@@ -97,7 +97,7 @@ declare const HardwareErrorCode: {
|
|
|
97
97
|
readonly LowlevelTrasnportConnectError: 900;
|
|
98
98
|
};
|
|
99
99
|
declare const HardwareErrorCodeMessage: HardwareErrorCodeMessageMapping;
|
|
100
|
-
declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string
|
|
100
|
+
declare const TypedError: (hardwareError: ErrorCodeUnion | string, message?: string, params?: any) => HardwareError;
|
|
101
101
|
declare const serializeError: (payload: any) => any;
|
|
102
102
|
declare const CreateErrorByMessage: (message: string) => HardwareError;
|
|
103
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.31",
|
|
4
4
|
"description": "Hardware SDK's shared tool library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Hardware-SDK",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"lint": "eslint .",
|
|
26
26
|
"lint:fix": "eslint . --fix"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "75a2c413110960f086b1d3e3ac81134711c0be9f"
|
|
29
29
|
}
|