//#region index.d.ts /** Biggest possible IPv4 address as a BigInt */ declare const max4: bigint; /** Biggest possible IPv6 address as a BigInt */ declare const max6: bigint; /** IP version: `4` for IPv4, `6` for IPv6, `0` for invalid */ type IPVersion = 4 | 6 | 0; /** Result of parsing an IP address string */ type ParsedIP = { /** Numeric representation of the IP address */number: bigint; /** IP version: `4` for IPv4, `6` for IPv6 */ version: 4 | 6; /** Whether this is an IPv4-mapped IPv6 address (e.g. `::ffff:127.0.0.1`) */ ipv4mapped?: boolean; /** IPv6 scope ID (the part after `%`, e.g. `eth0` in `fe80::1%eth0`) */ scopeid?: string; }; /** Options for `stringifyIp` and `normalizeIp` */ type StringifyOpts = { /** Whether to compress IPv6 using `::` for longest zero run. Default: `true` */compress?: boolean; /** Whether to render IPv4-mapped IPv6 addresses in hex instead of dotted decimal. Default: `false` */ hexify?: boolean; /** Whether to convert IPv4-mapped IPv6 addresses to plain IPv4. Default: `false` */ mapv4?: boolean; }; /** Returns the IP version: `4`, `6`, or `0` if not a valid IP */ declare function ipVersion(ip: string): IPVersion; /** Parse an IP address string into a `ParsedIP` object */ declare function parseIp(ip: string): ParsedIP; /** Convert a `ParsedIP` object back to an IP address string */ declare function stringifyIp({ number, version, ipv4mapped, scopeid }: ParsedIP, { compress, hexify, mapv4 }?: StringifyOpts): string; /** Round-trip an IP address through `parseIp` and `stringifyIp`, normalizing its representation */ declare function normalizeIp(ip: string, opts?: StringifyOpts): string; //#endregion export { IPVersion, ParsedIP, StringifyOpts, ipVersion, max4, max6, normalizeIp, parseIp, stringifyIp };