import type { IDecodedMessage, IDecoder } from "./message.js"; import type { IAsyncIterator, PubSubTopic, Unsubscribe } from "./misc.js"; import type { Callback, ProtocolOptions } from "./protocols.js"; type ContentTopic = string; export type ActiveSubscriptions = Map; export interface IReceiver { toSubscriptionIterator: ( decoders: IDecoder | IDecoder[], opts?: ProtocolOptions ) => Promise>; subscribe: ( decoders: IDecoder | IDecoder[], callback: Callback, opts?: ProtocolOptions ) => Unsubscribe | Promise; }