import * as http from 'http';
import * as tsclass from '@tsclass/tsclass';
/**
 * Optional path pattern configuration that can be added to proxy configs
 */
export interface IPathPatternConfig {
    pathPattern?: string;
}
/**
 * Interface for router result with additional metadata
 */
export interface IRouterResult {
    config: tsclass.network.IReverseProxyConfig;
    pathMatch?: string;
    pathParams?: Record<string, string>;
    pathRemainder?: string;
}
/**
 * Router for HTTP reverse proxy requests
 *
 * Supports the following domain matching patterns:
 * - Exact matches: "example.com"
 * - Wildcard subdomains: "*.example.com" (matches any subdomain of example.com)
 * - TLD wildcards: "example.*" (matches example.com, example.org, etc.)
 * - Complex wildcards: "*.lossless*" (matches any subdomain of any lossless domain)
 * - Default fallback: "*" (matches any unmatched domain)
 *
 * Also supports path pattern matching for each domain:
 * - Exact path: "/api/users"
 * - Wildcard paths: "/api/*"
 * - Path parameters: "/users/:id/profile"
 */
export declare class ProxyRouter {
    private reverseProxyConfigs;
    private defaultConfig?;
    private pathPatterns;
    private logger;
    constructor(configs?: tsclass.network.IReverseProxyConfig[], logger?: {
        error: (message: string, data?: any) => void;
        warn: (message: string, data?: any) => void;
        info: (message: string, data?: any) => void;
        debug: (message: string, data?: any) => void;
    });
    /**
     * Sets a new set of reverse configs to be routed to
     * @param reverseCandidatesArg Array of reverse proxy configurations
     */
    setNewProxyConfigs(reverseCandidatesArg: tsclass.network.IReverseProxyConfig[]): void;
    /**
     * Routes a request based on hostname and path
     * @param req The incoming HTTP request
     * @returns The matching proxy config or undefined if no match found
     */
    routeReq(req: http.IncomingMessage): tsclass.network.IReverseProxyConfig;
    /**
     * Routes a request with detailed matching information
     * @param req The incoming HTTP request
     * @returns Detailed routing result including matched config and path information
     */
    routeReqWithDetails(req: http.IncomingMessage): IRouterResult | undefined;
    /**
     * Find potential wildcard patterns that could match a given hostname
     * Handles complex patterns like "*.lossless*" or other partial matches
     * @param hostname The hostname to find wildcard matches for
     * @returns Array of potential wildcard patterns that could match
     */
    private findWildcardMatches;
    /**
     * Find a config for a specific host and path
     */
    private findConfigForHost;
    /**
     * Matches a URL path against a pattern
     * Supports:
     * - Exact matches: /users/profile
     * - Wildcards: /api/* (matches any path starting with /api/)
     * - Path parameters: /users/:id (captures id as a parameter)
     *
     * @param path The URL path to match
     * @param pattern The pattern to match against
     * @returns Match result with params and remainder, or null if no match
     */
    private matchPath;
    /**
     * Gets all currently active proxy configurations
     * @returns Array of all active configurations
     */
    getProxyConfigs(): tsclass.network.IReverseProxyConfig[];
    /**
     * Gets all hostnames that this router is configured to handle
     * @returns Array of hostnames
     */
    getHostnames(): string[];
    /**
     * Adds a single new proxy configuration
     * @param config The configuration to add
     * @param pathPattern Optional path pattern for route matching
     */
    addProxyConfig(config: tsclass.network.IReverseProxyConfig, pathPattern?: string): void;
    /**
     * Sets a path pattern for an existing config
     * @param config The existing configuration
     * @param pathPattern The path pattern to set
     * @returns Boolean indicating if the config was found and updated
     */
    setPathPattern(config: tsclass.network.IReverseProxyConfig, pathPattern: string): boolean;
    /**
     * Removes a proxy configuration by hostname
     * @param hostname The hostname to remove
     * @returns Boolean indicating whether any configs were removed
     */
    removeProxyConfig(hostname: string): boolean;
}
