/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Bytes } from "#util/Bytes.js";
/**
 * Decides whether an inbound mDNS packet is worth decoding, so the socket can drop irrelevant traffic before the
 * expensive full {@link DnsCodec.decode}.
 *
 * Interested components register the DNS names they care about; the filter reduces each to its distinctive label
 * footprint and, per packet, scans only the packet's name structure (skipping RDATA) for a match. It is a conservative
 * superset: a false keep is free (the packet falls through to the real gates), a false drop would break discovery and
 * must never happen, so any structural uncertainty or hash collision yields a keep.
 *
 * Footprints are reference-counted across owners and maintained incrementally, so adding or removing a single tracked
 * name (e.g. a discovered hostname) is O(1) rather than rebuilding the whole set per packet.
 */
export declare class MdnsRelevanceFilter {
    #private;
    /**
     * Declare (replacing any prior declaration) the full set of DNS names an owner cares about.
     *
     * **`"all"` disables the pre-filter for the ENTIRE socket, not just this owner.** Because the socket cannot know
     * which packets an unenumerated owner wants, a single `"all"` forces every inbound packet to be fully decoded
     * again — i.e. it reverts the whole optimization to "decode everything" for every consumer sharing this socket.
     * Use it only when an owner genuinely cannot enumerate its service types, and prefer listing concrete names.
     * (When no owner has registered, or every registered name folds away, the gate is likewise inactive.) Any
     * component consuming the socket's receipt must register here (or `"all"`) or another owner's footprints could
     * filter its packets away.
     *
     * For owners whose interest changes one name at a time (e.g. discovered hostnames), prefer {@link addRelevantName}
     * / {@link removeRelevantName} which update in O(1) instead of rehashing the whole set.
     */
    registerRelevantNames(owner: string, names: Iterable<string> | "all"): void;
    /** Add a single name to an owner's footprints in O(1). No-op if the owner is registered as `"all"`. */
    addRelevantName(owner: string, name: string): void;
    /** Remove a single previously-added name from an owner's footprints in O(1). */
    removeRelevantName(owner: string, name: string): void;
    unregisterRelevantNames(owner: string): void;
    /**
     * Scan a raw packet for a registered footprint, deciding whether it is worth a full decode. Walks the DNS name
     * structure only — header counts then each question/RR name — skipping RDATA via `rdlength`, and follows
     * compression pointers so every label is visited regardless of how the packet encoded the name. Returns true
     * (keep) on any structural uncertainty so the decoder makes the authoritative call.
     */
    isRelevant(message: Bytes): boolean;
}
//# sourceMappingURL=MdnsRelevanceFilter.d.ts.map