/** Callback to inform of a value updates. */ export declare type StoreSubscriber = (value: T) => void; /** Unsubscribes from value updates. */ export declare type StoreUnsubscriber = () => void; /** Callback to update a value. */ export declare type StoreUpdater = (value: T) => T; /** Cleanup logic callback. */ export declare type StoreInvalidator = (value?: T) => void; /** Start and stop notification callbacks. */ export declare type StoreStartStopNotifier = (set: StoreSubscriber) => StoreUnsubscriber | void; /** Readable interface for subscribing. */ export declare type ReadableStore = { initialValue: T | undefined; /** * Subscribe on value changes. * @param run subscription callback * @param invalidate cleanup callback */ subscribe(this: void, run: StoreSubscriber, invalidate?: StoreInvalidator): StoreUnsubscriber; }; /** Writable interface for both updating and subscribing. */ export declare type WritableStore = ReadableStore & { /** * Set value and inform subscribers. * @param value to set */ set(this: void, value: T): void; /** * Update value using callback and inform subscribers. * @param updater callback */ update(this: void, updater: StoreUpdater): void; }; /** Pair of subscriber and invalidator. */ export declare type SubscribeInvalidateTuple = [StoreSubscriber, StoreInvalidator]; export declare type ReadableStoreRecord = { [prop: string]: ReadableStore; }; export declare type WritableStoreRecord = { [prop: string]: WritableStore; }; export declare type StoreValue = T extends ReadableStore ? U : never; /** One or more `Readable`s. */ export declare type Stores = ReadableStore | [ReadableStore, ...Array>] | Array>; /** One or more values from `Readable` stores. */ export declare type StoresValues = T extends ReadableStore ? U : { [K in keyof T]: T[K] extends ReadableStore ? U : never; }; //# sourceMappingURL=types.d.ts.map