@d3vtool/ex-frame
Version:
This library enhances Express.js by providing a more organized structure for web API projects, along with improved control and error handling capabilities.
6 lines (5 loc) • 645 B
TypeScript
import { type TConstructor } from "./ex-http-methods";
import { type Request, type Response, type NextFunction, type RequestHandler, type ErrorRequestHandler } from "express";
export declare function Middlewares(...handlers: RequestHandler[]): (targetFn: RequestHandler | TConstructor, _propertyKey?: string, descriptor?: PropertyDescriptor) => void;
export declare function ErrorHandler(handlers: ErrorRequestHandler): (targetFn: RequestHandler | TConstructor, _propertyKey?: string, descriptor?: PropertyDescriptor) => void;
export declare const asyncHandler: (fn: RequestHandler) => (req: Request, res: Response, next: NextFunction) => void;