import * as signalR from "@microsoft/signalr"; import { IDataFrame } from "../DataFrame"; import { ConnectionResult, IExalusConnectionService, AuthorizationInfo, ConnectionState, StreamHandler, BrokerInfo } from "./IExalusConnectionService"; import { ITypedEvent } from "../TypedEvent"; export declare class SignalrLogger implements signalR.ILogger { private readonly _log; log(level: signalR.LogLevel, message: string): void; } export declare class ExalusConnectionService implements IExalusConnectionService { private static readonly PING_INTERVAL_MS; private static readonly MAX_CONSECUTIVE_PING_FAILURES; private static readonly SERVER_TIMOUT_MS; static SignalRLogLevel: signalR.LogLevel; private _connection?; private _connectTask; private _authorizeTask; private _pingTimerId; private _consecutivePingFailures; private _disconnectedOnPurpose; private _address; private _currentAddress?; private _serversBrokerAddress; private readonly _serversBrokerAddressList; private _allBrokersChecked; private readonly _packetsBrokerServers; private _connectedServerAddressResult; private readonly _connectedServerAddressWaiters; private _isAuthorized; private _serialId?; private _PIN?; private _lastReceivedPacket; private _everConnected; private readonly _pendingRequests; private readonly _log; private readonly _appState; private _controllerConfiguration; private _cache; private _session; private readonly _dataReceivedEvent; private readonly _pongReceivedEvent; private readonly _authorizationReceivedEvent; private readonly _registrationReceivedEvent; private readonly _streamStartedEvent; private readonly _connectionStateChangedEvent; private readonly _errorOccuredEvent; static readonly ServiceName = "ExalusConnectionService"; constructor(); GetServiceName(): string; GetAuthorizationInfo(): AuthorizationInfo | null; GetControllerSerialNumber(): string | undefined; GetControllerPin(): string | undefined; SetServersBrokerAddress(a: string): void; SetDefaultPacketsBrokerAddress(a: string): void; GetConnectedBrokerInfoAsync(timeoutMs?: number | null): Promise; EnablePacketsLogging(): void; DisablePacketsLogging(): void; SubscribeTo(resourceId: string, handler: (d: IDataFrame) => void): () => void; private reauthorizeIfPossible; GetServerAddressAsync(): Promise; private rotateServersBroker; ConnectAsync(address: string): Promise; ConnectAndAuthorizeAsync(info: AuthorizationInfo): Promise; private resetConnectedServerAddressResolution; private resolveConnectedBrokerInfo; AuthorizeAsync(info: AuthorizationInfo): Promise; IsConnected(): boolean; DisconnectAsync(): Promise; SendAsync(dataFrame: IDataFrame, logTx?: boolean): Promise; RestoreConnectionAsync(): Promise; SendAndWaitForResponseAsync(dataFrame: IDataFrame, timeout: number, useCache: boolean, logTransmission?: boolean, retryOnUnauthorized?: boolean): Promise>; SendAndHandleResponseAsync(dataFrame: IDataFrame, timeout: number, dataHandler: (r: IDataFrame) => void, logTransmission?: boolean): Promise; SendAndHandleStreamAsync(dataFrame: IDataFrame, streamHandler: StreamHandler, logTransmission?: boolean): Promise; PingControllerAsync(): Promise; OnDataReceivedEvent(): ITypedEvent; OnConnectionStateChangedEvent(): ITypedEvent; OnErrorOccuredEvent(): ITypedEvent<[string, string]>; private serialisedConnect; private waitForState; private connectCore; private waitForReconnection; private initializeServices; private wireConnectionEvents; private startPingLoop; private isBusy; private pingOnce; private validateConnectionToController; private _tryReconnect; private _onVisibility; private _onHidden; private _onVisible; private cleanup; }