@kevisual/router 0.0.21-beta → 0.0.22

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.d.ts CHANGED
@@ -5,6 +5,7 @@ import https from 'node:https';
5
5
  import http2 from 'node:http2';
6
6
  import * as cookie from 'cookie';
7
7
  import { WebSocketServer, WebSocket } from 'ws';
8
+ import { IncomingMessage as IncomingMessage$1, ServerResponse as ServerResponse$1 } from 'http';
8
9
  import { RouteOpts as RouteOpts$1, QueryRouterServer as QueryRouterServer$1, RouteMiddleware as RouteMiddleware$1, Run as Run$1 } from '@kevisual/router';
9
10
  import { Query, DataOpts, Result } from '@kevisual/query/query';
10
11
 
@@ -15,8 +16,8 @@ type BaseRule = {
15
16
  };
16
17
  type RuleString = {
17
18
  type: 'string';
18
- minLength?: number;
19
- maxLength?: number;
19
+ min?: number;
20
+ max?: number;
20
21
  regex?: string;
21
22
  } & BaseRule;
22
23
  type RuleNumber = {
@@ -30,8 +31,6 @@ type RuleBoolean = {
30
31
  type RuleArray = {
31
32
  type: 'array';
32
33
  items: Rule;
33
- minItems?: number;
34
- maxItems?: number;
35
34
  } & BaseRule;
36
35
  type RuleObject = {
37
36
  type: 'object';
@@ -716,6 +715,10 @@ declare class App<T = {}, U = AppReqRes> {
716
715
  importRoutes(routes: any[]): void;
717
716
  importApp(app: App): void;
718
717
  throw(code?: number | string, message?: string, tips?: string): void;
718
+ static handleRequest(req: IncomingMessage$1, res: ServerResponse$1): Promise<{
719
+ cookies: Record<string, string>;
720
+ token: string;
721
+ }>;
719
722
  }
720
723
 
721
724
  export { App, Connect, CustomError, QueryConnect, QueryRouter, QueryRouterServer, QueryUtil, Route, Server, createSchema, define, handleServer, util };