1 | export declare type HubCapsule = {
|
2 | channel: string;
|
3 | payload: HubPayload;
|
4 | source: string;
|
5 | patternInfo?: string[];
|
6 | };
|
7 | export declare type HubPayload = {
|
8 | event: string;
|
9 | data?: any;
|
10 | message?: string;
|
11 | };
|
12 | export declare type HubCallback = (capsule: HubCapsule) => void;
|
13 | export declare type LegacyCallback = {
|
14 | onHubCapsule: HubCallback;
|
15 | };
|
16 | export declare class HubClass {
|
17 | name: string;
|
18 | private listeners;
|
19 | private patterns;
|
20 | protectedChannels: string[];
|
21 | constructor(name: string);
|
22 | remove(channel: string | RegExp, listener: HubCallback): void;
|
23 | dispatch(channel: string, payload: HubPayload, source?: string, ampSymbol?: Symbol): void;
|
24 | listen(channel: string | RegExp, callback?: HubCallback | LegacyCallback, listenerName?: string): () => void;
|
25 | private _toListeners;
|
26 | }
|
27 | export declare const Hub: HubClass;
|
28 | /**
|
29 | * @deprecated use named import
|
30 | */
|
31 | export default Hub;
|