@ssv/signalr-client
Version:
SignalR client library built on top of @microsoft/signalr. This gives you more features and easier to use.
40 lines (39 loc) • 1.62 kB
TypeScript
import { Observable } from "rxjs";
import { ConnectionState, HubConnectionOptions } from "./hub-connection.model";
import { Dictionary } from "./utils/dictionary";
export declare class HubConnection<THub> {
get connectionState(): ConnectionState;
/** Gets the connection state. */
get connectionState$(): Observable<ConnectionState>;
/** Gets the key for the hub client. */
get key(): string;
/** Gets the `connectionId` of the hub connection (from SignalR). */
get connectionId(): string | null;
private _key;
private source;
private hubConnection;
private retry;
private hubConnectionOptions$;
private _connectionState$;
private desiredState$;
private internalConnStatus$;
private connectionBuilder;
private readonly _destroy$;
private waitUntilConnect$;
constructor(connectionOption: HubConnectionOptions);
connect(data?: () => Dictionary<string>): Observable<void>;
disconnect(): Observable<void>;
setData(getData: () => Dictionary<string>): void;
on<TResult>(methodName: keyof THub): Observable<TResult>;
stream<TResult>(methodName: keyof THub, ...args: unknown[]): Observable<TResult>;
send(methodName: keyof THub | "StreamUnsubscribe", ...args: unknown[]): Observable<void>;
invoke<TResult>(methodName: keyof THub, ...args: unknown[]): Observable<TResult>;
dispose(): void;
private _disconnect;
private untilDisconnects$;
private untilDesiredDisconnects$;
private openConnection;
private activateStreamWithRetry;
private mergeConnectionData;
private reconnectOnDisconnect$;
}