import { StreamApi, WebSocketClient } from '@vertexvis/stream-api';
import { Disposable, EventDispatcher, Listener } from '@vertexvis/utils';
import { Config } from '../config';
import { FrameCameraType } from '../types/frameCamera';
import { ViewerStreamState } from './state';
interface FrameStreamOptions {
    /**
     * The number of seconds before the token expires, when the token will be
     * refreshed. Defaults to 30 seconds.
     */
    tokenRefreshOffsetInSeconds?: number;
    /**
     * Indicates if debug logs will be emitted for websocket messages.
     */
    loggingEnabled?: boolean;
    /**
     * The number of seconds after the host goes offline before a reconnect is
     * attempted.
     */
    offlineThresholdInSeconds?: number;
    /**
     * The number of seconds before we consider loading a scene failed.
     */
    loadTimeoutInSeconds?: number;
    /**
     * Enable temporal refinement of still images.
     */
    enableTemporalRefinement?: boolean;
}
interface UpdateFields {
    dimensions?: ViewerStream['dimensions'];
    streamAttributes?: ViewerStream['streamAttributes'];
    enableTemporalRefinement?: ViewerStream['enableTemporalRefinement'];
    frameBgColor?: ViewerStream['frameBgColor'];
    config?: ViewerStream['config'];
    clientId?: ViewerStream['clientId'];
    deviceId?: ViewerStream['deviceId'];
}
export declare class ViewerStream extends StreamApi {
    private static WS_RECONNECT_DELAYS;
    private dimensions;
    private streamAttributes;
    private enableTemporalRefinement;
    private frameBgColor;
    private config;
    private clientId;
    private deviceId;
    private abortController?;
    private state;
    private pausedState?;
    readonly stateChanged: EventDispatcher<ViewerStreamState>;
    private options;
    constructor(ws: WebSocketClient, opts?: FrameStreamOptions);
    isPaused(): boolean;
    getState(): ViewerStreamState;
    disconnect(): void;
    load(urn: string, clientId: string | undefined, deviceId: string | undefined, config?: Config, cameraType?: FrameCameraType): Promise<ViewerStreamState>;
    update(fields: UpdateFields): void;
    pause(): void;
    resume(): Promise<void>;
    private loadIfConnectingOrConnected;
    private loadIfDisconnected;
    private connectWithNewStream;
    private connectToExistingStream;
    private openWebsocketStream;
    private requestNewOrExistingStream;
    private requestNewStream;
    private requestReconnectStream;
    private requestClock;
    private reconnectWhenNeeded;
    private refreshTokenWhenExpired;
    private reconnectWhenOffline;
    private closeAndReconnect;
    private waitForFrame;
    private acknowledgeFrameRequests;
    private updateState;
    private getDimensions;
    private ifState;
    onStateChanged(listener: Listener<ViewerStreamState>): Disposable;
}
export {};
