import type { ConnectionState } from '../../types'; import type { ReceiveCallback, StateChangeCallback, StreamingData, StreamingTransportInterface, StreamingTransportOptions } from '../types'; import type SignalR from '@microsoft/signalr'; declare global { interface Window { signalrCore: typeof SignalR; } } declare type RawCoreSignalRStreamingMessage = { ReferenceId: string; PayloadFormat: 1 | 2; Payload: StreamingData; MessageId: number; }; declare class SignalrCoreTransport implements StreamingTransportInterface { baseUrl: string; name: "signalrCore"; connection: SignalR.HubConnection | null; authToken: string | null; authExpiry: number | null; contextId: string | null; messageStream: SignalR.IStreamResult | null; lastMessageId: number | null; hasStreamingStarted: boolean; isDisconnecting: boolean; hasTransportError: boolean; state: ConnectionState; stateChangedCallback: StateChangeCallback; receivedCallback: ReceiveCallback; unauthorizedCallback: (url: string) => void; setConnectionSlowCallback: () => void; subscriptionResetCallback: () => void; transportFailCallback: (error: Record) => void; utf8Decoder: TextDecoder; constructor(baseUrl: string, transportFailCallback?: (error?: Record) => void); static isSupported: () => boolean; /** * Handles any signal-r log, and pipes it through our logging. * @param message - message */ private handleLog; private getRetryPolicy; private buildConnection; private normalizeMessage; private parseMessage; start(options: StreamingTransportOptions, onStartCallback?: () => void, experimentalRetryConnectCount?: number): Promise | undefined; stop(hasTransportError?: boolean): any; createMessageStream(protocol: SignalR.IHubProtocol): void; isNetworkError(error: Error | undefined): boolean; handleConnectionClosure(error?: Error): void; handleNextMessage(message: RawCoreSignalRStreamingMessage, protocol: SignalR.IHubProtocol): void; handleMessageStreamError(error: Error | undefined): void; updateQuery(authToken: string, contextId: string, authExpiry: number, forceAuth?: boolean): void; renewSession(): Promise | undefined; setState(state: ConnectionState): void; setStateChangedCallback(callback: StateChangeCallback): void; setReceivedCallback(callback: ReceiveCallback): void; setUnauthorizedCallback(callback: (url: string) => void): void; setSubscriptionResetCallback(callback: () => void): void; } export default SignalrCoreTransport;