mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-10 03:24:37 +00:00
* rename all PubSub patterns * feat: forbid identifiers with camelcase pubSub (#1709) --------- Co-authored-by: Arseniy Klempner <adklempner@gmail.com>
21 lines
595 B
TypeScript
21 lines
595 B
TypeScript
import type { IDecodedMessage, IDecoder } from "./message.js";
|
|
import type {
|
|
ContentTopic,
|
|
IAsyncIterator,
|
|
PubsubTopic,
|
|
Unsubscribe
|
|
} from "./misc.js";
|
|
import type { Callback } from "./protocols.js";
|
|
|
|
export type ActiveSubscriptions = Map<PubsubTopic, ContentTopic[]>;
|
|
|
|
export interface IReceiver {
|
|
toSubscriptionIterator: <T extends IDecodedMessage>(
|
|
decoders: IDecoder<T> | IDecoder<T>[]
|
|
) => Promise<IAsyncIterator<T>>;
|
|
subscribe: <T extends IDecodedMessage>(
|
|
decoders: IDecoder<T> | IDecoder<T>[],
|
|
callback: Callback<T>
|
|
) => Unsubscribe | Promise<Unsubscribe>;
|
|
}
|