import { FC } from 'react'; import { PropsWithChildren } from 'react'; /** * `createProvider` creates a `StoreProvider` component that provides store to its child components. * The store will be disposed of when the component is unmounted. * @param hooks An array of hooks that will be used as the store. * @returns A `StoreProvider` component that provides store to its child components. */ export declare function createProvider(hooks: StoreHook[]): StoreProvider; export declare type Provider = { /** * Reset the state of a hook to its initial value. * @param hook The hook to be reset. */ resetStore(hook: StoreHook): void; /** * Reset all store hooks to their initial state. */ resetAllStore(): void; }; /** * A hook that can be used as a store. */ export declare type StoreHook = () => S; /** * `StoreProvider` is a React component that provides store to its child components. */ export declare type StoreProvider = FC; /** * `useProvider` is a React hook that helps find the nearest `StoreProvider` that contains the specified hook in the component tree and returns a `Provider` object for managing the store within the provider. * @param hook A hook that can be used as a store. * @returns */ export declare function useProvider(hook: StoreHook): Provider; /** * `useStore` is a React hook that returns the state of a store. * @param hook A hook that can be used as a store. * @returns The state returned by the hook. */ export declare function useStore(hook: StoreHook): S; /** * `useStore` is a React hook that returns a selected value from a store's state with a custom selector. * @param hook A hook that can be used as a store. * @param selector A function to select a specific value from the store's state, allowing you to control re-renders for better performance. * @returns The value returned by the selector. */ export declare function useStore(hook: StoreHook, selector: (state: S) => T): T; /** * `useStore` is a React hook that returns a selected value from a store's state with a custom selector and equality check. * @param hook A hook that can be used as a store. * @param selector A function to select a specific value from the store's state, allowing you to control re-renders for better performance. * @param isEqual A function to compare two values and determine equality. If not provided, shallow comparison is used by default. * @returns The value returned by the selector. */ export declare function useStore(hook: StoreHook, selector: (state: S) => T, isEqual: ((current: T, next: T) => boolean)): T; export { }