/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { DnsRecordType } from "#codec/DnsCodec.js";
import { RetrySchedule } from "#net/RetrySchedule.js";
import type { DnssdName } from "./DnssdName.js";
import type { DnssdNames } from "./DnssdNames.js";
/**
 * Solicits DNS-SD records for specific names.
 */
export interface DnssdSolicitor {
    /**
     * Send a single MDNS query for a specific DNS-SD name.
     *
     * Multiple solicitations for the same name are coalesced into the same query using a macrotask.
     */
    solicit(solicitation: DnssdSolicitor.Solicitation): void;
    /**
     * Send MDNS queries for a specific DNS-SD name using a standard MDNS transmission schedule.
     *
     * The solicitor does not have a notion of "discovery complete", so this function does not return until
     * {@link DnssdSolicitor.Discovery.abort} signals abort (or the solicitor is closed).
     *
     * Multiple simultaneous attempts to complete discovery of the same name will not result in redundant solicitations.
     *
     * If fields in {@link discovery} change their value is used for the next solicitation.
     */
    discover(discovery: DnssdSolicitor.Discovery): Promise<void>;
}
/**
 * Solicit one or more record types for a name.
 *
 * "Soliciting" consists of broadcasting a query for a DNS-SD name.  Groups multiple solicitations in the same
 * macrotask into a single packet.
 */
export declare namespace DnssdSolicitor {
    /**
     * Configures solicitation of a single name.
     */
    interface Solicitation {
        /**
         * The name to solicit.
         */
        name: DnssdName;
        /**
         * Record types to request.
         */
        recordTypes: DnsRecordType[];
        /**
         * Additional names to include as known answers.
         */
        associatedNames?: Iterable<DnssdName>;
    }
    /**
     * Configures repeated solicitation.
     */
    interface Discovery extends Solicitation {
        /**
         * Terminates discovery.
         */
        abort: AbortSignal;
        /**
         * Override retry configuration for this discovery.  Defaults to the solicitor's shared schedule.
         *
         * When {@link DnssdSolicitor.discover} coalesces with an in-flight discovery for the same name, the first
         * caller's solicitation fields drive the shared discovery — {@link DnssdSolicitor.Solicitation.recordTypes},
         * {@link DnssdSolicitor.Solicitation.associatedNames}, and this retry configuration.  Later callers only
         * contribute their own {@link abort} signal.
         */
        retries?: RetrySchedule.Configuration;
    }
    /**
     * Default retry schedule per RFC 6762 (initial delay of 20-120ms. handled separately).
     */
    const DefaultRetries: RetrySchedule.Configuration;
}
export declare class QueryMulticaster implements DnssdSolicitor {
    #private;
    constructor(names: DnssdNames, retries?: RetrySchedule.Configuration);
    solicit(solicitation: DnssdSolicitor.Solicitation): void;
    discover(discovery: DnssdSolicitor.Discovery): Promise<void>;
    close(): Promise<void>;
}
//# sourceMappingURL=DnssdSolicitor.d.ts.map