import { DnsMessage } from "../decode/types.js"; import { FastFIFO } from "../fast_fifo.js"; /** A driver which supplies the underlying methods a `MulticastInterface` uses to send and receive multicast messages. */ export interface MulticastDriver { family: "IPv4" | "IPv6"; hostname: string; send(message: Uint8Array): Promise; setTTL(ttl: number): Promise; receive(): Promise<[Uint8Array, { hostname: string; port: number; }]>; setLoopback(loopback: boolean): Promise; /** Check if a given address belongs to this interface. */ isOwnAddress(address: string): boolean; close(): void; } /** An interface used to send and receive multicast messages, as well as other actions such as toggling multicast loopback. * * If no driver is specified, selects a `MulticastDriver` appropriate to the current runtime. */ export declare class MulticastInterface { private driver; private subscribers; constructor(driver?: MulticastDriver); send(message: DnsMessage): Promise; setTTL(ttl: number): void; setLoopback(loopback: boolean): void; messages(): FastFIFO<[DnsMessage, { hostname: string; port: number; }]>; isOwnAddress(address: string): boolean; get hostname(): string; get family(): "IPv4" | "IPv6"; }