@merkur/plugin-error 0.44.0 → 0.45.1
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/package.json +6 -5
- package/types.d.ts +27 -0
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkur/plugin-error",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.1",
|
|
4
4
|
"description": "Merkur plugin for error handling.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
7
|
+
"types": "./types.d.ts",
|
|
7
8
|
"unpkg": "lib/index.umd.js",
|
|
8
9
|
"sideEffects": false,
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
12
|
+
"types": "./types.d.ts",
|
|
11
13
|
"import": "./lib/index.mjs",
|
|
12
14
|
"require": "./lib/index.cjs"
|
|
13
15
|
},
|
|
14
16
|
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
|
|
15
17
|
"./lib/index.es9.cjs": "./lib/index.es9.cjs",
|
|
16
18
|
"./server": "./server/index.js",
|
|
17
|
-
"./server/": "./server/index.js",
|
|
18
19
|
"./server/index.js": "./server/index.js"
|
|
19
20
|
},
|
|
20
21
|
"browser": {
|
|
@@ -50,12 +51,12 @@
|
|
|
50
51
|
},
|
|
51
52
|
"homepage": "https://merkur.js.org/",
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"@merkur/core": "^0.
|
|
54
|
-
"@merkur/plugin-component": "^0.
|
|
54
|
+
"@merkur/core": "^0.45.1",
|
|
55
|
+
"@merkur/plugin-component": "^0.45.1"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@merkur/core": "*",
|
|
58
59
|
"@merkur/plugin-component": "*"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "2a9745c5050c06d43d268c2fdbcb0d2b7f3fb75b"
|
|
61
62
|
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Widget, WidgetPlugin } from '@merkur/core';
|
|
2
|
+
|
|
3
|
+
export interface ErrorEvents {
|
|
4
|
+
ERROR: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ERROR_EVENTS: ErrorEvents;
|
|
8
|
+
|
|
9
|
+
export interface ErrorWidgetState {
|
|
10
|
+
error: {
|
|
11
|
+
status: number | null;
|
|
12
|
+
message: string | null;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface GenericErrorParams {
|
|
17
|
+
status?: number;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class GenericError extends Error {
|
|
22
|
+
constructor(message: string, params?: GenericErrorParams);
|
|
23
|
+
status: number;
|
|
24
|
+
readonly params: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function errorPlugin(): WidgetPlugin;
|