///
import { EventEmitter } from "events";
import { WsEvent } from "../domain/ws-event";
import { handlerType } from "../domain/handler-type";
import { WebsocketInterface } from "../domain/websocket-interface";
import { ConnectionConfigInput, ConnectionConfig } from "../domain/connection-config";
export interface IConnection {
open(): void;
close(): void;
connected(): boolean;
sendEvent(event: string, data: any, channel?: string): Promise;
bind(event: string, handler: handlerType): Promise | void;
getUri(): string;
}
export declare class Connection implements IConnection {
options: ConnectionConfig;
uri: string;
socket: WebsocketInterface;
eventEmitter: EventEmitter;
sendQueue: Array;
state: string;
socketId: string | null;
reconnecting: boolean;
maintainConnection: boolean;
reconnectTimer: any;
reconnectAttempts: number;
activityTimeout: number | null;
activityTimer: any;
pingResponseTimeout: any;
clockStopTime: number;
clockStopTimer: any;
constructor(path: string, options?: ConnectionConfigInput, socket?: WebsocketInterface);
open(): void;
close(): void;
connected(): boolean;
getUri(): string;
sendEvent(event: string, data: any, channel?: string): Promise;
bind(event: string, handler?: handlerType): Promise | void;
_getWsOptions(): any;
_attemptConnect: () => void;
_handleSocketMessage(event: any): void;
_handleSocketOpen(): void;
_handleSocketClose(data: any): void;
_handleSocketError(data: any): void;
_handleConnectionEstablished(data: any): void;
_scheduleReconnect: () => void;
_clearReconnectTimer(): void;
_setReconnectTimer(): void;
_handleReconnectTick(): void;
_clearActivityTimer(): void;
_setActivityTimer(): void;
_handleActivityTick(): void;
_handlePingResponseTimeout(): void;
_sendAllBuffered(): void;
_sendWhenReady(payload: WsEvent): Promise;
_setState(state: string, data: any): void;
_isSocketClosed(): boolean;
_handleClockStopCheck(): void;
}