import { EventEmitter } from 'events';
export interface IFirewallRateLimit {
    id: string;
    port: number;
    protocol?: 'tcp' | 'udp';
    rate: string;
    burst?: number;
    perSourceIP?: boolean;
}
export interface IFirewallRule {
    id: string;
    direction: 'input' | 'output' | 'forward';
    action: 'accept' | 'drop' | 'reject';
    sourceIP?: string;
    destPort?: number;
    protocol?: 'tcp' | 'udp';
    comment?: string;
}
export interface IFirewallConfig {
    blockedIps?: string[];
    rateLimits?: IFirewallRateLimit[];
    rules?: IFirewallRule[];
}
export interface IHubConfig {
    tunnelPort?: number;
    targetHost?: string;
    tls?: {
        certPem?: string;
        keyPem?: string;
    };
    performance?: IPerformanceConfig;
}
export type TPerformanceProfile = 'balanced' | 'throughput' | 'highConcurrency';
export interface IPerformanceConfig {
    profile?: TPerformanceProfile;
    maxStreamsPerEdge?: number;
    totalWindowBudgetBytes?: number;
    minStreamWindowBytes?: number;
    maxStreamWindowBytes?: number;
    sustainedStreamWindowBytes?: number;
    quicDatagramReceiveBufferBytes?: number;
}
export interface IEffectivePerformanceConfig {
    profile: TPerformanceProfile;
    maxStreamsPerEdge: number;
    totalWindowBudgetBytes: number;
    minStreamWindowBytes: number;
    maxStreamWindowBytes: number;
    sustainedStreamWindowBytes: number;
    quicDatagramReceiveBufferBytes: number;
}
export interface IFlowControlStatus {
    applies: boolean;
    currentWindowBytes: number;
    minWindowBytes: number;
    maxWindowBytes: number;
    totalWindowBudgetBytes: number;
    estimatedInFlightBytes: number;
    stalledStreams: number;
}
export interface IQueueStatus {
    ctrlQueueDepth: number;
    dataQueueDepth: number;
    sustainedQueueDepth: number;
}
export interface ITrafficStatus {
    bytesIn: number;
    bytesOut: number;
    streamsOpenedTotal: number;
    streamsClosedTotal: number;
    rejectedStreams: number;
}
export interface IUdpStatus {
    activeSessions: number;
    droppedDatagrams: number;
}
type TAllowedEdge = {
    id: string;
    secret: string;
    listenPorts?: number[];
    listenPortsUdp?: number[];
    stunIntervalSecs?: number;
    firewallConfig?: IFirewallConfig;
    performance?: IPerformanceConfig;
};
export declare class RemoteIngressHub extends EventEmitter {
    private bridge;
    private started;
    private stopping;
    private savedConfig;
    private savedEdges;
    private restartBackoffMs;
    private restartAttempts;
    constructor();
    /**
     * Start the hub — spawns the Rust binary and starts the tunnel server.
     */
    start(config?: IHubConfig): Promise<void>;
    /**
     * Stop the hub and kill the Rust process.
     */
    stop(): Promise<void>;
    /**
     * Update the list of allowed edges that can connect to this hub.
     */
    updateAllowedEdges(edges: TAllowedEdge[]): Promise<void>;
    /**
     * Get the current hub status.
     */
    getStatus(): Promise<{
        running: boolean;
        tunnelPort: number;
        connectedEdges: Array<{
            edgeId: string;
            connectedAt: number;
            activeStreams: number;
            peerAddr: string;
            transportMode: "tcpTls" | "quic" | "quicWithFallback";
            fallbackUsed: boolean;
            performance: IEffectivePerformanceConfig;
            flowControl: IFlowControlStatus;
            queues: IQueueStatus;
            traffic: ITrafficStatus;
            udp: IUdpStatus;
        }>;
    }>;
    /**
     * Check if the bridge is running.
     */
    get running(): boolean;
    /**
     * Handle unexpected Rust binary crash — auto-restart with backoff.
     */
    private handleCrashRecovery;
}
export {};
