import { Timer, EventDispatcher } from "../../utils";
interface SocketEventMap {
    'send-success': {
        msg: string;
    };
    'send-fail': {
        msg: string;
    };
    'send-heart': {};
    'open': {};
    'close': {};
    'no-message-timeout': {};
    'message': {
        message: MessageEvent;
    };
}
interface SocketOptions {
    url: string;
    heartBeat: number;
    heartMsg: string;
    reconnect: boolean;
    reconnectTime: number;
    reconnectMaxCount: number;
    noMessageTime: number;
}
export declare class Socket extends EventDispatcher<SocketEventMap> {
    ws: WebSocket | null;
    alive: boolean;
    timer: Timer;
    options: SocketOptions;
    heartTimer: number | null;
    reconnectTimer: number | null;
    noMessageTimer: number | null;
    constructor(options?: Partial<SocketOptions>);
    initWebsocket(): void;
    startHeart(): void;
    stopHeart(): void;
    startReconnect(time?: number): void;
    stopReconnect(): void;
    startOnMessageTimer(): void;
    stopOnMessageTimer(): void;
    send(data: any): boolean;
    onOnline: () => void;
    registryEvent(): void;
    unRegistryEvent(): void;
    close(): void;
    dispose(): void;
}
export {};
