import { SetStateAction } from "react"; import { Store, Selector, StoreWithActions, ANY, StoreSnapshot } from "../utils/types"; /** * A hook that provides a reactive subscription to a custom store with optional selector support. * * @template TStore - The store type, which can either be a basic `Store` or an enhanced `StoreWithActions`. * @template TSelected - The return type of the selector. Defaults to the full state snapshot (`StoreSnapshot`). * * @param {TStore} store - The store instance to subscribe to. * @param {Selector, TSelected>} [selector] - An optional selector function to extract a slice of the state. Defaults to identity function returning the whole state. * * @returns {TSelected} - The selected state slice, optionally enriched with actions if the store has them. * * @example * const counter = useSelect(counterStore, state => state.count); * const { count, increment } = useSelect(counterStore); */ export declare const useSelect: | StoreWithActions, TSelected = StoreSnapshot>(store: TStore, selector?: Selector, TSelected>, isEqual?: (a: TSelected, b: TSelected) => boolean) => TSelected; /** * A hook that returns the current state and a setter function from a custom store. * * @template TState - The type of the store's state. * * @param {Store} store - The store instance to subscribe to. * * @returns {[TState, (value: SetStateAction) => void]} - A tuple with the current state and a function to update it. * * @example * const [count, setCount] = useState(counterStore); * setCount(prev => prev + 1); */ export declare const useState: (store: Store, isEqual?: (a: TState, b: TState) => boolean) => [TState, (value: SetStateAction) => void];