@kevisual/router 0.2.2 → 0.2.4

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.
@@ -171,7 +171,7 @@ declare class Route<M extends SimpleObject = SimpleObject, U extends SimpleObjec
171
171
  description?: string;
172
172
  metadata?: M;
173
173
  middleware?: RouteMiddleware[];
174
- type?: string;
174
+ type?: string | undefined;
175
175
  /**
176
176
  * 是否开启debug,开启后会打印错误信息
177
177
  */
@@ -269,7 +269,7 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
269
269
  [key: string]: any;
270
270
  }> | {
271
271
  code: number;
272
- body: any;
272
+ body: null;
273
273
  message: string;
274
274
  }>;
275
275
  /**
@@ -287,9 +287,9 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
287
287
  }, ctx?: RouteContext & {
288
288
  [key: string]: any;
289
289
  }): Promise<{
290
- code: number;
291
- data: any;
292
- message: string;
290
+ code: number | undefined;
291
+ data: string | number | Object | null | undefined;
292
+ message: string | undefined;
293
293
  }>;
294
294
  /**
295
295
  * Router Run获取数据
@@ -305,9 +305,9 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
305
305
  }, ctx?: RouteContext<T> & {
306
306
  [key: string]: any;
307
307
  }): Promise<{
308
- code: number;
309
- data: any;
310
- message: string;
308
+ code: number | undefined;
309
+ data: string | number | Object | null | undefined;
310
+ message: string | undefined;
311
311
  }>;
312
312
  /**
313
313
  * 设置上下文
@@ -342,12 +342,12 @@ declare class QueryRouter<T extends SimpleObject = SimpleObject> implements thro
342
342
  importRoutes(routes: Route[]): void;
343
343
  importRouter(router: QueryRouter): void;
344
344
  throw(...args: any[]): void;
345
- hasRoute(path: string, key?: string): Route<SimpleObject, SimpleObject>;
345
+ hasRoute(path: string, key?: string): Route<SimpleObject, SimpleObject> | undefined;
346
346
  findRoute(opts?: {
347
347
  path?: string;
348
348
  key?: string;
349
349
  rid?: string;
350
- }): Route<SimpleObject, SimpleObject>;
350
+ }): Route<SimpleObject, SimpleObject> | undefined;
351
351
  createRouteList(opts?: {
352
352
  force?: boolean;
353
353
  filter?: (route: Route) => boolean;
@@ -791,10 +791,7 @@ declare class App<U = {}> extends QueryRouterServer<AppRouteContext<U>> {
791
791
  listen(handle: any, backlog?: number, listeningListener?: () => void): void;
792
792
  listen(handle: any, listeningListener?: () => void): void;
793
793
  Route: typeof Route;
794
- static handleRequest(req: IncomingMessage$1, res: ServerResponse$1): Promise<{
795
- cookies: Record<string, string>;
796
- token: string;
797
- }>;
794
+ static handleRequest(req: IncomingMessage$1, res: ServerResponse$1): Promise<any>;
798
795
  onServerRequest(fn: (req: IncomingMessage$1, res: ServerResponse$1) => void): void;
799
796
  }
800
797