import { c as StorageMode, C as CookieOptions } from './types-BAqJDAl9.js'; import { A as AdapterFactory, a as AdapterOptions, S as StorageAdapter } from './cookie-yB16ruKs.js'; export { c as cookieAdapter, r as readCookieFromString, s as serializeCookie } from './cookie-yB16ruKs.js'; /** * Hybrid adapter: cookie is authoritative on read (so the server can see * the same value the client just wrote and render zero-flash SSR), while * localStorage acts as a secondary mirror for cross-tab `storage` events * and as a fallback when the cookie is missing. * * Heals divergence on read. If the cookie is absent but localStorage has * a value (cookie expired, blocked by a privacy heuristic, lost in a CDN * rewrite, etc.), the value is written back to the cookie so the server * picks it up on the next request. This is what fixes the classic * "dark → light → dark" flicker: previously, cookie miss → script picks * default → mount reads localStorage → flips. Now the cookie is * eagerly repaired on first hydration so subsequent paints are stable. */ declare const hybridAdapter: AdapterFactory; declare const localAdapter: AdapterFactory; declare const sessionAdapter: AdapterFactory; interface ResolveAdapterOptions { mode: StorageMode; key: string; cookieOptions?: CookieOptions; /** Forwarded to every adapter; see {@link AdapterOptions.onStorageError}. */ onStorageError?: AdapterOptions['onStorageError']; } declare function resolveAdapter(opts: ResolveAdapterOptions): StorageAdapter; export { AdapterFactory, AdapterOptions, type ResolveAdapterOptions, StorageAdapter, hybridAdapter, localAdapter, resolveAdapter, sessionAdapter };