import { ClearHttpContext } from "../Contracts.mjs"; import { Response } from "../core/Response.mjs"; import { ClassMiddleware, ControllerHandler } from "./basic.mjs"; import { Request } from "../core/Request.mjs"; import { Context, HonoRequest, MiddlewareHandler } from "hono"; //#region src/types/hono.d.ts type RequestWithGetBody = HonoRequest & { getBody: () => Record; }; interface HttpContext extends Context, ClearHttpContext { req: RequestWithGetBody; clearRequest: Request; clearResponse: Response; } type RouteHandler = (ctx: HttpContext, req: Request) => any | Promise; type Handler = RouteHandler | ControllerHandler; type NextFunction = () => Promise; type MiddlewareFunction = MiddlewareHandler; type Middleware = MiddlewareFunction | ClassMiddleware; type HonoApp = { [K in 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head']: (path: string, ...handlers: MiddlewareFunction[]) => any }; //#endregion export { Handler, HonoApp, HttpContext, Middleware, MiddlewareFunction, NextFunction, RequestWithGetBody, RouteHandler };