/** * `useTheme` — light/dark theme, token-driven. The active theme stamps * `data-theme` on the document root, which the DS token layers key off. * * A three-state PREFERENCE sits behind the resolved theme: `'light'` and * `'dark'` pin it, `'system'` follows `prefers-color-scheme` and tracks OS * changes live. The resolved `theme` a consumer reads is always the concrete * `'light' | 'dark'` the tokens need — never `'system'`. * * The preference persists to `localStorage`, but ONLY when the operator sets it * explicitly (`setPreference` / `setTheme` / `toggle`). Boot READS the stored * value; it never WRITES one, so a session that only ever renders the app leaves * storage untouched. A `'system'` preference clears any pinned choice and hands * the theme back to the OS. */ import type { ReactNode } from 'react'; export type Theme = 'light' | 'dark'; export type ThemePreference = 'light' | 'dark' | 'system'; export interface ThemeState { /** The resolved theme the tokens key off — always concrete, never `'system'`. */ readonly theme: Theme; /** The operator's choice: a pinned theme, or `'system'` to follow the OS. */ readonly preference: ThemePreference; /** Set the preference and persist it. The only path that writes storage. */ readonly setPreference: (preference: ThemePreference) => void; /** Pin an explicit theme (persists) — a preference shortcut kept for callers. */ readonly setTheme: (theme: Theme) => void; /** Flip between the two pinned themes off the current resolved theme (persists). */ readonly toggle: () => void; } export declare function ThemeProvider({ children }: { children: ReactNode; }): import("react").FunctionComponentElement>; export declare function useTheme(): ThemeState; //# sourceMappingURL=useTheme.d.ts.map