export type PubSubTypes = { __getTopics: () => Record) => void>>; subscribe: (topic: K, subscriber: (data: PayloadByTopic) => void) => { remove: () => void; }; publish: (topic: K, data: PayloadByTopic) => void; }; type PayloadByTopic = U extends { topic: T; payload: infer P; } ? P : never; type Options = { publishSynchronous?: boolean; }; declare const pubSubFactory: (opts?: Options) => PubSubTypes; export default pubSubFactory;