/** * Announcement dismissal store. * * The dismissal COOKIE is the source of truth wherever cookies work: the hub's * root layout reads it server-side to decide whether to SSR-seed the bar (no * flash for dismissed users), and the client reads it via * `isAnnouncementDismissed`. One cookie per platform holding the LAST dismissed * announcement id — dismissal is an id-match, never mere cookie presence, so a * new announcement always shows after an old one was dismissed, and * re-activating an old announcement intentionally re-shows it. * * On a cookie-averse document (see `utils/dismiss-cookie.ts`) the primitive * writes `-announcement-dismissed` to localStorage instead. Do not * mistake it for the legacy key below and delete the write: it is the ONLY * thing making a dismissal persist in a shell. `clearAnnouncementDismissals`' prefix sweep does match it, which * is right — a full reset should take both. * * The legacy per-id localStorage key (`-announcement--dismissed`) * is READ-ONLY legacy: consulted only when no cookie exists for the platform, * purely as the migration trigger (the bar's mount effect backfills the * cookie). Nothing writes it any more, so that store dies out. * * No `"use client"` directive on purpose — `announcementDismissCookieName` and * `isDismissedCookieValue` are pure/isomorphic and imported by the hub's * server layout; the DOM-touching helpers guard on `typeof document`. */ /** Cookie name for a platform's dismissed-announcement id — the ONE home for * the encoding, shared by the client writer and the hub's SSR reader. */ export declare function announcementDismissCookieName(platform: string): string; /** THE dismissal match rule (id-match, not presence), shared across the * server/client boundary. `undefined` id (no active announcement) → false. */ export { isDismissedCookieValue } from './dismiss-cookie'; /** Persist a dismissal (1 year). The SSR layout sees it on the next request — * except in a native shell, where the primitive falls back to localStorage and * there is no SSR layout to see it anyway. The LEGACY per-id key is still never * written. */ export declare function dismissAnnouncement(platform: string, id: string): void; /** * Client-side dismissal check — primary store first, with the legacy * localStorage key consulted ONLY when that comes back empty. Reads browser * storage, so callers must invoke it * from effects, never during render (a render-time read would desync hydration * from the SSR HTML). */ export declare function isAnnouncementDismissed(platform: string, id: string): boolean; /** Remove ALL dismissal state for a platform — test/story helper so callers * never restate the key encoding. The header owns the tier inventory. */ export declare function clearAnnouncementDismissals(platform: string): void; /** One-time cleanup of pre-refactor storage: the orphaned announcement cache * (the old "instant paint" blob) — called from the bar's mount effect. */ export declare function clearLegacyAnnouncementCache(platform: string): void; //# sourceMappingURL=announcement-storage.d.ts.map