Sasha 020463c358
chore: update typescript (#1528)
* update typescript, define in root package.json

* update typedoc and fix typedoc comments

* update dev version of tsconfig

* set module and resolution for tsconfig dev

* bump ts plugins

* set order of typedoc generation

* turn off warnings as errors setting
2023-09-21 10:57:37 +02:00

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>;
}