@kevisual/router 0.0.38 → 0.0.39
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/router-browser.d.ts +12 -8
- package/dist/router-browser.js +14 -685
- package/dist/router-sign.js +1 -3
- package/dist/router.d.ts +13 -9
- package/dist/router.js +14 -685
- package/package.json +1 -1
package/dist/router-sign.js
CHANGED
|
@@ -3272,9 +3272,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
3272
3272
|
return new ArrayBuffer(this.valueHexView.byteLength + 1);
|
|
3273
3273
|
}
|
|
3274
3274
|
if (!this.valueHexView.byteLength) {
|
|
3275
|
-
|
|
3276
|
-
empty[0] = 0;
|
|
3277
|
-
return empty.buffer;
|
|
3275
|
+
return EMPTY_BUFFER;
|
|
3278
3276
|
}
|
|
3279
3277
|
const retView = new Uint8Array(this.valueHexView.length + 1);
|
|
3280
3278
|
retView[0] = this.unusedBits;
|
package/dist/router.d.ts
CHANGED
|
@@ -86,14 +86,16 @@ type RouteMiddleware = {
|
|
|
86
86
|
key?: string;
|
|
87
87
|
id?: string;
|
|
88
88
|
} | string;
|
|
89
|
-
type RouteOpts<
|
|
89
|
+
type RouteOpts<T = {}> = {
|
|
90
90
|
path?: string;
|
|
91
91
|
key?: string;
|
|
92
92
|
id?: string;
|
|
93
|
-
run?: Run<
|
|
93
|
+
run?: Run<T>;
|
|
94
94
|
nextRoute?: NextRoute;
|
|
95
95
|
description?: string;
|
|
96
|
-
metadata?:
|
|
96
|
+
metadata?: {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
};
|
|
97
99
|
middleware?: RouteMiddleware[];
|
|
98
100
|
type?: 'route' | 'middleware';
|
|
99
101
|
/**
|
|
@@ -111,7 +113,7 @@ declare const pickValue: readonly ["path", "key", "id", "description", "type", "
|
|
|
111
113
|
type RouteInfo = Pick<Route, (typeof pickValue)[number]>;
|
|
112
114
|
declare class Route<U = {
|
|
113
115
|
[key: string]: any;
|
|
114
|
-
}
|
|
116
|
+
}> {
|
|
115
117
|
/**
|
|
116
118
|
* 一级路径
|
|
117
119
|
*/
|
|
@@ -124,7 +126,9 @@ declare class Route<U = {
|
|
|
124
126
|
run?: Run;
|
|
125
127
|
nextRoute?: NextRoute;
|
|
126
128
|
description?: string;
|
|
127
|
-
metadata?:
|
|
129
|
+
metadata?: {
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
};
|
|
128
132
|
middleware?: RouteMiddleware[];
|
|
129
133
|
type?: string;
|
|
130
134
|
data?: any;
|
|
@@ -252,7 +256,7 @@ declare class QueryRouter {
|
|
|
252
256
|
* @param ctx
|
|
253
257
|
*/
|
|
254
258
|
setContext(ctx: RouteContext): void;
|
|
255
|
-
getList(
|
|
259
|
+
getList(): RouteInfo[];
|
|
256
260
|
/**
|
|
257
261
|
* 获取handle函数, 这里会去执行parse函数
|
|
258
262
|
*/
|
|
@@ -277,13 +281,13 @@ declare class QueryRouter {
|
|
|
277
281
|
}>;
|
|
278
282
|
exportRoutes(): Route<{
|
|
279
283
|
[key: string]: any;
|
|
280
|
-
}
|
|
284
|
+
}>[];
|
|
281
285
|
importRoutes(routes: Route[]): void;
|
|
282
286
|
importRouter(router: QueryRouter): void;
|
|
283
287
|
throw(code?: number | string, message?: string, tips?: string): void;
|
|
284
288
|
hasRoute(path: string, key?: string): Route<{
|
|
285
289
|
[key: string]: any;
|
|
286
|
-
}
|
|
290
|
+
}>;
|
|
287
291
|
createRouteList(force?: boolean): void;
|
|
288
292
|
/**
|
|
289
293
|
* 等待程序运行, 获取到message的数据,就执行
|
|
@@ -720,7 +724,7 @@ declare class App<U = {}> {
|
|
|
720
724
|
}>;
|
|
721
725
|
exportRoutes(): Route<{
|
|
722
726
|
[key: string]: any;
|
|
723
|
-
}
|
|
727
|
+
}>[];
|
|
724
728
|
importRoutes(routes: any[]): void;
|
|
725
729
|
importApp(app: App): void;
|
|
726
730
|
throw(code?: number | string, message?: string, tips?: string): void;
|