import { type Accessor } from "solid-js"; /** * Fires `onChange(next, previous)` whenever the tracked value changes by * identity. Mirrors Base UI React's `useValueChanged` * (`packages/react/src/internals/useValueChanged.ts`). * * The value must be provided as a reactive accessor. In Solid 2, change * detection maps naturally to the split-effect form: the compute half returns * the current value, and the apply half receives both the new compute return * and the prior one. We carry a "first run" latch so the callback isn't * fired on initial setup (matching React — its first effect pass sees * `valueRef.current === value` because both came from the same render). * * The callback runs inside `untrack` so it can call into other accessors * (`field.shouldValidateOnChange()`, `name()`, etc.) without tripping * `[STRICT_READ_UNTRACKED]`. Side-effect callbacks read snapshots, they * don't subscribe — re-runs are driven by the tracked `value` accessor * passed as the first argument. * * @param value Accessor for the tracked value. * @param onChange Called with `(next, previous)` whenever `value()` changes. * Most callers ignore `previous` — accept it positionally if * you need to compare the transition. */ export declare function useValueChanged(value: Accessor, onChange: (next: T, previous: T) => void): void; //# sourceMappingURL=use-value-changed.d.ts.map