import * as plugins from '../../plugins.js';
import type { IRouteConfig, TPortRange, IRouteContext } from '../../proxies/smart-proxy/models/route-types.js';
/**
 * Result of route lookup
 */
export interface IRouteLookupResult {
    route: IRouteConfig;
    params?: Record<string, string>;
}
/**
 * Logger interface for RouteManager
 */
export interface ILogger {
    info: (message: string, ...args: any[]) => void;
    warn: (message: string, ...args: any[]) => void;
    error: (message: string, ...args: any[]) => void;
    debug?: (message: string, ...args: any[]) => void;
}
/**
 * Shared RouteManager used by both SmartProxy and NetworkProxy
 *
 * This provides a unified implementation for route management,
 * route matching, and port handling.
 */
export declare class SharedRouteManager extends plugins.EventEmitter {
    private routes;
    private portMap;
    private logger;
    private enableDetailedLogging;
    /**
     * Memoization cache for expanded port ranges
     */
    private portRangeCache;
    constructor(options: {
        logger?: ILogger;
        enableDetailedLogging?: boolean;
        routes?: IRouteConfig[];
    });
    /**
     * Update routes with new configuration
     */
    updateRoutes(routes?: IRouteConfig[]): void;
    /**
     * Get all routes
     */
    getRoutes(): IRouteConfig[];
    /**
     * Rebuild the port mapping for fast lookups
     * Also logs information about the ports being listened on
     */
    private rebuildPortMap;
    /**
     * Expand a port range specification into an array of individual ports
     * Uses caching to improve performance for frequently used port ranges
     *
     * @public - Made public to allow external code to interpret port ranges
     */
    expandPortRange(portRange: TPortRange): number[];
    /**
     * Get all ports that should be listened on
     * This method automatically infers all required ports from route configurations
     */
    getListeningPorts(): number[];
    /**
     * Get all routes for a given port
     */
    getRoutesForPort(port: number): IRouteConfig[];
    /**
     * Find the matching route for a connection
     */
    findMatchingRoute(context: IRouteContext): IRouteLookupResult | null;
    /**
     * Check if a route matches the given context
     */
    private matchesRoute;
    /**
     * Validate the route configuration and return any warnings
     */
    validateConfiguration(): string[];
    /**
     * Check if two route matches are similar (potential conflict)
     */
    private areMatchesSimilar;
    /**
     * Check if a route is completely shadowed by a higher priority route
     */
    private isRouteShadowed;
}
