import * as plugins from './smartnetwork.plugins.js';
import { type IIpIntelligenceResult } from './smartnetwork.classes.ipintelligence.js';
/**
 * Configuration options for SmartNetwork
 */
export interface SmartNetworkOptions {
    /** Cache time-to-live in milliseconds for gateway and public IP lookups */
    cacheTtl?: number;
}
/**
 * A hop in a traceroute result
 */
export interface Hop {
    ttl: number;
    ip: string;
    rtt: number | null;
}
/**
 * Options for the findFreePort method
 */
export interface IFindFreePortOptions {
    /** If true, selects a random available port within the range instead of the first one */
    randomize?: boolean;
    /** Array of port numbers to exclude from the search */
    exclude?: number[];
}
/**
 * SmartNetwork simplifies actions within the network.
 * Uses a Rust binary for system-dependent operations (ping, traceroute, port scanning, gateway detection).
 */
export declare class SmartNetwork {
    /** Static registry for external plugins */
    static pluginsRegistry: Map<string, any>;
    /** Register a plugin by name */
    static registerPlugin(name: string, ctor: any): void;
    /** Unregister a plugin by name */
    static unregisterPlugin(name: string): void;
    private options;
    private cache;
    private rustBridge;
    private bridgeStarted;
    private ipIntelligence;
    constructor(options?: SmartNetworkOptions);
    /**
     * Start the Rust binary bridge. Must be called before using ping, traceroute,
     * port scanning, or gateway operations. Safe to call multiple times.
     */
    start(): Promise<void>;
    /**
     * Stop the Rust binary bridge.
     */
    stop(): Promise<void>;
    /**
     * Ensure the Rust bridge is running before sending commands.
     */
    private ensureBridge;
    /**
     * Get network speed via Cloudflare speed test (pure TS, no Rust needed).
     */
    getSpeed(opts?: {
        parallelStreams?: number;
        duration?: number;
    }): Promise<{
        ip: string;
        serverLocation: {
            shortId: string;
            name: string;
            availableLocations: {
                [key: string]: string;
            };
        };
        downloadSpeed: string;
        uploadSpeed: string;
        maxTime: number;
        minTime: number;
        averageTime: number;
        medianTime: number;
        jitter: number;
    }>;
    /**
     * Send ICMP pings to a host. Optionally specify count for multiple pings.
     */
    ping(host: string, opts?: {
        timeout?: number;
        count?: number;
    }): Promise<any>;
    /**
     * Check if a local port is unused (both IPv4 and IPv6)
     */
    isLocalPortUnused(port: number): Promise<boolean>;
    /**
     * Find the first available port within a given range
     */
    findFreePort(startPort: number, endPort: number, options?: IFindFreePortOptions): Promise<number | null>;
    /**
     * Check if a remote port is available
     */
    isRemotePortAvailable(target: string, portOrOpts?: number | {
        port?: number;
        protocol?: 'tcp' | 'udp';
        timeout?: number;
        retries?: number;
    }): Promise<boolean>;
    /**
     * List network interfaces (gateways) — pure TS, no Rust needed.
     */
    getGateways(): Promise<Record<string, plugins.os.NetworkInterfaceInfo[]>>;
    /**
     * Get the default gateway interface and its addresses.
     */
    getDefaultGateway(): Promise<{
        ipv4: plugins.os.NetworkInterfaceInfo;
        ipv6: plugins.os.NetworkInterfaceInfo;
    } | null>;
    /**
     * Lookup public IPv4 and IPv6 — pure TS, no Rust needed.
     */
    getPublicIps(): Promise<{
        v4: string | null;
        v6: string | null;
    }>;
    /**
     * Resolve DNS records (A, AAAA, MX) — uses smartdns, no Rust needed.
     */
    resolveDns(host: string): Promise<{
        A: string[];
        AAAA: string[];
        MX: {
            exchange: string;
            priority: number;
        }[];
    }>;
    /**
     * Perform a simple HTTP/HTTPS endpoint health check — pure TS.
     */
    checkEndpoint(urlString: string, opts?: {
        timeout?: number;
        rejectUnauthorized?: boolean;
    }): Promise<{
        status: number;
        headers: Record<string, string>;
        rtt: number;
    }>;
    /**
     * Perform a traceroute: hop-by-hop latency using the Rust binary.
     */
    traceroute(host: string, opts?: {
        maxHops?: number;
        timeout?: number;
    }): Promise<Hop[]>;
    /**
     * Get IP intelligence: ASN, organization, geolocation, and RDAP registration data.
     * Combines RDAP (RIRs), Team Cymru DNS, and MaxMind GeoLite2 — all run in parallel.
     * Pure TS, no Rust needed.
     */
    getIpIntelligence(ip: string): Promise<IIpIntelligenceResult>;
    /**
     * Internal caching helper
     */
    private getCached;
}
