import { EventCallback } from '../../../common';
import { MessageTransport } from './base-message-transport';
export declare enum KosWSTransportStatus {
    NOT_INITIALIZED = "not_initialized",
    INITIALIZED = "initialized",
    OFFLINE = "OFFLINE",
    ONLINE = "ONLINE"
}
export interface IKosMessage {
    [k: string]: string | number | boolean;
}
export interface IKosConnectionStatus {
    status: string;
    message?: string;
}
export interface KosSubscriptionParams {
    topic: string;
    callback: EventCallback;
    fos?: boolean;
    bridge?: boolean;
    destinationAddress?: string | null;
    explicitDestination?: boolean;
}
export interface IKosServiceTransport {
    host: string;
    port: number;
    protocol: string;
    token?: string;
    alias?: string;
    connectionEstablished: boolean;
    authorized: boolean;
    socket?: MessageTransport;
    init(): IKosServiceTransport;
    subscribeTopic(params: KosSubscriptionParams): VoidFunction;
    whenReady(): Promise<IKosConnectionStatus>;
    fosSocket?: MessageTransport;
}
export type KosCallback = (msg: IKosMessage) => void;
export { WebSocketEvents } from './base-message-transport';
interface WebSocketTransportParams {
    host?: string;
    port?: number;
    protocol?: string;
    token?: string;
    initialize?: boolean;
    alias?: string;
    fos?: {
        port: number;
    };
}
export declare class WebSocketTransport implements IKosServiceTransport {
    private static _instance;
    host: string;
    port: number;
    protocol: string;
    private _token?;
    private webSocketSupported;
    authorized: boolean;
    alias?: string;
    socket?: MessageTransport;
    fosSocket?: MessageTransport;
    fosPort?: number;
    useFosTransport: boolean;
    private reconnectAttempts;
    private static readonly MAX_RECONNECT_ATTEMPTS;
    private static readonly BASE_DELAY_MS;
    private static readonly MAX_DELAY_MS;
    constructor({ host, port, protocol, token, initialize, alias, fos, }: WebSocketTransportParams);
    get connectionEstablished(): boolean;
    init(): this;
    /**
     * Schedules a reconnect attempt using exponential backoff with jitter.
     * Counter persists across BaseTransport re-creation, so the cap actually
     * fires after MAX_RECONNECT_ATTEMPTS consecutive failures rather than
     * resetting on every new BaseTransport instance.
     */
    private scheduleReconnect;
    private calculateBackoffDelay;
    private _sendSubscriptionMessage;
    subscribeTopic({ topic, callback, fos, bridge, destinationAddress, explicitDestination, }: KosSubscriptionParams): () => void;
    whenReady(): Promise<{
        status: string;
    }>;
    get token(): string;
    set token(token: string);
    static host(host?: string): typeof WebSocketTransport;
    static port(port?: number): typeof WebSocketTransport;
    static alias(alias: string): void;
    static getInstance(port?: number, token?: string): IKosServiceTransport;
}
//# sourceMappingURL=webSocketTransport.d.ts.map