type Attribute = 'class' | `data-${string}`; type StorageMode = 'hybrid' | 'cookie' | 'local' | 'session' | 'none'; interface CookieOptions { name?: string; maxAge?: number; path?: string; domain?: string; sameSite?: 'strict' | 'lax' | 'none'; secure?: boolean; } type StorageConfig = StorageMode | { mode: StorageMode; key?: string; cookieOptions?: CookieOptions; }; interface ThemeState { /** The selected theme (may be 'system'). */ theme: string; /** The resolved theme after system resolution (always a concrete theme). */ resolvedTheme: string; /** The OS preference, or null if system detection is disabled. */ systemTheme: 'light' | 'dark' | null; /** If set, theme is locked to this value. */ forcedTheme: string | null; /** The list of available themes (excluding 'system'). */ themes: string[]; } type TransitionType = 'fade' | 'circular' | 'none'; type TransitionOrigin = 'cursor' | 'center' | { x: number; y: number; }; interface TransitionOptions { /** Animation style. Default `'fade'`. */ type?: TransitionType; /** Duration in milliseconds. Default `250`. */ duration?: number; /** CSS timing function. Default `'ease'`. */ easing?: string; /** * For circular: origin of the reveal. `'cursor'` uses the last * pointerdown position; `'center'` uses the viewport center; an explicit * `{ x, y }` uses those client coordinates. Default `'cursor'`. */ origin?: TransitionOrigin; /** * Custom CSS for the `::view-transition-*` pseudo-elements, applied for * the duration of the transition. Overrides the built-in `type` CSS. */ css?: string; } /** Shorthand aliases accepted on the `transition` prop. */ type TransitionConfig = boolean | TransitionType | TransitionOptions; interface SetThemeOptions { /** Override the provider-level transition for this call. */ transition?: TransitionConfig; } /** * Accepts either a concrete theme string or an updater function that receives * the currently-selected theme and returns the next one. Mirrors React's * `Dispatch>` so code written for upstream `next-themes` * (`setTheme(prev => prev === 'dark' ? 'light' : 'dark')`) keeps working. */ type SetThemeAction = string | ((prev: string) => string); type ThemeContract = ThemeState & { setTheme: (theme: SetThemeAction, options?: SetThemeOptions) => void; }; type Listener = (state: ThemeState) => void; export type { Attribute as A, CookieOptions as C, Listener as L, SetThemeAction as S, ThemeContract as T, SetThemeOptions as a, StorageConfig as b, StorageMode as c, ThemeState as d, TransitionConfig as e, TransitionOptions as f, TransitionOrigin as g, TransitionType as h };