import { CookieOptions } from '../../utils/cookies/cookies.cjs'; /** * Custom hook to manage state with cookies. * * @template T * @param {string} key - The key for the cookie. * @param {T} initialState - The initial state value. * @param {UseCookiesOptions} [options] - Optional settings. * * @returns {UseCookiesReturn} - An object containing: * - `state`: The current state. * - `resetState`: A function to reset the state to the initial value and remove the cookie. * - `setState`: A function to update the state and save it to the cookie. * - `setField`: A function to update a specific field in the state and save it to the cookie. * * @example * const { state, setState, setField, resetState } = useCookies('user', { name: '', age: 0 }); * * return ( *
*

Name: {state.name}

*

Age: {state.age}

* * *
* ); */ type UseCookiesOptions = CookieOptions & { initializeWithValue?: boolean; }; type UseCookiesReturn = { state: T; resetState: (defaultState?: T) => void; setState: (updateState: T | Partial) => void; setField: (name: keyof T, updateValue: T[keyof T]) => void; }; declare function useCookies(key: string, initialState?: T, options?: UseCookiesOptions): UseCookiesReturn; export { type UseCookiesOptions, type UseCookiesReturn, useCookies };