import { SatelliteError, SocketCloseReason } from '../util/index.js'; export type Data = string | Uint8Array; export interface ConnectionOptions { url: string; } export declare const AUTH_EXPIRED_CLOSE_EVENT = "JWT-expired"; export declare const PROTOCOL_VSN: string; export interface Socket { open(opts: ConnectionOptions): this; write(data: Data): this; closeAndRemoveListeners(): this; onMessage(cb: (data: Data) => void): void; onError(cb: (error: SatelliteError) => void): void; onClose(cb: (reason: SocketCloseReason) => void): void; onceConnect(cb: () => void): void; onceError(cb: (error: SatelliteError) => void): void; removeErrorListener(cb: (error: SatelliteError) => void): void; } export type SocketFactory = new (protocolVersion: string) => Socket;