@kevisual/router 0.0.22 → 0.0.24

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.
@@ -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
- setContext(ctx: RouteContext): Promise<void>;
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
- export { CustomError, QueryRouter, QueryRouterServer, QueryUtil, Route, createSchema, define, parseBody, parseSearch, parseSearchValue, util };
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 };