import { EventEmitter } from 'events'; import type { IEgressIdentityReport } from './classes.remoteingresshub.js'; export interface IEdgeConfig { hubHost: string; hubPort?: number; edgeId: string; secret: string; bindAddress?: string; transportMode?: 'tcpTls' | 'quic' | 'quicWithFallback'; egressSourceIpv4?: string; egressSourceIpv6?: string; } export interface IEdgeTokenConfig { token: string; bindAddress?: string; transportMode?: 'tcpTls' | 'quic' | 'quicWithFallback'; egressSourceIpv4?: string; egressSourceIpv6?: string; } export declare class RemoteIngressEdge extends EventEmitter { private bridge; private started; private stopping; private savedConfig; private restartBackoffMs; private restartAttempts; private statusInterval; private nft; private pendingFirewallConfig; constructor(); /** * Initialize the nftables manager. Fails gracefully if not running as root. */ private initNft; /** * Apply firewall configuration received from the hub. * Performs a full replacement: cleans up existing rules, then applies the new config. */ private applyFirewallConfig; /** * Start the edge — spawns the Rust binary and connects to the hub. * Accepts either a connection token or an explicit IEdgeConfig. */ start(config: IEdgeTokenConfig | IEdgeConfig): Promise; /** * Stop the edge and kill the Rust process. */ stop(): Promise; /** * Get the current edge status. */ getStatus(): Promise<{ running: boolean; connected: boolean; publicIp: string | null; activeStreams: number; listenPorts: number[]; egressIdentity: IEgressIdentityReport | null; }>; /** * Check if the bridge is running. */ get running(): boolean; /** * Handle unexpected Rust binary crash — auto-restart with backoff. */ private handleCrashRecovery; }