Files
SnowLuma/.pnpm-store/v11/files/af/69b349e3fb445cd7a129882bf01b4cb2d3c11ebcaefdd554487d13b113390661164b22186ca5d9bc9c80c4380a30355bf767ea8c970d0f312b4965cf268219
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

54 lines
1.8 KiB
Plaintext

import { AddressType } from "../helper/conninfo/types.js";
//#region src/utils/ipaddr.d.ts
/**
* Expand IPv6 Address
* @param ipV6 Shorten IPv6 Address
* @return expanded IPv6 Address
*/
export declare const expandIPv6: (ipV6: string) => string;
export declare const INVALID_IP_ADDRESS_ERROR_CODE = "ERR_INVALID_IP_ADDRESS";
export type InvalidIPAddressError = TypeError & {
code: typeof INVALID_IP_ADDRESS_ERROR_CODE;
};
/**
* Distinct Remote Addr
* @param remoteAddr Remote Addr
*/
export declare const distinctRemoteAddr: (remoteAddr: string) => AddressType;
/**
* Convert IPv4 to Uint8Array
* @param ipv4 IPv4 Address
* @returns BigInt
*/
export declare const convertIPv4ToBinary: (ipv4: string) => bigint;
/**
* Convert IPv6 to Uint8Array
* @param ipv6 IPv6 Address
* @returns BigInt
*/
export declare const convertIPv6ToBinary: (ipv6: string) => bigint;
/**
* Convert a binary representation of an IPv4 address to a string.
* @param ipV4 binary IPv4 Address
* @return IPv4 Address in string
*/
export declare const convertIPv4BinaryToString: (ipV4: bigint) => string;
/**
* Check if a binary IPv6 address is an IPv4-mapped IPv6 address (::ffff:x.x.x.x)
* @param ipv6binary binary IPv6 Address
* @return true if the address is an IPv4-mapped IPv6 address
*/
export declare const isIPv4MappedIPv6: (ipv6binary: bigint) => boolean;
/**
* Extract the IPv4 portion from an IPv4-mapped IPv6 address
* @param ipv6binary binary IPv4-mapped IPv6 Address
* @return binary IPv4 Address
*/
export declare const convertIPv4MappedIPv6ToIPv4: (ipv6binary: bigint) => bigint;
/**
* Convert a binary representation of an IPv6 address to a string.
* @param ipV6 binary IPv6 Address
* @return normalized IPv6 Address in string
*/
export declare const convertIPv6BinaryToString: (ipV6: bigint) => string;
//#endregion