UNPKG

@hestjs/core

Version:

HestJS Core Framework - A TypeScript framework built on Hono with dependency injection and decorators

39 lines 1.25 kB
import "reflect-metadata"; declare global { namespace Reflect { function defineMetadata(key: any, value: any, target: any, propertyKey?: string | symbol): void; function getMetadata(key: any, target: any, propertyKey?: string | symbol): any; } } /** * 中间件函数类型 */ export type MiddlewareFunction = (req: any, res: any, next: () => void) => void | Promise<void>; /** * 中间件接口 */ export interface MiddlewareConsumer { apply(...middleware: (MiddlewareFunction | any)[]): MiddlewareConsumer; forRoutes(...routes: (string | any)[]): MiddlewareConsumer; exclude(...routes: (string | any)[]): MiddlewareConsumer; } /** * 中间件装饰器 * @param path 中间件应用的路径 */ export declare function Middleware(path?: string): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => PropertyDescriptor | undefined; /** * 内置 CORS 中间件 */ export declare class CorsMiddleware { private options; constructor(options?: any); use(req: any, res: any, next: () => void): void; } /** * 内置日志中间件 */ export declare class LoggerMiddleware { use(req: any, res: any, next: () => void): void; } //# sourceMappingURL=middleware.d.ts.map