import type { VanillaStore } from "../../vanilla/create.cjs"; import type { StoreUseSnapshot } from "../create-with-hooks.cjs"; export interface WithUseSnapshotContributes { /** * Get the snapshot of the state. */ useSnapshot: StoreUseSnapshot; } /** * Enhances a store with `useSnapshot` method that returns a snapshot of the store's state. * * @param store - The store to enhance. * @returns The enhanced store. * * @since 0.2.0 * * @example * * ```tsx * const store = withUseSnapshot( * createVanilla({ * count: 123, * info: { name: 'Viki' }, * }), * ) * * // in normal JS/TS * console.log(store.snapshot(), store.snapshot((s) => s.count)) * * // in React component * export function App() { * const { count } = store.useSnapshot() * const count = store.useSnapshot((s) => s.count) * } * * ``` */ export declare function withUseSnapshot>(store: Store): Store & WithUseSnapshotContributes; //# sourceMappingURL=with-use-snapshot.d.cts.map