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