type ExtractParams<T extends string> = T extends `${infer _Start}/:${infer Param}/${infer Rest}` ? {
    [K in Param | keyof ExtractParams<`/${Rest}`>]: string;
} : T extends `${infer _Start}/:${infer Param}` ? {
    [K in Param]: string;
} : {};
export type KosMethodTypes = "GET" | "POST" | "PUT" | "DELETE";
export type KosRequest<TPath extends string = string> = {
    id: string;
    method: string;
    path: TPath;
    params: ExtractParams<TPath>;
    query?: Record<string, string>;
    body?: any;
};
export type KosResponse = {
    send: (data: any) => void;
    status?: (code: number) => KosResponse;
};
export type RouteMetadata = {
    method: string;
    path: string;
    description?: string;
    parameters?: any[];
};
export type KosMiddleware<TPath extends string = string> = (req: KosRequest<TPath>, res: KosResponse, next: () => Promise<void> | void) => Promise<void> | void;
export declare class BrowserKosRouter {
    private routes;
    private openApiRoutes;
    use<TPath extends string = string>(method: string, path: TPath, ...middlewares: KosMiddleware<TPath>[]): void;
    /**
     * Remove routes matching the given method and path
     * @param method HTTP method (GET, POST, etc.)
     * @param path Route path pattern
     * @returns Number of routes removed
     */
    remove(method: string, path: string): number;
    /**
     * Remove all routes matching a path pattern (regardless of method)
     * @param path Route path pattern
     * @returns Number of routes removed
     */
    removeAllForPath(path: string): number;
    /**
     * Get all registered routes (for debugging/monitoring)
     */
    getRoutes(): Array<{
        method: string;
        path: string;
    }>;
    handle(rawReq: Omit<KosRequest, "params" | "query">, res: KosResponse): Promise<void>;
    private extractOpenApiParams;
    generateOpenApiSpec(): {
        openapi: string;
        info: {
            title: string;
            version: string;
            description: string;
        };
        paths: Record<string, any>;
    };
    private extractPathParams;
    private matchRoute;
    private parseQueryParams;
}
export {};
//# sourceMappingURL=browser-router.d.ts.map