import { ReactiveValue } from '../types.js'; /** * Subscribe to a reactive thunk without structural cloning. The thunk's * `ReactiveDefinition` is memoized by fn identity in a `WeakMap`, so a * memoized thunk (via `useCallback` or the Signalium Babel preset) reuses the * same scope-cached signal across renders. * * This is a minimal wrapper: the returned value is whatever the thunk * returned, by reference. In particular, when the thunk returns a * `ReactivePromise`, re-renders only fire when the underlying signal itself * re-evaluates (e.g. a new promise replaces the old one) — not when the * existing promise transitions from pending to resolved. If you need promise * state transitions to drive React, read its fields inside the thunk (e.g. * `useReactiveShallow(() => { const p = fetchThing(); return { value: p.value, * isPending: p.isPending }; })`) or use {@link useReactive} for the * structurally-shared snapshot that handles this automatically. */ export declare function useReactiveShallow(fn: () => R): ReactiveValue; /** * Subscribe to a reactive thunk and return a structurally-shared snapshot of * its value. Nested objects/arrays/Maps/Sets are deep-cloned; unchanged * subtrees keep the same reference, so React's referential equality works as * expected. ReactivePromise values are flattened to plain objects. * * This is the default hook for reading reactive values inside a React * component — it gives you safe equality semantics at the React boundary. * Use {@link useReactiveShallow} if you know you don't need structural * sharing. */ export declare function useReactive(fn: () => R): ReactiveValue; /** * @deprecated Use {@link useReactive} instead. `useReactive` is now * deep-by-default; `useReactiveDeep` is a thin alias kept for back-compat and * will be removed in a future major release. */ export declare function useReactiveDeep(fn: () => R): ReactiveValue; //# sourceMappingURL=use-reactive.d.ts.map