/** * Observable store with subscribe/batch functionality */ export type Listener = (state: T) => void; export type Selector = (state: T) => R; export type Unsubscribe = () => void; export interface Store { /** Get current state */ getState(): T; /** Merge partial state update */ setState(partial: Partial | ((state: T) => Partial)): void; /** Subscribe to state changes, optionally filtered by selector */ subscribe(listener: Listener, selector?: Selector): Unsubscribe; /** Batch multiple state updates into a single notification */ batch(fn: () => void): void; /** Reset state to initial value */ reset(initialState: T): void; /** Destroy store and clean up */ destroy(): void; } /** * Create a new observable store */ export declare function createStore(initialState: T): Store; /** * Create a derived store that computes values from another store */ export declare function createDerivedStore(sourceStore: Store, selector: Selector): { getValue: () => R; subscribe: (listener: (value: R) => void) => Unsubscribe; }; //# sourceMappingURL=store.d.ts.map