vafast 0.1.9 → 0.1.10
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/index.d.ts +459 -0
- package/dist/index.js +1346 -55616
- package/package.json +3 -2
- package/dist/main.js +0 -19758
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { Static, TSchema } from "@sinclair/typebox";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
5
|
+
type Handler = (req: Request, params?: Record<string, string>, user?: Record<string, any>) => Response | Promise<Response>;
|
|
6
|
+
type Middleware = (req: Request, next: () => Promise<Response>) => Promise<Response>;
|
|
7
|
+
interface Route {
|
|
8
|
+
method: Method;
|
|
9
|
+
path: string;
|
|
10
|
+
handler: Handler;
|
|
11
|
+
middleware?: Middleware[];
|
|
12
|
+
}
|
|
13
|
+
interface NestedRoute {
|
|
14
|
+
path: string;
|
|
15
|
+
middleware?: Middleware[];
|
|
16
|
+
children?: (NestedRoute | Route)[];
|
|
17
|
+
}
|
|
18
|
+
interface FlattenedRoute extends Route {
|
|
19
|
+
fullPath: string;
|
|
20
|
+
middlewareChain: Middleware[];
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/server/base-server.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* 服务器基类
|
|
26
|
+
* 包含所有服务器类型的公共逻辑
|
|
27
|
+
*/
|
|
28
|
+
declare abstract class BaseServer {
|
|
29
|
+
protected globalMiddleware: Middleware[];
|
|
30
|
+
use(mw: Middleware): void;
|
|
31
|
+
/**
|
|
32
|
+
* 打印扁平化后的路由信息,用于调试
|
|
33
|
+
*/
|
|
34
|
+
protected logFlattenedRoutes(routes: any[], type?: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* 检测路由冲突
|
|
37
|
+
* 检查是否有路径相同但方法不同的路由,以及潜在的路径冲突
|
|
38
|
+
*/
|
|
39
|
+
protected detectRouteConflicts(routes: any[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* 检测动态路由的潜在冲突
|
|
42
|
+
*/
|
|
43
|
+
private detectDynamicRouteConflicts;
|
|
44
|
+
/**
|
|
45
|
+
* 判断两个路径是否可能冲突
|
|
46
|
+
*/
|
|
47
|
+
private pathsMayConflict;
|
|
48
|
+
/**
|
|
49
|
+
* 路径匹配
|
|
50
|
+
*/
|
|
51
|
+
protected matchPath(pattern: string, path: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 提取路径参数
|
|
54
|
+
*/
|
|
55
|
+
protected extractParams(pattern: string, path: string): Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* 处理 OPTIONS 请求
|
|
58
|
+
*/
|
|
59
|
+
protected handleOptions(pathname: string, routes: any[]): Response;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/server/server.d.ts
|
|
63
|
+
declare class Server extends BaseServer {
|
|
64
|
+
private routes;
|
|
65
|
+
constructor(routes: (Route | NestedRoute)[]);
|
|
66
|
+
fetch: (req: Request) => Promise<Response>;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/types/route.d.ts
|
|
70
|
+
interface Middleware$1 {
|
|
71
|
+
(req: Request, next: () => Promise<Response>): Promise<Response>;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/types/component-route.d.ts
|
|
75
|
+
/**
|
|
76
|
+
* 组件路由配置
|
|
77
|
+
* 支持声明式的组件关联
|
|
78
|
+
*/
|
|
79
|
+
interface ComponentRoute {
|
|
80
|
+
path: string;
|
|
81
|
+
component: () => Promise<any>;
|
|
82
|
+
middleware?: Middleware$1[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 嵌套组件路由配置
|
|
86
|
+
*/
|
|
87
|
+
interface NestedComponentRoute {
|
|
88
|
+
path: string;
|
|
89
|
+
middleware?: Middleware$1[];
|
|
90
|
+
children?: (ComponentRoute | NestedComponentRoute)[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 扁平化后的组件路由
|
|
94
|
+
*/
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/utils/dependency-manager.d.ts
|
|
97
|
+
/**
|
|
98
|
+
* 依赖管理器
|
|
99
|
+
* 负责按需加载和管理框架依赖
|
|
100
|
+
*/
|
|
101
|
+
declare class DependencyManager {
|
|
102
|
+
private dependencyCache;
|
|
103
|
+
/**
|
|
104
|
+
* 按需获取框架依赖
|
|
105
|
+
*/
|
|
106
|
+
getFrameworkDeps(framework: "vue" | "react"): Promise<any>;
|
|
107
|
+
/**
|
|
108
|
+
* 检测组件类型
|
|
109
|
+
*/
|
|
110
|
+
detectComponentType(component: any): "vue" | "react";
|
|
111
|
+
/**
|
|
112
|
+
* 清除缓存
|
|
113
|
+
*/
|
|
114
|
+
clearCache(): void;
|
|
115
|
+
/**
|
|
116
|
+
* 获取缓存状态
|
|
117
|
+
*/
|
|
118
|
+
getCacheStatus(): Record<string, boolean>;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/server/component-server.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* 组件路由服务器
|
|
124
|
+
* 专门处理声明式组件路由
|
|
125
|
+
*/
|
|
126
|
+
declare class ComponentServer extends BaseServer {
|
|
127
|
+
private routes;
|
|
128
|
+
private dependencyManager;
|
|
129
|
+
constructor(routes: (ComponentRoute | NestedComponentRoute)[]);
|
|
130
|
+
/**
|
|
131
|
+
* 处理请求
|
|
132
|
+
*/
|
|
133
|
+
fetch(req: Request): Promise<Response>;
|
|
134
|
+
/**
|
|
135
|
+
* 执行中间件链
|
|
136
|
+
*/
|
|
137
|
+
private executeMiddlewareChain;
|
|
138
|
+
/**
|
|
139
|
+
* 渲染 Vue 组件
|
|
140
|
+
*/
|
|
141
|
+
private renderVueComponent;
|
|
142
|
+
/**
|
|
143
|
+
* 渲染 React 组件
|
|
144
|
+
*/
|
|
145
|
+
private renderReactComponent;
|
|
146
|
+
/**
|
|
147
|
+
* 获取依赖管理器(用于外部访问)
|
|
148
|
+
*/
|
|
149
|
+
getDependencyManager(): DependencyManager;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/server/server-factory.d.ts
|
|
153
|
+
/**
|
|
154
|
+
* 服务器工厂类
|
|
155
|
+
* 用于创建和管理不同类型的服务器
|
|
156
|
+
*/
|
|
157
|
+
declare class ServerFactory {
|
|
158
|
+
private servers;
|
|
159
|
+
/**
|
|
160
|
+
* 创建标准REST API服务器
|
|
161
|
+
*/
|
|
162
|
+
createRestServer(routes: (Route | NestedRoute)[]): Server;
|
|
163
|
+
/**
|
|
164
|
+
* 创建组件服务器
|
|
165
|
+
*/
|
|
166
|
+
createComponentServer(routes: (ComponentRoute | NestedComponentRoute)[]): ComponentServer;
|
|
167
|
+
/**
|
|
168
|
+
* 获取指定类型的服务器
|
|
169
|
+
*/
|
|
170
|
+
getServer(type: "rest" | "component"): Server | ComponentServer | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* 获取所有服务器
|
|
173
|
+
*/
|
|
174
|
+
getAllServers(): Map<string, Server | ComponentServer>;
|
|
175
|
+
/**
|
|
176
|
+
* 移除指定类型的服务器
|
|
177
|
+
*/
|
|
178
|
+
removeServer(type: string): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* 清除所有服务器
|
|
181
|
+
*/
|
|
182
|
+
clearServers(): void;
|
|
183
|
+
/**
|
|
184
|
+
* 获取服务器状态信息
|
|
185
|
+
*/
|
|
186
|
+
getServerStatus(): Record<string, {
|
|
187
|
+
type: string;
|
|
188
|
+
routes: number;
|
|
189
|
+
}>;
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/utils/path-matcher.d.ts
|
|
193
|
+
/**
|
|
194
|
+
* 路径匹配工具类
|
|
195
|
+
* 提供统一的路径匹配和参数提取功能
|
|
196
|
+
*/
|
|
197
|
+
declare class PathMatcher {
|
|
198
|
+
/**
|
|
199
|
+
* 路径匹配
|
|
200
|
+
*/
|
|
201
|
+
static matchPath(pattern: string, path: string): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* 提取路径参数
|
|
204
|
+
*/
|
|
205
|
+
static extractParams(pattern: string, path: string): Record<string, string>;
|
|
206
|
+
/**
|
|
207
|
+
* 计算路径特异性分数
|
|
208
|
+
* 用于路由排序:静态 > 动态(:param) > 通配符(*)
|
|
209
|
+
*/
|
|
210
|
+
static calculatePathScore(path: string): number;
|
|
211
|
+
/**
|
|
212
|
+
* 判断两个路径是否可能冲突
|
|
213
|
+
*/
|
|
214
|
+
static pathsMayConflict(path1: string, path2: string): boolean;
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/utils/html-renderer.d.ts
|
|
218
|
+
/**
|
|
219
|
+
* HTML渲染工具类
|
|
220
|
+
* 提供统一的HTML模板生成功能
|
|
221
|
+
*/
|
|
222
|
+
declare class HtmlRenderer {
|
|
223
|
+
/**
|
|
224
|
+
* 生成基础HTML模板
|
|
225
|
+
*/
|
|
226
|
+
static generateBaseHtml(content: string, context: any, clientScriptPath?: string): string;
|
|
227
|
+
/**
|
|
228
|
+
* 生成Vue组件HTML
|
|
229
|
+
*/
|
|
230
|
+
static generateVueHtml(content: string, context: any, clientScriptPath?: string): string;
|
|
231
|
+
/**
|
|
232
|
+
* 生成React组件HTML
|
|
233
|
+
*/
|
|
234
|
+
static generateReactHtml(content: string, context: any, clientScriptPath?: string): string;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/middleware.d.ts
|
|
238
|
+
/** 中间件类型:使用 next() 传递给下一个处理 */
|
|
239
|
+
/** Vafast 自定义错误类型 */
|
|
240
|
+
declare class VafastError extends Error {
|
|
241
|
+
status: number;
|
|
242
|
+
type: string;
|
|
243
|
+
expose: boolean;
|
|
244
|
+
constructor(message: string, options?: {
|
|
245
|
+
status?: number;
|
|
246
|
+
type?: string;
|
|
247
|
+
expose?: boolean;
|
|
248
|
+
cause?: unknown;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* 组合类型: 自动注入错误处理器进行中间件组合
|
|
253
|
+
*/
|
|
254
|
+
declare function composeMiddleware(middleware: Middleware[], finalHandler: Handler): Handler;
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/utils/parsers.d.ts
|
|
257
|
+
interface FileInfo {
|
|
258
|
+
name: string;
|
|
259
|
+
type: string;
|
|
260
|
+
size: number;
|
|
261
|
+
data: ArrayBuffer;
|
|
262
|
+
}
|
|
263
|
+
interface FormData {
|
|
264
|
+
fields: Record<string, string>;
|
|
265
|
+
files: Record<string, FileInfo>;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* 简化的请求体解析函数
|
|
269
|
+
* 优先简洁性,处理最常见的场景
|
|
270
|
+
*/
|
|
271
|
+
declare function parseBody(req: Request): Promise<unknown>;
|
|
272
|
+
/**
|
|
273
|
+
* 解析请求体为特定类型
|
|
274
|
+
* 提供类型安全的解析方法
|
|
275
|
+
*/
|
|
276
|
+
declare function parseBodyAs<T>(req: Request): Promise<T>;
|
|
277
|
+
/**
|
|
278
|
+
* 解析请求体为表单数据
|
|
279
|
+
* 专门用于处理 multipart/form-data
|
|
280
|
+
*/
|
|
281
|
+
declare function parseFormData(req: Request): Promise<FormData>;
|
|
282
|
+
/**
|
|
283
|
+
* 解析请求体为文件
|
|
284
|
+
* 专门用于处理文件上传
|
|
285
|
+
*/
|
|
286
|
+
declare function parseFile(req: Request): Promise<FileInfo>;
|
|
287
|
+
/** 获取查询字符串,直接返回对象 */
|
|
288
|
+
declare function parseQuery(req: Request): Record<string, any>;
|
|
289
|
+
/** 解析请求头,返回对象 */
|
|
290
|
+
declare function parseHeaders(req: Request): Record<string, string>;
|
|
291
|
+
/** 使用cookie库解析Cookie,保证可靠性 */
|
|
292
|
+
declare function parseCookies(req: Request): Record<string, string>;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/utils/response.d.ts
|
|
295
|
+
/** 生成 JSON 响应 */
|
|
296
|
+
declare function json(data: unknown, status?: number, headers?: HeadersInit): Response;
|
|
297
|
+
/** 生成重定向响应 */
|
|
298
|
+
declare function redirect(location: string, status?: 301 | 302): Response;
|
|
299
|
+
/** 生成纯文本响应 */
|
|
300
|
+
declare function text(content: string, status?: number, headers?: HeadersInit): Response;
|
|
301
|
+
/** 生成HTML响应 */
|
|
302
|
+
declare function html(content: string, status?: number, headers?: HeadersInit): Response;
|
|
303
|
+
/** 生成空响应(204 No Content) */
|
|
304
|
+
declare function empty(status?: number, headers?: HeadersInit): Response;
|
|
305
|
+
/** 生成流式响应 */
|
|
306
|
+
declare function stream(stream: ReadableStream, status?: number, headers?: HeadersInit): Response;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/router.d.ts
|
|
309
|
+
interface MatchResult {
|
|
310
|
+
matched: boolean;
|
|
311
|
+
params: Record<string, string>;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* 扁平化嵌套路由,计算完整路径和中间件链
|
|
315
|
+
*/
|
|
316
|
+
declare function flattenNestedRoutes(routes: (Route | NestedRoute)[]): FlattenedRoute[];
|
|
317
|
+
/**
|
|
318
|
+
* 标准化路径:去重斜杠、解码URL、处理结尾斜杠
|
|
319
|
+
*/
|
|
320
|
+
declare function normalizePath(path: string): string;
|
|
321
|
+
/**
|
|
322
|
+
* 匹配函数:支持动态路由和路径标准化
|
|
323
|
+
*/
|
|
324
|
+
declare function matchPath(pattern: string, path: string): MatchResult;
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/middleware/authMiddleware.d.ts
|
|
327
|
+
declare const requireAuth: Middleware;
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/middleware/rateLimit.d.ts
|
|
330
|
+
interface RateLimitOptions {
|
|
331
|
+
windowMs?: number;
|
|
332
|
+
max?: number;
|
|
333
|
+
keyFn?: (req: Request) => string;
|
|
334
|
+
}
|
|
335
|
+
declare function rateLimit(options?: RateLimitOptions): Middleware;
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region src/middleware/cors.d.ts
|
|
338
|
+
interface CORSOptions {
|
|
339
|
+
origin?: string[] | "*";
|
|
340
|
+
methods?: string[];
|
|
341
|
+
headers?: string[];
|
|
342
|
+
credentials?: boolean;
|
|
343
|
+
maxAge?: number;
|
|
344
|
+
}
|
|
345
|
+
declare function createCORS(options?: CORSOptions): Middleware;
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/auth/token.d.ts
|
|
348
|
+
interface TokenPayload {
|
|
349
|
+
[key: string]: any;
|
|
350
|
+
exp?: number;
|
|
351
|
+
iat?: number;
|
|
352
|
+
sub?: string;
|
|
353
|
+
aud?: string;
|
|
354
|
+
iss?: string;
|
|
355
|
+
}
|
|
356
|
+
interface TokenResult {
|
|
357
|
+
payload: TokenPayload;
|
|
358
|
+
token: string;
|
|
359
|
+
expiresAt: number;
|
|
360
|
+
}
|
|
361
|
+
interface TokenOptions {
|
|
362
|
+
expiresIn?: number;
|
|
363
|
+
issuer?: string;
|
|
364
|
+
audience?: string;
|
|
365
|
+
subject?: string;
|
|
366
|
+
}
|
|
367
|
+
declare class TokenError extends Error {
|
|
368
|
+
code: "INVALID_TOKEN" | "EXPIRED_TOKEN" | "INVALID_SIGNATURE" | "MALFORMED_TOKEN" | "INVALID_PAYLOAD";
|
|
369
|
+
constructor(message: string, code: "INVALID_TOKEN" | "EXPIRED_TOKEN" | "INVALID_SIGNATURE" | "MALFORMED_TOKEN" | "INVALID_PAYLOAD");
|
|
370
|
+
}
|
|
371
|
+
/** 生成令牌 */
|
|
372
|
+
declare function generateToken(payload: TokenPayload, secret: string, options?: TokenOptions): Promise<TokenResult>;
|
|
373
|
+
/** 验证令牌 */
|
|
374
|
+
declare function verifyToken(token: string, secret: string): Promise<TokenPayload | null>;
|
|
375
|
+
/** 解析令牌(不验证签名) */
|
|
376
|
+
declare function parseToken(token: string): TokenPayload | null;
|
|
377
|
+
/** 检查令牌是否过期 */
|
|
378
|
+
declare function isTokenExpired(token: string): boolean;
|
|
379
|
+
/** 获取令牌剩余有效时间(秒) */
|
|
380
|
+
declare function getTokenTimeRemaining(token: string): number;
|
|
381
|
+
/** 刷新令牌 */
|
|
382
|
+
declare function refreshToken(token: string, secret: string, options?: TokenOptions): Promise<TokenResult | null>;
|
|
383
|
+
/** 创建访问令牌和刷新令牌对 */
|
|
384
|
+
declare function createTokenPair(payload: TokenPayload, secret: string, options?: TokenOptions): Promise<{
|
|
385
|
+
accessToken: TokenResult;
|
|
386
|
+
refreshToken: TokenResult;
|
|
387
|
+
}>;
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/middleware/auth.d.ts
|
|
390
|
+
interface AuthOptions {
|
|
391
|
+
secret: string;
|
|
392
|
+
cookieName?: string;
|
|
393
|
+
headerName?: string;
|
|
394
|
+
required?: boolean;
|
|
395
|
+
roles?: string[];
|
|
396
|
+
permissions?: string[];
|
|
397
|
+
}
|
|
398
|
+
declare function createAuth(options: AuthOptions): Middleware;
|
|
399
|
+
declare function createOptionalAuth(options: Omit<AuthOptions, "required">): Middleware;
|
|
400
|
+
declare function createRoleAuth(roles: string[], options: Omit<AuthOptions, "roles">): Middleware;
|
|
401
|
+
declare function createPermissionAuth(permissions: string[], options: Omit<AuthOptions, "permissions">): Middleware;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/utils/base64url.d.ts
|
|
404
|
+
declare function base64urlEncode(str: string): string;
|
|
405
|
+
declare function base64urlDecode(str: string): string;
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/defineRoute.d.ts
|
|
408
|
+
declare function defineRoutes(routes: Route[]): Route[];
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/utils/validators/schema-validators-ultra.d.ts
|
|
411
|
+
interface SchemaConfig {
|
|
412
|
+
body?: TSchema;
|
|
413
|
+
query?: TSchema;
|
|
414
|
+
params?: TSchema;
|
|
415
|
+
headers?: TSchema;
|
|
416
|
+
cookies?: TSchema;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/utils/route-handler-factory.d.ts
|
|
420
|
+
interface TypedConfig extends SchemaConfig {
|
|
421
|
+
docs?: any;
|
|
422
|
+
timeout?: number;
|
|
423
|
+
maxBodySize?: string;
|
|
424
|
+
validationErrorHandler?: ValidationErrorHandler;
|
|
425
|
+
[key: string]: any;
|
|
426
|
+
}
|
|
427
|
+
type ValidationErrorHandler = (error: Error, field: string, value: any, schema: any) => Response | Promise<Response>;
|
|
428
|
+
type TypedHandler<TBody = any, TQuery = any, TParams = any, THeaders = any, TCookies = any, TExtra extends object = {}> = (ctx: {
|
|
429
|
+
req: Request;
|
|
430
|
+
body: TBody;
|
|
431
|
+
query: TQuery;
|
|
432
|
+
params: TParams;
|
|
433
|
+
headers: THeaders;
|
|
434
|
+
cookies: TCookies;
|
|
435
|
+
} & TExtra) => Response | Promise<Response> | any | Promise<any>;
|
|
436
|
+
declare function createRouteHandler<TConfig extends TypedConfig, TBody = (TConfig extends {
|
|
437
|
+
body: any;
|
|
438
|
+
} ? Static<TConfig["body"]> : any), TQuery = (TConfig extends {
|
|
439
|
+
query: any;
|
|
440
|
+
} ? Static<TConfig["query"]> : any), TParams = (TConfig extends {
|
|
441
|
+
params: any;
|
|
442
|
+
} ? Static<TConfig["params"]> : any), THeaders = (TConfig extends {
|
|
443
|
+
headers: any;
|
|
444
|
+
} ? Static<TConfig["headers"]> : any), TCookies = (TConfig extends {
|
|
445
|
+
cookies: any;
|
|
446
|
+
} ? Static<TConfig["cookies"]> : any), TExtra extends object = {}>(handler: TypedHandler<TBody, TQuery, TParams, THeaders, TCookies, TExtra>, config?: TConfig): (req: Request) => Promise<Response>;
|
|
447
|
+
declare function withExtra<TExtra extends object = {}>(): <TConfig extends TypedConfig>(config: TConfig, handler: TypedHandler<TConfig extends {
|
|
448
|
+
body: any;
|
|
449
|
+
} ? Static<TConfig["body"]> : any, TConfig extends {
|
|
450
|
+
query: any;
|
|
451
|
+
} ? Static<TConfig["query"]> : any, TConfig extends {
|
|
452
|
+
params: any;
|
|
453
|
+
} ? Static<TConfig["params"]> : any, TConfig extends {
|
|
454
|
+
headers: any;
|
|
455
|
+
} ? Static<TConfig["headers"]> : any, TConfig extends {
|
|
456
|
+
cookies: any;
|
|
457
|
+
} ? Static<TConfig["cookies"]> : any, TExtra>) => (req: Request) => Promise<Response>;
|
|
458
|
+
//#endregion
|
|
459
|
+
export { BaseServer, CORSOptions, ComponentServer, DependencyManager, FileInfo, FlattenedRoute, FormData, Handler, HtmlRenderer, MatchResult, Method, Middleware, NestedRoute, PathMatcher, Route, Server, ServerFactory, TokenError, TokenOptions, TokenPayload, TokenResult, TypedConfig, TypedHandler, VafastError, ValidationErrorHandler, base64urlDecode, base64urlEncode, composeMiddleware, createAuth, createCORS, createOptionalAuth, createPermissionAuth, createRoleAuth, createRouteHandler, createTokenPair, defineRoutes, empty, flattenNestedRoutes, generateToken, getTokenTimeRemaining, html, isTokenExpired, json, matchPath, normalizePath, parseBody, parseBodyAs, parseCookies, parseFile, parseFormData, parseHeaders, parseQuery, parseToken, rateLimit, redirect, refreshToken, requireAuth, stream, text, verifyToken, withExtra };
|