import { KosRequest, KosResponse } from '../services/browser-router';
import { IKosDataModel, KosContextLogger } from '../kosModel';

interface IBrowserRouter extends IKosDataModel {
    use(method: string, path: string, handler: (req: KosRequest, res: KosResponse) => Promise<void>): void;
    remove(method: string, path: string): number;
    removeAllForPath(path: string): number;
    getRoutes(): Array<{
        method: string;
        path: string;
    }>;
}
export interface KosHttpRouteLogger {
    info: (...args: any[]) => void;
    warn: (...args: any[]) => void;
    error: (...args: any[]) => void;
    debug: (...args: any[]) => void;
}
/**
 * Manager for registering HTTP route handlers from decorators with the browser router
 */
export declare class KosHttpRouteManager {
    private logger;
    private model;
    private router;
    private registered;
    private registeredRoutes;
    constructor(model: any, logger: KosHttpRouteLogger);
    /**
     * Register all HTTP routes during the load lifecycle
     * This is called automatically by the KOS model lifecycle
     */
    registerAll(): void;
    /**
     * Set the browser router instance
     */
    setRouter(router: IBrowserRouter): void;
    /**
     * Check if the model has HTTP route handlers
     */
    hasRoutes(): boolean;
    /**
     * Register all HTTP route handlers with the browser router
     */
    private registerRoutes;
    /**
     * Resolve PropKeys in a path template
     * Supports:
     * - {MODEL_ID} - replaced with the model's ID
     * - {PROP_propertyName} - replaced with the value of model.propertyName
     *
     * @example
     * "/api/models/{MODEL_ID}/data" -> "/api/models/my-model-123/data"
     * "/api/{PROP_tenantId}/users" -> "/api/tenant-456/users"
     */
    private resolvePropKey;
    /**
     * Register a single route with the browser router
     */
    private registerRoute;
    /**
     * Check for duplicate routes and warn if found
     */
    private checkForDuplicateRoute;
    /**
     * Dispose of the route manager and cleanup all registered routes
     */
    dispose(): void;
    /**
     * Get all routes registered by this manager (for debugging)
     */
    getRegisteredRoutes(): Array<{
        method: string;
        path: string;
    }>;
}
/**
 * Helper function to automatically register HTTP routes during model load
 * This is called automatically by the KOS model lifecycle if HTTP route handlers are detected
 *
 * @internal
 */
export declare function registerHttpRoutes(model: any, logger: KosContextLogger): void;
export {};
//# sourceMappingURL=kos-http-route-manager.d.ts.map