UNPKG

@wandelbots/nova-js

Version:

Official JS client for the Wandelbots API

43 lines 1.52 kB
import ReconnectingWebSocket from "reconnecting-websocket"; import * as v2 from "./v2/mock/MockNovaInstance"; import * as v1 from "./v1/mock/MockNovaInstance"; export declare class AutoReconnectingWebsocket extends ReconnectingWebSocket { readonly opts: { mock?: v1.MockNovaInstance | v2.MockNovaInstance; onDispose?: () => void; }; receivedFirstMessage?: MessageEvent; targetUrl: string; disposed: boolean; constructor(targetUrl: string, opts?: { mock?: v1.MockNovaInstance | v2.MockNovaInstance; onDispose?: () => void; }); changeUrl(targetUrl: string): void; sendJson(data: unknown): void; /** * Permanently close this websocket and indicate that * this object should not be used again. **/ dispose(): void; /** * Returns a promise that resolves once the websocket * is in the OPEN state. */ opened(): Promise<void>; /** * Returns a promise that resolves once the websocket * is in the CLOSED state. */ closed(): Promise<void>; /** * Returns a promise that resolves when the first message * is received from the websocket. Resolves immediately if * the first message has already been received. */ firstMessage(): Promise<MessageEvent<any>>; /** * Returns a promise that resolves when the next message * is received from the websocket. */ nextMessage(): Promise<MessageEvent<any>>; } //# sourceMappingURL=AutoReconnectingWebsocket.d.ts.map