/**
 * @module mdns-discovery
 * mDNS service discovery for local network device pairing.
 *
 * Service Type: _privateme._tcp.local (RFC 6763 compliant)
 * Port: 58472 (dynamic range 58000-58999)
 * TXT Record: did=z6Mk..., endpoint=http://192.168.1.5:58472, name=Desktop
 *
 * Security properties:
 * - Physical proximity required (same LAN)
 * - User confirmation on both devices
 * - Nonce-based challenge-response
 * - 60-second timeout
 * - Gold Standard compliant (GS-CONNECT requirement #26)
 */
import { Result } from '@private.me/shared';
/**
 * mDNS service information.
 */
export interface MdnsServiceInfo {
    /** Service name (e.g., "Desktop", "MacBook Pro") */
    readonly name: string;
    /** Device DID */
    readonly did: string;
    /** HTTP endpoint (e.g., "http://192.168.1.5:58472") */
    readonly endpoint: string;
    /** IPv4 addresses */
    readonly addresses: readonly string[];
    /** Port number */
    readonly port: number;
}
/**
 * Discovery error types.
 */
export declare enum DiscoveryErrorCode {
    NETWORK_ERROR = "NETWORK_ERROR",
    TIMEOUT = "TIMEOUT",
    NO_SERVICES = "NO_SERVICES",
    INVALID_SERVICE = "INVALID_SERVICE"
}
/**
 * Discovery error.
 */
export interface DiscoveryError {
    readonly code: DiscoveryErrorCode;
    readonly message: string;
    readonly hint?: string;
}
/**
 * mDNS discovery manager.
 *
 * Advertises service on local network and scans for other devices.
 * Uses bonjour-service library (RFC 6763/6762 compliant).
 */
export declare class MdnsDiscoveryManager {
    private readonly bonjour;
    private service;
    private readonly serviceType;
    private readonly protocol;
    private readonly port;
    constructor();
    /**
     * Advertise service on local network.
     *
     * Broadcasts mDNS announcement with device DID and HTTP endpoint.
     * Other devices on the same LAN can discover this service via scan().
     *
     * @param name - Device name (e.g., "Desktop", "MacBook Pro")
     * @param did - Device DID
     * @param port - Local HTTP server port (default: 58472)
     *
     * @example
     * ```typescript
     * const manager = new MdnsDiscoveryManager();
     * manager.advertise('Desktop', 'did:key:z6Mk...', 58472);
     * // Service now visible to other devices on LAN
     * ```
     */
    advertise(name: string, did: string, port?: number): void;
    /**
     * Scan local network for services.
     *
     * Discovers all Private.Me devices on the same LAN.
     * Filters out own DID from results (can't pair with self).
     *
     * @param ownDid - Own device DID (to filter out)
     * @param timeoutMs - Scan timeout in milliseconds (default: 5000ms)
     * @returns Array of discovered services
     *
     * @example
     * ```typescript
     * const manager = new MdnsDiscoveryManager();
     * const result = await manager.scan('did:key:z6Mk...myDid', 5000);
     * if (result.ok) {
     *   console.log(`Found ${result.value.length} devices`);
     *   for (const service of result.value) {
     *     console.log(`${service.name} - ${service.did}`);
     *   }
     * }
     * ```
     */
    scan(ownDid: string, timeoutMs?: number): Promise<Result<MdnsServiceInfo[], DiscoveryError>>;
    /**
     * Stop advertising service.
     *
     * Removes mDNS announcement from local network.
     * Other devices will no longer see this service.
     */
    stopAdvertising(): void;
    /**
     * Release resources.
     *
     * Stops advertising and cleans up Bonjour instance.
     * Call this when shutting down the application.
     */
    destroy(): void;
}
