import Session from './Identity/Session';
import User from './Identity/User';
import { PubSubEvent } from './PubSubEvents';
import { Notifiable, RealtimeConnection } from './RealtimeConnection';
export declare const REALTIME_CONNECTION_RETRY_TIME = 5000;
export declare const ENABLE_REALTIME_UNSUBSCRIBE_FIX_FEATURE_FLAG = "enable_realtime_unsubscribe_fix";
export declare class UserWireMessage {
    id: number;
    auth_token: string;
    bringg_user_id: string;
    constructor(user: User);
}
export default class PersistentConnection implements Notifiable {
    session: Session;
    connection: RealtimeConnection;
    private readonly wrappedHandlersByEvent;
    static wrapEventHandler(eventName: string, initialHandler: any, additionalHandler?: (string: any, any: any) => void): (any: any) => void;
    static init(session: Session): Promise<PersistentConnection>;
    private constructor();
    private handshake;
    onConnect(connection: RealtimeConnection): Promise<void>;
    onDisconnect(connection: RealtimeConnection): Promise<void>;
    onReconnect(connection: RealtimeConnection): Promise<void>;
    private publishInternal;
    private subscribeInternal;
    unsubscribe<T>(eventType: PubSubEvent<T>, handler?: (message: T) => void): void;
    publish<T>(ev: PubSubEvent<T>, mess: T, ackCallback?: (message: any | undefined) => void): void;
    subscribe<T>(eventType: PubSubEvent<T>, handler: (message: T) => void): void;
    dispose(): Promise<void>;
    private createWrappedHandler;
    private isUnsubscribeFixEnabled;
    private getEventHandlers;
    private createEventHandlers;
    private getOrCreateEventHandlers;
    private subscribeWithWrappedHandler;
    private unsubscribeWrappedHandler;
}
