import { MutableRefObject } from 'react'; /** * Hook that maintains a ref with the latest value * * The ref is updated during render (not in an effect), ensuring it's * always current even if accessed synchronously after a state update. * * @param value - The value to keep updated in the ref * @returns Ref object containing the latest value */ export declare function useLatestRef(value: T): MutableRefObject; /** * Hook that creates a callback wrapper that always uses latest values * * Useful for creating stable callback references that access latest props/state * without recreating the callback on every render. * * @example * ```tsx * function Counter({ onIncrement }: { onIncrement: (n: number) => void }) { * const [count, setCount] = useState(0); * * // Callback never recreated, but always uses latest count and onIncrement * const handleClick = useLatestCallback(() => { * const newCount = count + 1; * setCount(newCount); * onIncrement(newCount); * }); * * return ; * } * ``` */ export declare function useLatestCallback(callback: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn; /** * Hook that provides both a value ref and a callback ref * * @example * ```tsx * const { valueRef, callbackRef } = useLatestRefs({ * count, * onSave: handleSave * }); * * // Access in async operations * setTimeout(() => { * console.log(valueRef.current.count); * callbackRef.current.onSave(); * }, 1000); * ``` */ export declare function useLatestRefs>(values: T): MutableRefObject;