@kevisual/router 0.0.26-alpha.5 → 0.0.27

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