UNPKG

@eclipse-ditto/ditto-javascript-client-dom

Version:

DOM implementation of Eclipse Ditto JavaScript API to be used in browsers.

57 lines 2.37 kB
/*! * Copyright (c) 2019 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ import { WebSocketImplementationBuilderUrl } from '../../api/src/client/request-factory/websocket-request-handler'; import { ResponseHandler, WebSocketImplementation, WebSocketImplementationBuilderHandler } from '../../api/src/client/request-factory/resilience/websocket-resilience-interfaces'; import { AuthProvider, DittoURL } from '../../api/src/auth/auth-provider'; /** * Browser implementation of a web socket requester. */ export declare class FetchWebSocket implements WebSocketImplementation { private webSocket; private readonly webSocketUrl; private readonly handler; private connected; private constructor(); /** * Builds an instance of FetchWebSocket. * * @param url - The Url of the service. * @param handler - The handler that gets called for responses from the web socket. * @param authProviders - The auth providers to use. * @return a Promise for the web socket connection. */ static buildInstance(url: DittoURL, handler: ResponseHandler, authProviders: AuthProvider[]): Promise<FetchWebSocket>; executeCommand(request: string): void; /** * Reestablishes a failed web socket connection. * * @param retry - The amount of time to wait to reconnect. * @return a Promise for the reestablished web socket connection. */ private reconnect; /** * Sets up the handler so it receives events from the web socket. */ private setHandles; } /** * Builder for the Browser implementation of a web socket. */ export declare class FetchWebSocketBuilder implements WebSocketImplementationBuilderUrl, WebSocketImplementationBuilderHandler { private dittoUrl; private authProviders; constructor(); withHandler(handler: ResponseHandler): Promise<FetchWebSocket>; withConnectionDetails(url: DittoURL, authProviders: AuthProvider[]): WebSocketImplementationBuilderHandler; } //# sourceMappingURL=fetch-websocket.d.ts.map