import { ErrorRequestHandler, NextFunction, Request, Response } from 'express'; export declare type AsyncRequestHandler = (req: Request, res: Response, next: NextFunction) => Promise; /** * Wraps an async handler in a promise and on catch sends it to the error handler, or next if there is none given * * @example * * app.get('path', asyncHandler(async function(req, res, next) { * // ... * })) * * @param handler * @param errorHandler */ export declare function asyncHandler(handler: AsyncRequestHandler, errorHandler?: ErrorRequestHandler): (req: Request, res: Response, next: NextFunction) => void;