import { IncomingMessage, ServerResponse } from "node:http"; export interface Request extends Omit { url: { pathname: string; split: string[]; searchParams: URLSearchParams; qs: Record; }; cookies?: Record; params?: Record; post?: Record; } export interface Response extends ServerResponse { reply: (options: { code?: number; type?: string; body: string }) => void; json: (body: string, code?: number) => void; html: (body: string, code?: number) => void; redirect: (target: string, code?: number) => void; } export type Handler = (req: Request, res: Response, next?: () => void) => void | Promise;