import * as plugins from './plugins.js'; export type TDnsCommands = { start: { params: { config: IRustDnsConfig; }; result: Record; }; stop: { params: Record; result: Record; }; dnsQueryResult: { params: { correlationId: string; answers: IIpcDnsAnswer[]; answered: boolean; }; result: { resolved: boolean; }; }; updateCerts: { params: { httpsKey: string; httpsCert: string; }; result: Record; }; processPacket: { params: { packet: string; }; result: { packet: string; }; }; ping: { params: Record; result: { pong: boolean; }; }; }; export interface IRustDnsConfig { udpPort: number; tcpPort?: number; httpsPort: number; udpBindInterface: string; tcpBindInterface?: string; httpsBindInterface: string; httpsKey: string; httpsCert: string; dnssecZone: string; dnssecAlgorithm: string; primaryNameserver: string; enableLocalhostHandling: boolean; manualUdpMode: boolean; manualTcpMode: boolean; manualHttpsMode: boolean; } export interface IIpcDnsQuestion { name: string; type: string; class: string; } export interface IIpcDnsAnswer { name: string; type: string; class: string; ttl: number; data: any; } export interface IDnsQueryEvent { correlationId: string; questions: IIpcDnsQuestion[]; dnssecRequested: boolean; } /** * Bridge to the Rust DNS binary via smartrust IPC. */ export declare class RustDnsBridge extends plugins.events.EventEmitter { private bridge; constructor(); /** * Spawn the Rust binary and wait for readiness. */ spawn(): Promise; /** * Start the DNS server with given config. */ startServer(config: IRustDnsConfig): Promise; /** * Stop the DNS server. */ stopServer(): Promise; /** * Send a DNS query result back to Rust. */ sendQueryResult(correlationId: string, answers: IIpcDnsAnswer[], answered: boolean): Promise; /** * Update TLS certificates. */ updateCerts(httpsKey: string, httpsCert: string): Promise; /** * Process a raw DNS packet via IPC (for manual/passthrough mode). * Returns the DNS response as a Buffer. */ processPacket(packet: Buffer): Promise; /** * Ping the Rust binary for health check. */ ping(): Promise; /** * Kill the Rust process. */ kill(): void; /** * Whether the bridge is running. */ get running(): boolean; }