import type ParserBase from './parser/parser-base'; import type { IHubProtocol } from '@microsoft/signalr'; import type { OPENAPI_CONTROL_MESSAGE_DISCONNECT, OPENAPI_CONTROL_MESSAGE_HEARTBEAT, OPENAPI_CONTROL_MESSAGE_CONNECTION_HEARTBEAT, OPENAPI_CONTROL_MESSAGE_RECONNECT, OPENAPI_CONTROL_MESSAGE_RESET_SUBSCRIPTIONS, OPENAPI_CONTROL_MESSAGE_PROBE } from './control-messages'; import type { TRANSPORT_NAME_MAP } from './connection/connection'; import type * as connectionConstants from './connection/constants'; import type { StreamingData } from './connection/types'; export declare type TransportTypes = keyof typeof TRANSPORT_NAME_MAP; export interface ConnectionOptions { waitForPageLoad?: boolean; transport?: Array; messageSerializationProtocol?: IHubProtocol; isWebsocketStreamingHeartBeatEnabled?: boolean; shouldLoopTransports?: boolean; experimentalRetryConnectCount?: number; } export declare type ConnectionState = keyof typeof connectionConstants.READABLE_CONNECTION_STATE_MAP; export declare type DataFormat = typeof connectionConstants.DATA_FORMAT_JSON | typeof connectionConstants.DATA_FORMAT_PROTOBUF; export interface Heartbeats { OriginatingReferenceId: string; Reason: string; } export interface StreamingMessage { ReferenceId: R; Timestamp?: string; MessageId?: number; ReservedField?: number; DataFormat?: DataFormat; Data: T; Heartbeats?: Heartbeats[]; TargetReferenceIds?: string[]; } declare type StreamingControlMessage = StreamingMessage; export declare type HeartbeatsControlMessage = StreamingControlMessage<{ Heartbeats: Heartbeats[]; ReferenceId: typeof OPENAPI_CONTROL_MESSAGE_HEARTBEAT; }[] | { Heartbeats: Heartbeats[]; }, typeof OPENAPI_CONTROL_MESSAGE_HEARTBEAT | typeof OPENAPI_CONTROL_MESSAGE_CONNECTION_HEARTBEAT>; export declare type ResetControlMessage = StreamingControlMessage<{ TargetReferenceIds: string[]; }[] | { TargetReferenceIds: string[]; }, typeof OPENAPI_CONTROL_MESSAGE_RESET_SUBSCRIPTIONS>; export declare type ProbeControlMessage = StreamingControlMessage<{ ProbeId: number; }[], typeof OPENAPI_CONTROL_MESSAGE_PROBE>; declare type ConnectionControlMessage = StreamingControlMessage; export declare type ControlMessage = HeartbeatsControlMessage | ResetControlMessage | ConnectionControlMessage | ProbeControlMessage; export interface RetryDelayLevel { level: number; delay: number; } export interface StreamingConfigurableOptions { /** * Whether the signal-r streaming connection waits for page load before starting */ waitForPageLoad?: boolean; /** * The transports to be used in order by signal-r. */ transportTypes?: Array; /** * The delay in milliseconds to wait before attempting a new connect after signal-r has disconnected */ connectRetryDelay?: number; /** * The levels of delays in milliseconds for specific retry counts. Structure: `[{ level:Number, delay:Number }].` */ connectRetryDelayLevels?: RetryDelayLevel[]; /** * The map of subscription parsers where key is format name and value is parser constructor. */ parsers?: Record ParserBase>; /** * The map of subscription parser engines where key is format name and value is an engine implementation. */ parserEngines?: Record; transport?: Array; /** * Message serialization protocol used by signalr core */ messageProtocol?: Record; messageSerializationProtocol?: IHubProtocol; /** * If true we wll get streaming heartbeat messages for websocket connection */ isWebsocketStreamingHeartBeatEnabled?: boolean; /** * Should the transports be retried in a loop */ shouldLoopTransports?: boolean; /** * The number of times to retry the initial connect */ experimentalRetryConnectCount?: number; } export {};