import type { Multiaddr } from '@multiformats/multiaddr'; export interface IP4NetConfig { type: 'ip4'; host: string; protocol?: 'tcp' | 'udp'; port?: number; cidr?: number; sni?: string; } export interface IP6NetConfig { type: 'ip6'; host: string; protocol?: 'tcp' | 'udp'; port?: number; zone?: string; cidr?: string; sni?: string; } export interface DNSNetConfig { type: 'dns'; host: string; protocol?: 'tcp' | 'udp'; port: number; cidr?: number; } export interface DNS4NetConfig { type: 'dns4'; host: string; protocol?: 'tcp' | 'udp'; port: number; cidr?: number; } export interface DNS6NetConfig { type: 'dns6'; host: string; protocol?: 'tcp' | 'udp'; port: number; cidr?: number; } export interface DNSAddrNetConfig { type: 'dnsaddr'; host: string; protocol?: 'tcp' | 'udp'; port: number; cidr?: number; } export type NetConfig = IP4NetConfig | IP6NetConfig | DNSNetConfig | DNS4NetConfig | DNS6NetConfig | DNSAddrNetConfig; /** * Returns host/port/etc information for a multiaddr if it starts with a * network address (IPv4, IPv6, DNS, DNS4, DNS6 or DNSADDR), or null otherwise. */ export declare function tryGetNetConfig(ma: Multiaddr): NetConfig | null; /** * Like `tryGetNetConfig` but throws `InvalidParametersError` when the multiaddr * does not start with a network address. */ export declare function getNetConfig(ma: Multiaddr): NetConfig; //# sourceMappingURL=get-net-config.d.ts.map