/*!
 * 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 shouldReconnect;
    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.
     * @param reconnect - Whether to automatically reconnect on connection loss.
     * @return a Promise for the web socket connection.
     */
    static buildInstance(url: DittoURL, handler: ResponseHandler, authProviders: AuthProvider[], reconnect?: boolean): Promise<FetchWebSocket>;
    executeCommand(request: string): void;
    close(code?: number, reason?: 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, reconnect?: boolean): Promise<FetchWebSocket>;
    withConnectionDetails(url: DittoURL, authProviders: AuthProvider[]): WebSocketImplementationBuilderHandler;
}
//# sourceMappingURL=fetch-websocket.d.ts.map