/** * Minimal typings for the parts of `pubsub-js` used by the store. The package * ships without type declarations. */ declare module 'pubsub-js' { type Subscriber = (topic: string, data: unknown) => void; interface PubSubStatic { /** Subscribes to a topic and returns a token that can be used to unsubscribe. */ subscribe: (topic: string, subscriber: Subscriber) => string; /** Publishes asynchronously, returns false when there are no subscribers. */ publish: (topic: string, data?: unknown) => boolean; /** Number of subscribers on exactly this topic. */ countSubscriptions: (topic: string) => number; /** Publishes and delivers before it returns. */ publishSync: (topic: string, data?: unknown) => boolean; /** * Removes one subscription by its token, or every subscription of a topic * and of the topics whose name starts with it. */ unsubscribe: (tokenOrTopic: string) => void; /** Removes every subscription of every topic. */ clearAllSubscriptions: () => void; } const PubSub: PubSubStatic; export default PubSub; }