/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { DnsRecord } from "#codec/DnsCodec.js"; import { Duration } from "#time/Duration.js"; import { Entropy } from "#util/Entropy.js"; import { Lifetime } from "#util/Lifetime.js"; import { Observable } from "#util/Observable.js"; import { DnssdName } from "./DnssdName.js"; import { QueryMulticaster } from "./DnssdSolicitor.js"; import { MdnsSocket } from "./MdnsSocket.js"; /** * Names collected via DNS-SD. * * TODO - API is designed to support Avahi, Bonjour etc. but current implementation is tied to local MDNS */ export declare class DnssdNames { #private; constructor({ socket, lifetime, entropy, filter, goodbyeProtectionWindow, minTtl, }: DnssdNames.Context); /** * Test for existence of name. */ has(name: string): boolean; /** * Retrieve the {@link DnssdName} for {@link name}. * * This will create the name if it does not exist, and if you do not add an observer then it will not automatically * delete if there are no records. So if you may not use the record test for existence with {@link has} first. */ get(qname: string): DnssdName; /** * Retrieve the {@link DnssdName} if known. */ maybeGet(name: string): DnssdName | undefined; /** * Wait for all workers and close all names. */ close(): Promise; get socket(): MdnsSocket; /** * Emits when a {@link DnssdName} is first discovered. */ get discovered(): Observable<[name: DnssdName], void>; /** * Shared solicitor. * * We offer solicitation in this object so there is not redundant solicitation across interested parties. */ get solicitor(): QueryMulticaster; get entropy(): Entropy; } export declare namespace DnssdNames { interface Context { socket: MdnsSocket; lifetime?: Lifetime.Owner; entropy: Entropy; /** * Identify relevant records coming in on the wire for inclusion in the name set. * * Observed names are considered relevant even if filtered here. */ filter?: (record: DnsRecord) => boolean; /** * The interval after discovering a record for which we ignore goodbyes. * * This serves as protection for out-of-order messages when a device expires then broadcasts the same record * in a very short amount of time. */ goodbyeProtectionWindow?: Duration; /** * Minimum TTL for PTR records. */ minTtl?: Duration; } const defaults: { goodbyeProtectionWindow: Duration; minTtl: Duration; }; } //# sourceMappingURL=DnssdNames.d.ts.map