import type { SharedState } from "./shared-state.js"; export type RouteMethod = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "*"; export interface RouteContext { req: TReq; res: TRes; path: string; query: URLSearchParams; body: unknown; state: TState; } export type RouteHandler = (ctx: RouteContext) => Promise | void; export interface RouteDefinition { method: RouteMethod; pattern: string; handler: RouteHandler; description?: string; } export interface Router { add: (method: RouteMethod, pattern: string, handler: RouteHandler, description?: string) => void; match: (method: string, path: string) => RouteDefinition | undefined; routes: () => readonly RouteDefinition[]; } export declare function createRouter(): Router;