UNPKG

630 BTypeScriptView Raw
1import Observable from 'zen-observable-ts';
2import { PubSubContent } from './PubSub';
3export interface PubSubOptions {
4 [key: string]: any;
5 ssr?: boolean;
6 PubSub?: {};
7}
8export interface ProviderOptions {
9 [key: string]: any;
10 provider?: string | symbol;
11}
12export interface PubSubProvider {
13 configure(config: Record<string, unknown>): Record<string, unknown>;
14 getCategory(): string;
15 getProviderName(): string;
16 publish(topics: string[] | string, msg: PubSubContent, options?: ProviderOptions): void;
17 subscribe(topics: string[] | string, options?: ProviderOptions): Observable<PubSubContent>;
18}