@kevisual/router 0.0.22 → 0.0.23
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 +10 -3
- package/dist/router-browser.js +17439 -530
- package/dist/router-sign.d.ts +1 -0
- package/dist/router-sign.js +15 -7
- package/dist/router.d.ts +8 -2
- package/dist/router.js +17446 -533
- package/package.json +11 -8
- package/src/app-browser.ts +5 -0
- package/src/app.ts +6 -0
- package/src/browser.ts +3 -1
- package/src/route.ts +8 -3
- package/src/sign.ts +22 -9
- package/src/test/static.ts +22 -0
- package/src/utils/is-engine.ts +15 -0
- package/src/validator/index.ts +2 -1
package/dist/router-browser.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ type RouteContext<T = {
|
|
|
105
105
|
}) => Promise<any>;
|
|
106
106
|
index?: number;
|
|
107
107
|
throw?: (code?: number | string, message?: string, tips?: string) => void;
|
|
108
|
-
/**
|
|
108
|
+
/** 是否需要序列化, 使用JSON.stringify和JSON.parse */
|
|
109
109
|
needSerialize?: boolean;
|
|
110
110
|
} & T;
|
|
111
111
|
type SimpleObject$1 = Record<string, any>;
|
|
@@ -322,7 +322,12 @@ declare class QueryRouter {
|
|
|
322
322
|
data: any;
|
|
323
323
|
message: any;
|
|
324
324
|
}>;
|
|
325
|
-
|
|
325
|
+
/**
|
|
326
|
+
* 设置上下文
|
|
327
|
+
* @description 这里的上下文是为了在handle函数中使用
|
|
328
|
+
* @param ctx
|
|
329
|
+
*/
|
|
330
|
+
setContext(ctx: RouteContext): void;
|
|
326
331
|
getList(): RouteInfo[];
|
|
327
332
|
/**
|
|
328
333
|
* 获取handle函数, 这里会去执行parse函数
|
|
@@ -505,5 +510,7 @@ declare class QueryUtil<T extends RouteObject = RouteObject> {
|
|
|
505
510
|
get routeObject(): T;
|
|
506
511
|
}
|
|
507
512
|
|
|
508
|
-
|
|
513
|
+
declare const App: typeof QueryRouterServer;
|
|
514
|
+
|
|
515
|
+
export { App, CustomError, QueryRouter, QueryRouterServer, QueryUtil, Route, createSchema, define, parseBody, parseSearch, parseSearchValue, util };
|
|
509
516
|
export type { RouteArray, RouteContext, RouteObject, RouteOpts, Rule, Run };
|