/** * Custom hook to manage state with utility functions to set state, set a specific field, and reset state. * * @param {T} initialState - The initial state value. * * @returns {UseSetStateReturn} - An object containing: * - `state`: The current state. * - `resetState`: A function to reset the state to the initial value. * - `setState`: A function to update the state. * - `setField`: A function to update a specific field in the state. * * @example * const { state, setState, setField, resetState } = useSetState({ name: '', age: 0 }); * * return ( *
*

Name: {state.name}

*

Age: {state.age}

* * *
* ); */ type UseSetStateReturn = { state: T; resetState: (defaultState?: T) => void; setState: (updateState: T | Partial) => void; setField: (name: keyof T, updateValue: T[keyof T]) => void; }; declare function useSetState(initialState?: T): UseSetStateReturn; export { type UseSetStateReturn, useSetState };