export declare class TunTapError extends Error { code?: string | undefined; constructor(message: string, code?: string | undefined); } export declare class TunTapPermissionError extends TunTapError { constructor(message: string); } export declare class TunTapDeviceError extends TunTapError { constructor(message: string); } /** * TUN/TAP device for IP tunneling */ export declare class TunTap { private device; private isOpen; private isClosed; private cleanupHandlers; constructor(name?: string); open(): boolean; close(): boolean; read(maxSize?: number): Buffer; write(data: Buffer): number; get name(): string; get fd(): number; configure(address: string, mtu?: number): Promise; addRoute(destination: string): Promise; removeRoute(destination: string): Promise; /** * Get interface statistics */ getStats(): Promise<{ rxBytes: number; txBytes: number; rxPackets: number; txPackets: number; rxErrors: number; txErrors: number; }>; }