1 | import Observable from 'zen-observable-ts';
|
2 | import { PubSubProvider, PubSubOptions, ProviderOptions } from './types';
|
3 | import { PubSubContent } from './types/PubSub';
|
4 | declare type PubSubObservable = {
|
5 | provider: PubSubProvider;
|
6 | value: string | Record<string, unknown>;
|
7 | };
|
8 | export declare class PubSubClass {
|
9 | private _options;
|
10 | private _pluggables;
|
11 | |
12 |
|
13 |
|
14 | private _awsAppSyncRealTimeProvider?;
|
15 | |
16 |
|
17 |
|
18 | private get awsAppSyncRealTimeProvider();
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 | constructor(options?: PubSubOptions);
|
25 | getModuleName(): string;
|
26 | /**
|
27 | * Configure PubSub part with configurations
|
28 | *
|
29 | * @param {PubSubOptions} config - Configuration for PubSub
|
30 | * @return {Object} - The current configuration
|
31 | */
|
32 | configure(options: PubSubOptions): PubSubOptions;
|
33 | |
34 |
|
35 |
|
36 |
|
37 | addPluggable(pluggable: PubSubProvider): Promise<Record<string, unknown>>;
|
38 | |
39 |
|
40 |
|
41 |
|
42 | removePluggable(providerName: string): void;
|
43 | private getProviderByName;
|
44 | private getProviders;
|
45 | publish(topics: string[] | string, msg: PubSubContent, options?: ProviderOptions): Promise<void[]>;
|
46 | subscribe(topics: string[] | string, options?: ProviderOptions): Observable<PubSubObservable>;
|
47 | }
|
48 | export declare const PubSub: PubSubClass;
|
49 | export {};
|