import 'reflect-metadata'; import { URL } from 'url'; import { Subject } from 'rxjs'; import { UtilsEtcHosts } from './utils-etc-hosts'; export declare namespace UtilsNetwork { interface PingResult { host: string; success: boolean; timeMs?: number; output?: string; } function checkPing(host: string, timeoutMs?: number): Promise; const checkIfServerPings: (host: string, timeoutMs?: number) => Promise; /** * Check if a server is online by attempting to open a TCP connection. */ const checkIfServerOnline: (host: string, port?: number, timeoutMs?: number) => Promise; const isValidIp: (ip: string) => boolean; const isValidDomain: (url: string, options?: { /** * if yes - domain should start with http:// or https:// */ shouldIncludeProtocol?: boolean | "http" | "https"; }) => boolean; const urlParse: (portOrHost: number | string | URL, options?: { forceDomain?: boolean; httpsIfNotProvided?: boolean; }) => URL; const getEtcHostsPath: () => string; /** * Add or update a hosts entry */ const setEtcHost: (domain: string, ip?: string, comment?: string) => void; /** * @deprecated use UtilsEtcHosts.getEntriesByDomain instead */ const getEtcHostEntriesByDomain: (domain: string) => UtilsEtcHosts.EtchostEntry[]; /** * @deprecated use UtilsEtcHosts.getEntryByComment instead */ const getEtcHostEntryByComment: (commentOfEntry: string) => UtilsEtcHosts.EtchostEntry[]; /** * @deprecated use UtilsEtcHosts.getEntriesByIp instead */ const getEtcHostEntryByIp: (ip: string) => UtilsEtcHosts.EtchostEntry[]; /** * Remove all lines containing the given domain * @deprecated use UtilsEtcHosts.removeEntryByDomain instead */ const removeEtcHost: (domain: string) => void; const etcHostHasProperLocalhostIp4Entry: () => boolean; const etcHostHasProperLocalhostIp6Entry: () => boolean; /** * @deprecated use UtilsEtcHosts.simulateDomain instead */ const simulateDomain: (domainOrDomains: string | string[], options?: { triggerRevertChangesToEtcHosts?: Subject; }) => Promise; interface LocalIpInfo { interfaceName: string; address: string; family: 'IPv4' | 'IPv6'; internal: boolean; type: 'lan' | 'wifi' | 'other' | 'virtual'; } /** * Returns all local IP addresses in preferred order: * LAN → Wi-Fi → Other → Virtual */ const getLocalIpAddresses: () => Promise; /** * Returns first active local ipv4 IP (LAN preferred over Wi-Fi). */ const getFirstIpV4LocalActiveIpAddress: () => Promise; /** * Returns current public IP address (or null if undetectable). */ const getCurrentPublicIpAddress: () => Promise; }