import { type RouteMeta, type RouteMetaInput } from './RouteRegistry';
import type { IRequest } from '../http/Request';
import type { IResponse } from '../http/Response';
/**
 * Router - HTTP Routing Engine
 * Matches incoming requests to route handlers
 */
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
export type RouteOptions<MiddlewareName extends string = string> = {
    middleware?: ReadonlyArray<MiddlewareName>;
    meta?: RouteMetaInput;
};
export interface RouteMatch {
    handler: RouteHandler;
    params: Record<string, string>;
    middleware?: string[];
    meta?: RouteMeta;
    routePath?: string;
}
export interface Route {
    method: string;
    path: string;
    pattern: RegExp;
    handler: RouteHandler;
    paramNames: string[];
    middleware?: string[];
    meta?: RouteMeta;
}
export type RouteGroupCallback = (router: IRouter) => void;
export type GroupOptions<MiddlewareName extends string = string> = {
    middleware?: ReadonlyArray<MiddlewareName>;
};
export interface ResourceController {
    index?: RouteHandler;
    show?: RouteHandler;
    store?: RouteHandler;
    update?: RouteHandler;
    destroy?: RouteHandler;
}
export type ResourceOptions<MiddlewareName extends string = string> = RouteOptions<MiddlewareName> & {
    index?: RouteOptions<MiddlewareName>;
    show?: RouteOptions<MiddlewareName>;
    store?: RouteOptions<MiddlewareName>;
    update?: RouteOptions<MiddlewareName>;
    destroy?: RouteOptions<MiddlewareName>;
};
export type IRouter = {
    routes: Route[];
    prefix: string;
    routeIndex: Map<string, Route[]>;
    inheritedMiddleware?: ReadonlyArray<string>;
};
export declare const createRouter: () => IRouter;
/**
 * Router - Sealed namespace for HTTP routing
 * All operations grouped in frozen namespace to prevent mutation
 */
export declare const Router: Readonly<{
    createRouter: () => IRouter;
    scopeRouter: (router: IRouter, prefix: string, inheritedMiddleware?: ReadonlyArray<string>) => IRouter;
    group: <M extends string = string>(router: IRouter, prefix: string, callback: RouteGroupCallback, options?: GroupOptions<M>) => void;
    resource: <M extends string = string>(router: IRouter, path: string, controller: ResourceController, options?: ResourceOptions<M>) => void;
    get: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    post: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    put: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    patch: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    del: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    any: <M extends string = string>(router: IRouter, path: string, handler: RouteHandler, options?: RouteOptions<M>) => void;
    match: (router: IRouter, method: string, path: string) => RouteMatch | null;
    getRoutes: (router: IRouter) => Route[];
}>;
export default Router;
//# sourceMappingURL=Router.d.ts.map