import * as i0 from '@angular/core'; /** Options for `WrCookie.set` / `WrCookie.remove`. */ interface WrCookieOptions { /** * Expiry. `Date` is written as an `expires=` attribute; `number` is * treated as seconds-from-now and converted to `Max-Age`. */ readonly expires?: Date | number; /** Cookie path. @default '/' */ readonly path?: string; /** Cookie domain. */ readonly domain?: string; /** `Secure` flag. */ readonly secure?: boolean; /** `SameSite` policy. @default 'Lax' */ readonly sameSite?: 'Lax' | 'Strict' | 'None'; } /** * Thin, SSR-safe `document.cookie` wrapper modelled after {@link WrStorage}. * * - Read/write/delete cookies through a typed API. * - `set()` serialises `expires` as either an HTTP-date or `Max-Age`. * - Every method short-circuits when there's no DOM (SSR / unit tests * without a document) — reads return the fallback, writes are no-ops. * * @example * ```ts * const cookies = inject(WrCookie); * * cookies.set('theme', 'dark', { expires: 60 * 60 * 24 * 30 }); // 30 days * cookies.get('theme'); // 'dark' * cookies.has('theme'); // true * cookies.remove('theme'); * cookies.keys(); // readonly string[] * ``` * * @see https://ngwr.dev/services/cookie */ declare class WrCookie { private readonly doc; /** Is `key` present (regardless of value)? */ has(key: string): boolean; /** Read `key`. Returns `fallback` (default `null`) when the key is missing. */ get(key: string, fallback?: string | null): string | null; /** Write `key=value` with optional attributes. */ set(key: string, value: string, options?: WrCookieOptions): void; /** Remove `key`. Path / domain must match what was used in `set()`. */ remove(key: string, options?: Pick): void; /** Every cookie key visible to this document. */ keys(): readonly string[]; /** Remove every cookie visible to this document. Uses `path: '/'`. */ clear(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { WrCookie }; export type { WrCookieOptions };