/** * State with history actions interface */ export type StateWithHistoryActions = { set: (value: T | ((previousValue: T) => T)) => void; undo: () => void; redo: () => void; clear: () => void; reset: () => void; }; /** * Hook that stores previous state values and provides handles to travel through them * * @template T - State type * @param initialValue - Initial state value * @param options - History options * @returns Tuple of [state, actions] * * @example * ```tsx * const [value, { set, undo, redo, canUndo, canRedo }] = useStateWithHistory(0); * * return ( *
*

Current: {value}

* * * * *
* ); * ``` */ export declare function useStateWithHistory(initialValue: T, options?: { capacity?: number; allowDuplicates?: boolean; }): [ T, StateWithHistoryActions & { history: T[]; pointer: number; canUndo: boolean; canRedo: boolean; } ]; //# sourceMappingURL=useStateWithHistory.d.ts.map