import { SwarmOptions } from "hyperswarm";
import { Peer } from "./types";
interface ConnectionManagerConfig {
    serverKey: Buffer;
    onConnection: (peer: Peer) => void;
    onDisconnection?: () => void;
    swarmOptions: SwarmOptions | undefined;
}
export declare class ConnectionManager {
    private _config;
    private _currentPeer;
    private _heartbeatInterval;
    private _isConnecting;
    private _serverSwarm;
    constructor(config: ConnectionManagerConfig);
    get isConnected(): boolean;
    get currentPeer(): Peer | null;
    connect(): Promise<void>;
    private handleConnection;
    private handleSwarmError;
    private handleDisconnection;
    private startHeartbeat;
    private cleanup;
    destroy(): Promise<void>;
}
export {};
