/** * Single source of truth for the `"ipv4"` / `"ipv6"` -> `node:dgram` translations the FFmpeg subsystem needs. * * Every call site in the FFmpeg subsystem that needs the ipFamily -> node:dgram translation routes through the table lookups exported here, rather than * hand-rolling `ipFamily === "ipv6" ? "udp6" : "udp4"` or `isIPv6 ? "::1" : "127.0.0.1"` inline. Keeping the mapping centralized means a future addition * (dual-stack socket types, SO_REUSEADDR flags, alternative loopback addresses in constrained test environments) has exactly one file to update, and * consumers - production or test - share the same vocabulary. * * @module */ import type { Socket } from "node:dgram"; /** * The two IP families the FFmpeg subsystem supports. Centralized here so consumers in `rtp.ts`, `stream.ts`, and the test fixtures share the same union rather than * re-declaring inline unions at every init-type boundary. * * @category FFmpeg */ export type IpFamily = "ipv4" | "ipv6"; declare const LOOPBACK_ADDRESS: { readonly ipv4: "127.0.0.1"; readonly ipv6: "::1"; }; /** * Resolve the loopback address string for the supplied IP family. The returned literal is suitable for passing to `socket.bind(port, address)` or * `socket.send(..., address, ...)`. * * @param ipFamily - The IP family to resolve. * * @returns `"127.0.0.1"` for `"ipv4"` or `"::1"` for `"ipv6"`. * * @category FFmpeg */ export declare function loopbackAddress(ipFamily: IpFamily): (typeof LOOPBACK_ADDRESS)[IpFamily]; /** * Create a `node:dgram` socket for the supplied IP family. Equivalent to `createSocket("udp4")` / `createSocket("udp6")` but routes the family -> socket-type lookup * through the single table above, so every call site shares one mapping. * * @param ipFamily - The IP family for the new socket. * * @returns A fresh unbound {@link Socket}. * * @category FFmpeg */ export declare function createDgramSocket(ipFamily: IpFamily): Socket; export {}; //# sourceMappingURL=dgram-util.d.ts.map