@kevisual/router 0.0.25 → 0.0.26-alpha

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.
@@ -1,5 +1,4 @@
1
- import { Schema } from 'zod';
2
- export { Schema } from 'zod';
1
+ import { z } from 'zod';
3
2
  import * as querystring from 'querystring';
4
3
  import { IncomingMessage } from 'node:http';
5
4
  import { RouteOpts as RouteOpts$1, QueryRouterServer as QueryRouterServer$1, RouteMiddleware as RouteMiddleware$1, Run as Run$1 } from '@kevisual/router';
@@ -38,7 +37,9 @@ type RuleAny = {
38
37
  type: 'any';
39
38
  } & BaseRule;
40
39
  type Rule = RuleString | RuleNumber | RuleBoolean | RuleArray | RuleObject | RuleAny;
41
- declare const createSchema: (rule: Rule) => Schema;
40
+ declare const createSchema: (rule: Rule) => z.ZodType<any, any, any>;
41
+
42
+ type Schema = z.ZodType<any, any, any>;
42
43
 
43
44
  type RouterContextT = {
44
45
  code?: number;
@@ -140,7 +141,7 @@ type RouteOpts = {
140
141
  [key: string]: Rule;
141
142
  };
142
143
  schema?: {
143
- [key: string]: Schema<any>;
144
+ [key: string]: any;
144
145
  };
145
146
  isVerify?: boolean;
146
147
  verify?: (ctx?: RouteContext, dev?: boolean) => boolean;
@@ -181,7 +182,7 @@ declare class Route<U = {
181
182
  type?: string;
182
183
  private _validator?;
183
184
  schema?: {
184
- [key: string]: Schema<any>;
185
+ [key: string]: any;
185
186
  };
186
187
  data?: any;
187
188
  /**
@@ -513,4 +514,4 @@ declare class QueryUtil<T extends RouteObject = RouteObject> {
513
514
  declare const App: typeof QueryRouterServer;
514
515
 
515
516
  export { App, CustomError, QueryRouter, QueryRouterServer, QueryUtil, Route, createSchema, define, parseBody, parseSearch, parseSearchValue, util };
516
- export type { RouteArray, RouteContext, RouteObject, RouteOpts, Rule, Run };
517
+ export type { RouteArray, RouteContext, RouteObject, RouteOpts, Rule, Run, Schema };