import { EventEmitter } from 'events'; import type { AlltickConfig } from '../types/index.js'; export declare enum WsMessageType { LOGIN = 1, LOGIN_RESPONSE = 2, HEARTBEAT = 3, HEARTBEAT_RESPONSE = 4, SUBSCRIBE = 5, SUBSCRIBE_RESPONSE = 6, UNSUBSCRIBE = 7, UNSUBSCRIBE_RESPONSE = 8, PUSH = 11 } export declare enum WsSubscribeType { TRADE = 1, ORDER_BOOK = 2 } export interface WsTradeData { code: string; price: string; volume: string; timestamp: number; } export interface WsOrderBookData { code: string; bids: [string, string][]; asks: [string, string][]; timestamp: number; } export type WsPushData = WsTradeData | WsOrderBookData; export interface WsConfig extends AlltickConfig { reconnectInterval?: number; maxReconnectAttempts?: number; heartbeatInterval?: number; } export declare class AlltickWsClient extends EventEmitter { private config; private ws; private reconnectAttempts; private heartbeatTimer; private isManualClose; private pendingSubscriptions; constructor(config: WsConfig); connect(): Promise; private sendLogin; private handleMessage; private send; private startHeartbeat; private stopHeartbeat; private attemptReconnect; subscribe(codes: string[], subType: WsSubscribeType): Promise; unsubscribe(codes: string[], subType: WsSubscribeType): Promise; disconnect(): void; isConnected(): boolean; } export declare function createWsClient(config: WsConfig): AlltickWsClient; //# sourceMappingURL=client.d.ts.map