@macrix/pct-cmd
Version:
Package provide communication layer to ProconTel web infrastructure
15 lines (14 loc) • 650 B
TypeScript
import { HubConnectionState } from "@microsoft/signalr";
export interface IEndpointConnection {
start(): Promise<void>;
stop(): Promise<void>;
on(commandId: string, newMethod: (...args: any[]) => void): void;
off(commandId: string): void;
get<T = any>(commandId: string, arg: any): Promise<T>;
post(commandId: string, arg: any): Promise<void>;
onclose(callback: (error?: Error) => void): void;
onconnected(callback: (connectionId?: string) => void): void;
onreconnecting(callback: (error?: Error) => void): void;
onreconnected(callback: (connectionId?: string) => void): void;
state: HubConnectionState;
}