type ThemePreference = 'light' | 'dark' | 'system'; declare const THEME_STORAGE_KEY = "politogy_theme"; declare const THEME_COOKIE = "politogy_theme"; declare const THEME_PENDING_COOKIE = "politogy_theme_pending"; declare function isThemePreference(v: unknown): v is ThemePreference; /** Read the shared cookie (browser only; null on the server or when unset). */ declare function readThemeCookie(): ThemePreference | null; declare function writeThemeCookie(pref: ThemePreference): void; /** * Mark the current cookie value as a local choice that still has to reach the * user's profile. Call this from any surface that changes the theme WITHOUT a * chrome-API session (Politogy ID's login screen is the only one today). */ declare function markThemeChoicePending(pref: ThemePreference): void; /** The pending (not-yet-persisted) local choice, if any. */ declare function readPendingThemeChoice(): ThemePreference | null; /** Clear the pending marker once the choice has been written to the profile. */ declare function clearPendingThemeChoice(): void; /** Resolve a preference to the concrete light/dark it renders as right now. */ declare function resolveTheme(_pref: ThemePreference): 'light' | 'dark'; /** * Read the stored preference the way the pre-paint script does — cookie → * localStorage → `'system'`. Kept in lockstep with THEME_PREPAINT_SCRIPT so a * runtime reader can never disagree with what was applied before paint. */ declare function readStoredThemePreference(): ThemePreference; /** * The concrete light/dark the document is rendering as right now. * * This is the value anything theme-derived must follow — notably Chakra's * `colorMode`. Chakra used to be pinned to light while this resolved to dark, * which rendered dark chrome tokens over light Chakra content (the "dark * labels on a light page" desync). */ declare function readResolvedTheme(): 'light' | 'dark'; /** Apply a preference to the document: toggles `.dark` + `data-theme` on * `` (both selectors the chrome's dark token block matches) and sets * `color-scheme` so native controls follow. */ declare function applyThemePreference(pref: ThemePreference): void; declare const THEME_PREPAINT_SCRIPT: string; export { THEME_COOKIE, THEME_PENDING_COOKIE, THEME_PREPAINT_SCRIPT, THEME_STORAGE_KEY, type ThemePreference, applyThemePreference, clearPendingThemeChoice, isThemePreference, markThemeChoicePending, readPendingThemeChoice, readResolvedTheme, readStoredThemePreference, readThemeCookie, resolveTheme, writeThemeCookie };