rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
17 lines • 935 B
TypeScript
import type { UseUndoStateOptions, UseUndoStateReturnValue } from "@/types/types";
import type { ExcludeFunction } from "@/types/utils";
/**
* useUndoState hook
* Drop in replacement for useState hook but with undo functionality.
*
* @typedef UndoStateOptions
* @type {object}
* @property {number} maxSize - Maximum number of states to keep in the undo stack.
* @param {any} defaultValue - Default value to use for the state. This will be the first value in the undo stack.
* @param {UseUndoStateOptions} options - Options for the undo state. Currently takes the maxSize option.
* @returns {UseUndoStateReturnValue}
* @see https://react-hooks.org/docs/useUndoState
*/
declare const useUndoState: <T>(defaultValue: Exclude<T, import("@/types/utils").UnknownFunction>, options?: UseUndoStateOptions | undefined) => UseUndoStateReturnValue<T>;
export { useUndoState };
//# sourceMappingURL=useUndoState.d.ts.map