export type Channel = { topic: string; name: string; }; /** * Websocket client for the graasp-websockets protocol */ export interface WebsocketClient { /** * Subscribe a handler to a given channel * @param channel Channel to which to subscribe to * @param handler Handler function to register */ subscribe(channel: Channel, handler: (data: T) => void): void; /** * Unsubscribe a handler from a channel, THE HANDLER MUST === THE ONE PASSED TO SUBSCRIBE * @param channel Channel from wihch to unsubscribe the provided handler from * @param handler Handler function to unregster, MUST BE EQUAL (===) TO PREVIOUSLY REGISTERED HANDLE WITH @see subscribe ! */ unsubscribe(channel: Channel, handler: (data: T) => void): void; } export declare const configureWebsocketClient: (wsHost: string) => WebsocketClient;