import type { IQueryError, TQueryMissingReason } from './interfaces.queryrecords.js';
export type TClientDnsCommands = {
    resolve: {
        params: IResolveParams;
        result: IResolveResult;
    };
    resolveDetailed: {
        params: IResolveParams;
        result: TResolveDetailedResult;
    };
    ping: {
        params: Record<string, never>;
        result: {
            pong: boolean;
        };
    };
};
export interface IResolveParams {
    name: string;
    recordType: string;
    protocol: 'udp' | 'doh';
    serverAddr?: string;
    dohUrl?: string;
    timeoutMs?: number;
}
export interface IClientDnsAnswer {
    name: string;
    type: string;
    ttl: number;
    value: string;
}
export interface IResolveResult {
    answers: IClientDnsAnswer[];
    adFlag: boolean;
    rcode: number;
}
export interface IResolveDetailedSuccess extends IResolveResult {
    status: 'success';
}
export interface IResolveDetailedMissing {
    status: 'missing';
    answers: [];
    adFlag: boolean;
    rcode: number;
    missingReason: TQueryMissingReason;
}
export interface IResolveDetailedError {
    status: 'error';
    answers: [];
    adFlag: boolean;
    rcode?: number;
    error: IQueryError;
}
export type TResolveDetailedResult = IResolveDetailedSuccess | IResolveDetailedMissing | IResolveDetailedError;
/**
 * Bridge to the Rust DNS client binary via smartrust IPC.
 */
export declare class RustDnsClientBridge {
    private bridge;
    private spawnPromise;
    constructor();
    /**
     * Lazily spawn the Rust binary. Only spawns once, caches the promise.
     */
    ensureSpawned(): Promise<void>;
    /**
     * Resolve a DNS query through the Rust binary.
     */
    resolve(name: string, recordType: string, protocol: 'udp' | 'doh', serverAddr?: string, dohUrl?: string, timeoutMs?: number): Promise<IResolveResult>;
    /**
     * Resolve a DNS query while preserving missing and failure semantics.
     */
    resolveDetailed(name: string, recordType: string, protocol: 'udp' | 'doh', serverAddr?: string, dohUrl?: string, timeoutMs?: number): Promise<TResolveDetailedResult>;
    /**
     * Ping the Rust binary for health check.
     */
    ping(): Promise<boolean>;
    /**
     * Kill the Rust process.
     */
    kill(): void;
    /**
     * Whether the bridge is running.
     */
    get running(): boolean;
}
