import 'reflect-metadata'; import { URL } from 'url'; import { Subject } from 'rxjs'; import { UtilsEtcHosts__NS__EtchostEntry } from './utils-etc-hosts'; export interface UtilsNetwork__NS__PingResult { host: string; success: boolean; timeMs?: number; output?: string; } export declare function UtilsNetwork__NS__checkPing(host: string, timeoutMs?: number): Promise; export declare const UtilsNetwork__NS__checkIfServerPings: (host: string, timeoutMs?: number) => Promise; /** * Check if a server is online by attempting to open a TCP connection. */ export declare const UtilsNetwork__NS__checkIfServerOnline: (host: string, port?: number, timeoutMs?: number) => Promise; export declare const UtilsNetwork__NS__isValidIp: (ip: string) => boolean; export declare const UtilsNetwork__NS__isValidDomain: (url: string, options?: { /** * if yes - domain should start with http:// or https:// */ shouldIncludeProtocol?: boolean | "http" | "https"; }) => boolean; export declare const UtilsNetwork__NS__urlParse: (portOrHost: number | string | URL, options?: { forceDomain?: boolean; httpsIfNotProvided?: boolean; }) => URL; export declare const UtilsNetwork__NS__getEtcHostsPath: () => string; /** * Add or update a hosts entry */ export declare const UtilsNetwork__NS__setEtcHost: (domain: string, ip?: string, comment?: string) => void; /** * @deprecated use UtilsEtcHosts__NS__getEntriesByDomain instead */ export declare const UtilsNetwork__NS__getEtcHostEntriesByDomain: (domain: string) => UtilsEtcHosts__NS__EtchostEntry[]; /** * @deprecated use UtilsEtcHosts__NS__getEntryByComment instead */ export declare const UtilsNetwork__NS__getEtcHostEntryByComment: (commentOfEntry: string) => UtilsEtcHosts__NS__EtchostEntry[]; /** * @deprecated use UtilsEtcHosts__NS__getEntriesByIp instead */ export declare const UtilsNetwork__NS__getEtcHostEntryByIp: (ip: string) => UtilsEtcHosts__NS__EtchostEntry[]; /** * Remove all lines containing the given domain * @deprecated use UtilsEtcHosts__NS__removeEntryByDomain instead */ export declare const UtilsNetwork__NS__removeEtcHost: (domain: string) => void; export declare const UtilsNetwork__NS__etcHostHasProperLocalhostIp4Entry: () => boolean; export declare const UtilsNetwork__NS__etcHostHasProperLocalhostIp6Entry: () => boolean; /** * @deprecated use UtilsEtcHosts__NS__simulateDomain instead */ export declare const UtilsNetwork__NS__simulateDomain: (domainOrDomains: string | string[], options?: { triggerRevertChangesToEtcHosts?: Subject; }) => Promise; export interface UtilsNetwork__NS__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 */ export declare const UtilsNetwork__NS__getLocalIpAddresses: () => Promise; /** * Returns first active local ipv4 IP (LAN preferred over Wi-Fi). */ export declare const UtilsNetwork__NS__getFirstIpV4LocalActiveIpAddress: () => Promise; /** * Returns current public IP address (or null if undetectable). */ export declare const UtilsNetwork__NS__getCurrentPublicIpAddress: () => Promise;