/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { DecodedWebcastPushFrame, WebSocketParams } from '../../../types/client';
import TypedEventEmitter from 'typed-emitter';
import CookieJar from '../../../lib/web/lib/cookie-jar';
import { ClientOptions, WebSocket } from 'ws';
type EventMap = {
    close: () => void;
    messageDecodingFailed: (error: Error) => void;
    protoMessageFetchResult: (response: any) => void;
    webSocketData: (data: Buffer) => void;
    imEnteredRoom: (decodedContainer: DecodedWebcastPushFrame) => void;
};
type TypedWebSocket = new (...args: any[]) => WebSocket & TypedEventEmitter<EventMap>;
declare const TikTokWsClient_base: TypedWebSocket;
export default class TikTokWsClient extends TikTokWsClient_base {
    protected readonly webSocketParams: WebSocketParams;
    protected webSocketPingIntervalMs: number;
    protected pingInterval: NodeJS.Timeout | null;
    protected seqId: number;
    constructor(wsUrl: string, cookieJar: CookieJar, webSocketParams: WebSocketParams, webSocketHeaders: Record<string, string>, webSocketOptions: ClientOptions, webSocketPingIntervalMs?: number);
    get open(): boolean;
    /**
     * Send a message to the WebSocket server
     * @param data The message to send
     * @returns True if the message was sent, false otherwise
     */
    sendBytes(data: Uint8Array): boolean;
    protected onDisconnect(): void;
    /**
     * Handle incoming messages
     * @param message The incoming WebSocket message (type => Buffer)
     * @protected
     */
    protected onMessage(message: Buffer): Promise<void>;
    /**
     * Static Keep-Alive ping
     */
    protected sendHeartbeat(): void;
    /**
     * EXPERIMENTAL: Switch to a different TikTok LIVE room while connected to the WebSocket
     * @param roomId The room ID to switch to
     */
    switchRooms(roomId: string): void;
    /**
     * Acknowledge the message was received
     */
    protected sendAck({ logId, protoMessageFetchResult: { internalExt } }: DecodedWebcastPushFrame): void;
}
export {};
//# sourceMappingURL=ws-client.d.ts.map