/**
* Tracks the previous value of a state or prop.
* Returns undefined on the first render, then returns the previous value on subsequent renders.
*
* @template T - The type of the value being tracked
* @param value - The current value to track
* @returns The previous value, or undefined on first render
*
* @example
* ```tsx
* function Counter() {
* const [count, setCount] = useState(0);
* const prevCount = usePrevious(count);
*
* return (
*
;
* }
* ```
*/
export declare function usePrevious(value: T): T | undefined;
/**
* Tracks the previous value with a custom comparison function.
* Only updates the previous value when the comparison function returns false.
*
* @template T - The type of the value being tracked
* @param value - The current value to track
* @param compare - Function that returns true if values should be considered equal
* @returns The previous distinct value
*
* @example
* ```tsx
* function UserProfile({ user }: { user: User }) {
* // Only update previous user when the ID changes
* const prevUser = usePreviousDistinct(
* user,
* (prev, next) => prev?.id === next?.id
* );
*
* useEffect(() => {
* if (prevUser && prevUser.id !== user.id) {
* console.log(`User changed from ${prevUser.name} to ${user.name}`);
* }
* }, [user, prevUser]);
*
* return
;
* }
* ```
*/
export declare function usePreviousDistinct(value: T, compare: (prev: T | undefined, next: T) => boolean): T | undefined;
/**
* Tracks multiple previous values in a history array.
* Useful for implementing undo/redo or tracking value changes over time.
*
* @template T - The type of the value being tracked
* @param value - The current value to track
* @param maxHistory - Maximum number of previous values to keep (default: 10)
* @returns Array of previous values, most recent first
*
* @example
* ```tsx
* function DrawingCanvas() {
* const [drawing, setDrawing] = useState([]);
* const history = usePreviousHistory(drawing, 20);
*
* const undo = () => {
* if (history.length > 0) {
* setDrawing(history[0]);
* }
* };
*
* return (
*