interface Subscription { id: string; topic: string; callback: (message: { body: string; }) => void; subscription?: () => void; } export default class WssConnection { url: string; endpoint: string; subscriptions: Array; socket: { (url: string, _reserved?: any, options?: SockJS.Options | undefined): WebSocket; new (url: string, _reserved?: any, options?: SockJS.Options | undefined): WebSocket; prototype: WebSocket; CONNECTING: SockJS.CONNECTING; OPEN: SockJS.OPEN; CLOSING: SockJS.CLOSING; CLOSED: SockJS.CLOSED; } | undefined; client: any; queuedMessages: Array; processingMsg: boolean; wssBroken: boolean; /** * * @param {String} url url of the wss * @param {String} endpoint of the wss * @param {Map} topics list of topics and associated callback */ constructor(url: string, endpoint: string); processQueuedMessages(): Promise; connect(): Promise; connectionErrorReconnect(): Promise; connectionSuccess(): void; subscribe(topic: string, callback: (message: { body: string; }) => any): void; unsubscribe(topic: string): void; disconnect(): void; } export {};