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; export interface IReceiver { toSubscriptionIterator: ( decoders: IDecoder | IDecoder[] ) => Promise>; subscribeWithUnsubscribe: SubscribeWithUnsubscribe; } type SubscribeWithUnsubscribe = ( decoders: IDecoder | IDecoder[], callback: Callback ) => Unsubscribe | Promise;