UNPKG

vue-hooks-plus

Version:
8 lines (7 loc) 621 B
import Cookies from 'js-cookie'; export type UseCookieStateType = string | undefined; export interface UseCookieStateOptions extends Cookies.CookieAttributes { defaultValue?: UseCookieStateType | (() => UseCookieStateType); } declare function useCookieState(cookieKey: string, options?: UseCookieStateOptions): readonly [Readonly<import("vue").Ref<UseCookieStateType | (() => UseCookieStateType), UseCookieStateType | (() => UseCookieStateType)>>, (newValue: UseCookieStateType | ((prevState: UseCookieStateType) => UseCookieStateType), newOptions?: Cookies.CookieAttributes) => void]; export default useCookieState;