import { AnyUpdater, Listener } from './types.cjs'; export interface StoreOptions TState> { /** * Replace the default update function with a custom one. */ updateFn?: (previous: TState) => (updater: TUpdater) => TState; /** * Called when a listener subscribes to the store. * * @return a function to unsubscribe the listener */ onSubscribe?: (listener: Listener, store: Store) => () => void; /** * Called after the state has been updated, used to derive other state. */ onUpdate?: () => void; } export declare class Store TState> { listeners: Set>; state: TState; prevState: TState; options?: StoreOptions; constructor(initialState: TState, options?: StoreOptions); subscribe: (listener: Listener) => () => void; setState: (updater: TUpdater) => void; }