import { IBetterLogger } from "@codiac.io/codiac-common";
import { Result } from "@codiac.io/codiac-common/contracts";
import { interfaces } from "inversify";
import { WebsocketListenerSettings } from "./websocket-listener-settings";
import { ApiUserCreds } from "../../apis/codiac-api/common/api-user-creds";
import { IMessageSendMeta, IMessagingClient, MessageHandlerOf, MessagePayload } from "../../uilogic/i-messaging-client";
export declare class RelayWebsocketClient implements IMessagingClient {
    private credentials;
    private logger;
    static bootstrap(ioc: interfaces.Container, settings?: WebsocketListenerSettings | undefined): void;
    static readonly DEFAULT_SETTINGS: Required<WebsocketListenerSettings>;
    private static readonly SOCKET_ID_UNDEFINED;
    private static readonly NOT_USED_PLACEHOLDER;
    constructor(credentials: ApiUserCreds, settings: WebsocketListenerSettings, logger: IBetterLogger);
    private readonly settings;
    private socket;
    connect(connectionId?: string): Promise<string>;
    isConnected(): boolean;
    private cnxnId_backer;
    get connectionId(): string | undefined;
    private set connectionId(value);
    disconnect(): Promise<void>;
    publish(msg: MessagePayload, meta?: Partial<IMessageSendMeta>): Promise<void>;
    /** Invoke and wait for a direct response (Request-response pattern). */
    request<TMsg extends MessagePayload, TRes extends Result>(msg: TMsg, meta?: Partial<IMessageSendMeta>, timeoutInSecs?: number): Promise<TRes>;
    /** Late-bound subscribers to incoming messages, mapped by `SocketAction.action`.
   *
   * If multiple handlers are registered for a given action,
   * they get fired in order they subscribed (first-come first served).
   */
    private subscribers;
    /** Returns the subscription id for the handler (reqd for unsubcribing).
     */
    subscribe<TMsg extends MessagePayload>(topics: string, handler: MessageHandlerOf<TMsg>): string;
    /** Removes the given listener.  (IDEMPOTENT) Returns whether a handler was indeed removed (false if it didn't exist).
     *
     * Throws any exceptions. */
    unsubscribe(topics: string, options?: {
        force?: boolean;
        subscriptionId?: string;
    }): Promise<boolean>;
    /** Fires any registered handlers.
     * (and doesnt wait for them).
    */
    private routeInboundMessage;
    private extractInboundMeta;
}
