export declare function createPubSub(): [ publish: PublishFunction, subscribe: SubscribeFunction, getStoredData: GetFunctionPossiblyUndefined ]; export declare function createPubSub(storedData: T): [ publish: PublishFunction, subscribe: SubscribeFunction, getStoredData: GetFunction ]; export type SubscriptionHandler = (data: T, previousData: T) => void; export type PublishFunction = (data: T) => void; export type UnsubscribeFunction = () => void; export type GetFunction = () => T; export type GetFunctionPossiblyUndefined = () => T extends void ? undefined : T | undefined; export type SubscribeFunction = (handler: SubscriptionHandler) => UnsubscribeFunction;