@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.
- package/dist/router-browser.d.ts +7 -6
- package/dist/router-browser.js +3152 -21606
- package/dist/router.d.ts +4 -4
- package/dist/router.js +3198 -21652
- package/package.json +9 -25
- package/src/route.ts +5 -10
- package/src/sign.ts +1 -1
- package/src/validator/index.ts +4 -1
- package/src/validator/rule.ts +2 -3
- package/dist/router-sign.d.ts +0 -16
- package/dist/router-sign.js +0 -28662
- package/dist/router-simple-lib.d.ts +0 -3
- package/dist/router-simple-lib.js +0 -35
- package/src/io.ts +0 -6
package/dist/router-browser.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
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) =>
|
|
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]:
|
|
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]:
|
|
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 };
|