UNPKG

1.12 kBTypeScriptView Raw
1/**
2 * This class represents a basic channel.
3 */
4export declare abstract class Channel {
5 /**
6 * The Echo options.
7 */
8 options: any;
9 /**
10 * Listen for an event on the channel instance.
11 */
12 abstract listen(event: string, callback: Function): Channel;
13 /**
14 * Listen for a whisper event on the channel instance.
15 */
16 listenForWhisper(event: string, callback: Function): Channel;
17 /**
18 * Listen for an event on the channel instance.
19 */
20 notification(callback: Function): Channel;
21 /**
22 * Stop listening to an event on the channel instance.
23 */
24 abstract stopListening(event: string, callback?: Function): Channel;
25 /**
26 * Stop listening for a whisper event on the channel instance.
27 */
28 stopListeningForWhisper(event: string, callback?: Function): Channel;
29 /**
30 * Register a callback to be called anytime a subscription succeeds.
31 */
32 abstract subscribed(callback: Function): Channel;
33 /**
34 * Register a callback to be called anytime an error occurs.
35 */
36 abstract error(callback: Function): Channel;
37}