UNPKG

rtlayer-client

Version:

Make your app fun to use by adding realtime features in just few lines of code and you don't event have to handle any extra infrastructure.

24 lines (23 loc) 767 B
declare class WebSocketClient { private ws; private url; private retryInterval; private eventListeners; private token?; private isGloballySubscribed; private activeChannels; private queue; constructor(org: string, service: string, token?: string, retryInterval?: number); private connect; send(message: string): void; subscribe(channel: string): void; unsubscribe(channel: string): void; close(): void; on(channel: string, callback: (data: any) => void): { remove: () => void; }; removeListener(channel: string, listener: any): void; private emit; } export default function RTLayerClient(org: string, service: string, token?: string, retryInterval?: number): WebSocketClient; export {};