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