@kevisual/router 0.0.71 → 0.0.73
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/app.d.ts +5 -0
- package/dist/app.js +19518 -0
- package/dist/opencode.d.ts +8 -3
- package/dist/opencode.js +13380 -14323
- package/dist/router-browser.d.ts +25 -21
- package/dist/router-browser.js +14059 -15098
- package/dist/router-define.d.ts +399 -3
- package/dist/router-define.js +126 -124
- package/dist/router-simple.js +665 -759
- package/dist/router.d.ts +25 -21
- package/dist/router.js +17840 -21155
- package/dist/ws.d.ts +8 -3
- package/dist/ws.js +2980 -150
- package/package.json +19 -54
- package/src/app.ts +2 -2
- package/src/browser.ts +1 -1
- package/src/index.ts +1 -1
- package/src/route.ts +30 -15
- package/src/router-define.ts +1 -1
- package/src/utils/random.ts +8 -0
package/dist/opencode.d.ts
CHANGED
|
@@ -170,7 +170,7 @@ declare class Route<U = {
|
|
|
170
170
|
define<T extends {
|
|
171
171
|
[key: string]: any;
|
|
172
172
|
} = RouterContextT>(path: string, key: string, fn: Run<T & U>): this;
|
|
173
|
-
update(opts: DefineRouteOpts,
|
|
173
|
+
update(opts: DefineRouteOpts, onlyUpdateList?: string[]): this;
|
|
174
174
|
addTo(router: QueryRouter | {
|
|
175
175
|
add: (route: Route) => void;
|
|
176
176
|
[key: string]: any;
|
|
@@ -208,7 +208,7 @@ declare class QueryRouter {
|
|
|
208
208
|
* remove route by id
|
|
209
209
|
* @param uniqueId
|
|
210
210
|
*/
|
|
211
|
-
removeById(
|
|
211
|
+
removeById(uniqueId: string): void;
|
|
212
212
|
/**
|
|
213
213
|
* 执行route
|
|
214
214
|
* @param path
|
|
@@ -326,7 +326,11 @@ declare class QueryRouter {
|
|
|
326
326
|
}): Route<{
|
|
327
327
|
[key: string]: any;
|
|
328
328
|
}, SimpleObject>;
|
|
329
|
-
createRouteList(
|
|
329
|
+
createRouteList(opts?: {
|
|
330
|
+
force?: boolean;
|
|
331
|
+
filter?: (route: Route) => boolean;
|
|
332
|
+
middleware?: string[];
|
|
333
|
+
}): void;
|
|
330
334
|
/**
|
|
331
335
|
* 等待程序运行, 获取到message的数据,就执行
|
|
332
336
|
* params 是预设参数
|
|
@@ -343,6 +347,7 @@ declare class QueryRouter {
|
|
|
343
347
|
getList?: boolean;
|
|
344
348
|
force?: boolean;
|
|
345
349
|
filter?: (route: Route) => boolean;
|
|
350
|
+
routeListMiddleware?: string[];
|
|
346
351
|
}): Promise<void>;
|
|
347
352
|
toJSONSchema: (route: RouteInfo) => Pick<RouteInfo, "path" | "key" | "id" | "description" | "type" | "middleware" | "metadata">;
|
|
348
353
|
fromJSONSchema: (route: RouteInfo) => RouteInfo;
|