/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { DnsRecord, DnsRecordType, SrvRecordValue } from "#codec/DnsCodec.js";
import type { Timestamp } from "#time/Timestamp.js";
import { AsyncObserver, BasicObservable } from "#util/Observable.js";
import { MaybePromise } from "#util/Promises.js";
/**
 * Manages records associated with a single DNS-SD qname.
 *
 * Every DNS-SD qname of interest has a 1:1 relationship with a single instance of this class in the context of a
 * {@link DnssdNames}.  We therefore can use the qname or {@link DnssdName} interchangeably.
 *
 * An {@link DnssdName} is created when a new name is discovered or requested by another component.  The name
 * automatically deletes when there are no longer observers or unexpired records.
 */
export declare class DnssdName extends BasicObservable<[changes: DnssdName.Changes], MaybePromise> {
    #private;
    readonly qname: string;
    constructor(qname: string, context: DnssdName.Context);
    off(observer: AsyncObserver<[]>): void;
    close(): Promise<void>;
    get records(): MapIterator<DnssdName.Record>;
    get parameters(): Map<string, string>;
    get isDiscovered(): boolean;
    installRecord(record: DnsRecord<any>): false | undefined;
    deleteRecord(record: DnsRecord, ifOlderThan?: Timestamp): void;
}
export declare namespace DnssdName {
    interface Context {
        delete(name: DnssdName): void;
        registerForExpiration(record: Record): void;
        unregisterForExpiration(record: Record): void;
        get(qname: string): DnssdName;
    }
    interface Expiration {
        expiresAt: Timestamp;
    }
    interface PointerRecord extends DnsRecord<string>, Expiration {
        recordType: DnsRecordType.PTR;
    }
    interface HostRecord extends DnsRecord<string>, Expiration {
        recordType: DnsRecordType.A | DnsRecordType.AAAA;
    }
    interface ServiceRecord extends DnsRecord<SrvRecordValue>, Expiration {
        recordType: DnsRecordType.SRV;
    }
    type Record = PointerRecord | ServiceRecord | HostRecord;
    interface Changes {
        name: DnssdName;
        updated?: Record[];
        deleted?: Record[];
    }
}
//# sourceMappingURL=DnssdName.d.ts.map