/** * IPX - A powerful and efficient IP address manipulation library */ /** * Convert IPv4 address to 32-bit number */ declare function ipv4ToInt(ip: string): number; /** * Convert IPv6 address to BigInt */ declare function ipv6ToBigInt(ip: string): bigint; /** * Check if string is valid IPv4 address */ declare function isIPv4(ip: string): boolean; /** * Check if string is valid IPv6 address */ declare function isIPv6(ip: string): boolean; /** * Convert number to IPv4 address */ declare function intToIPv4(int: number): string; /** * Convert BigInt to IPv6 address */ declare function bigIntToIPv6(int: bigint): string; /** * Convert IPv4 address to ArrayBuffer (4 bytes) */ declare function ipv4ToBuffer(ip: string): ArrayBuffer; /** * Convert IPv6 address to ArrayBuffer (16 bytes) */ declare function ipv6ToBuffer(ip: string): ArrayBuffer; /** * Convert ArrayBuffer to IPv4 address (4 bytes) */ declare function bufferToIPv4(buffer: ArrayBuffer): string; /** * Convert ArrayBuffer to IPv6 address (16 bytes) */ declare function bufferToIPv6(buffer: ArrayBuffer): string; /** * Check if a string is a valid IP address (IPv4 or IPv6) */ declare function isValidIP(ip: string): boolean; /** * Check if IPv4 address is private */ declare function isPrivateIPv4(ip: string | number): boolean; /** * Check if IPv4 address is loopback */ declare function isLoopbackIPv4(ip: string | number): boolean; /** * Check if IPv4 address is multicast */ declare function isMulticastIPv4(ip: string | number): boolean; /** * Check if IPv6 address is private */ declare function isPrivateIPv6(ip: string | bigint): boolean; /** * Check if IPv6 address is loopback */ declare function isLoopbackIPv6(ip: string | bigint): boolean; /** * Check if IPv6 address is multicast */ declare function isMulticastIPv6(ip: string | bigint): boolean; /** * Get next IPv4 address */ declare function nextIPv4(ip: string | number): string; /** * Get previous IPv4 address */ declare function prevIPv4(ip: string | number): string; /** * Get next IPv6 address */ declare function nextIPv6(ip: string | bigint): string; /** * Get previous IPv6 address */ declare function prevIPv6(ip: string | bigint): string; /** * Convert IP address to binary string */ declare function toBinary(ip: string): string; /** * Convert IP address to numeric value */ declare function toNumber(ip: string): number | bigint; /** * Parse CIDR notation to range information */ declare function parseCIDR(cidr: string): { start: number | bigint; end: number | bigint; prefix: number; version: 4 | 6; }; /** * Check if IP address is in CIDR range */ declare function ipInRange(cidr: string, ip: string): boolean; /** * Get first IP address in CIDR range */ declare function firstIPInRange(cidr: string): string; /** * Get last IP address in CIDR range */ declare function lastIPInRange(cidr: string): string; /** * Get network mask for CIDR */ declare function maskForCIDR(cidr: string): string; /** * Get total number of addresses in CIDR range */ declare function rangeSize(cidr: string): number | bigint; /** * Parse IPv4 address to byte array directly * More efficient than going through ArrayBuffer */ declare function ipv4ToBytes(ip: string): number[]; /** * Parse IPv6 address to byte array directly * More efficient than going through ArrayBuffer */ declare function ipv6ToBytes(ip: string): number[]; /** * Parse IP address to byte array (unified function) * Chooses the most efficient method based on IP version */ declare function ipToBytes(ip: string): number[]; /** * Get IP version (4 for IPv4, 6 for IPv6) */ declare function getIPVersion(ip: string): 4 | 6 | null; /** * Check if two CIDR ranges overlap */ declare function rangesOverlap(cidr1: string, cidr2: string): boolean; export { bigIntToIPv6, bufferToIPv4, bufferToIPv6, firstIPInRange, getIPVersion, intToIPv4, ipInRange, ipToBytes, ipv4ToBuffer, ipv4ToBytes, ipv4ToInt, ipv6ToBigInt, ipv6ToBuffer, ipv6ToBytes, isIPv4, isIPv6, isLoopbackIPv4, isLoopbackIPv6, isMulticastIPv4, isMulticastIPv6, isPrivateIPv4, isPrivateIPv6, isValidIP, lastIPInRange, maskForCIDR, nextIPv4, nextIPv6, parseCIDR, prevIPv4, prevIPv6, rangeSize, rangesOverlap, toBinary, toNumber };