import { CookieSerializeOptions } from "../types/cookie.js"; import { Ref } from "vue"; //#region src/app/composables/cookie.d.ts type _CookieOptions = Omit; export interface CookieOptions extends _CookieOptions { decode?(value: string | null | undefined): T; encode?(value: T): string; default?: () => T | Ref; watch?: boolean | 'shallow'; readonly?: boolean; /** Whether this ref reads the named cookie from the jar. Defaults to an exact name match. */ filter?(key: string): boolean; /** * Refresh cookie expiration even when the value remains unchanged. * * By default, a cookie is only rewritten when its value changes. * When `refresh` is set to `true`, the cookie will be re-written * on every explicit assignment (e.g. `cookie.value = cookie.value`), * extending its expiration even if the value is the same. * * Note: the expiration is not refreshed automatically — you must * assign to `cookie.value` to trigger the refresh. * * Ignored when `readonly` is set. * * @default false */ refresh?: boolean; } /** Options accepted by `useCookie`. */ export interface UseCookieOptions extends Omit, 'expires'> { /** * Expiration date for the cookie, or a getter that returns one. * * When a function is provided, it is evaluated on every cookie write * so the expiration can be refreshed when the value is re-set. * The getter should be pure (no side effects). */ expires?: Date | (() => Date | undefined); } export interface CookieRef extends Ref {} /** @since 3.0.0 */ export declare function useCookie(name: string, _opts?: UseCookieOptions & { readonly?: false; }): CookieRef; export declare function useCookie(name: string, _opts: UseCookieOptions & { readonly: true; }): Readonly>; /** @since 3.10.0 */ export declare function refreshCookie(name: string): void; //#endregion export {};