import { NodeCapabilities } from './EdgeNodeModeDetector'; /** * 网络地址检测结果 */ export interface NetworkAddressInfo { ipv4?: string; ipv6?: string; ipv4Public?: string; ipv6Public?: string; hasPublicIPv6: boolean; } /** * 边缘节点能力检测器 * 负责检测和报告节点的各种能力信息 */ export interface EdgeNodeCapabilityDetectorOptions { /** * 基础能力配置,可以通过配置文件或环境变量设置 */ baseCapabilities?: Partial; /** * 动态检测选项 */ dynamicDetection?: { enableBandwidthTest?: boolean; enableLocationDetection?: boolean; enableNetworkDetection?: boolean; bandwidthTestUrl?: string; locationServiceUrl?: string; ipv4ServiceUrl?: string; ipv6ServiceUrl?: string; }; } export declare class EdgeNodeCapabilityDetector { private readonly logger; private readonly baseCapabilities; private readonly dynamicDetection; constructor(options?: EdgeNodeCapabilityDetectorOptions); /** * 检测并返回完整的节点能力信息 */ detectCapabilities(): Promise; /** * 检测Solid协议版本 */ private detectSolidProtocolVersion; /** * 检测存储后端类型 */ private detectStorageBackends; /** * 检测支持的认证方法 */ private detectAuthMethods; /** * 动态检测网络带宽(简化版本) */ private detectBandwidth; /** * 动态检测地理位置信息 */ private detectLocation; /** * 将NodeCapabilities转换为字符串数组(用于向后兼容) */ static capabilitiesToStringArray(capabilities: NodeCapabilities): string[]; /** * 从字符串数组解析NodeCapabilities(用于向后兼容) */ static parseCapabilitiesFromStringArray(capabilityStrings: string[]): Partial; /** * 检测网络地址信息(IPv4/IPv6) */ detectNetworkAddresses(): Promise; /** * 判断是否为全球单播 IPv6 地址 (2xxx: 或 3xxx:) */ private isGlobalIpv6; /** * 检测本地网卡地址 */ private detectLocalNetworkAddresses; /** * 通过外部服务检测公网 IPv4 地址 */ private detectPublicIPv4; /** * 通过外部服务检测公网 IPv6 地址 */ private detectPublicIPv6; /** * 测试 IPv6 地址是否可从外部访问 * @param ipv6 要测试的 IPv6 地址 * @param port 要测试的端口 * @param timeoutMs 超时时间(毫秒) */ testIPv6Reachability(ipv6: string, port: number, timeoutMs?: number): Promise; }