import { type ReactNode } from 'react';
/**
* Theme type - supports light and dark modes
*/
export type Theme = 'light' | 'dark';
/**
* Context value provided by ThemeProvider
*/
export interface ThemeContextValue {
/** Current theme */
theme: Theme;
/** Resolved theme (same as theme since we don't support 'system') */
resolvedTheme: Theme;
/** Set the theme explicitly */
setTheme: (theme: Theme) => void;
/** Toggle between light and dark themes */
toggleTheme: () => void;
}
/**
* Props for the ThemeProvider component
*/
export interface ThemeProviderProps {
/** Child components */
children: ReactNode;
/** Default theme to use when no stored value exists (default: 'light') */
defaultTheme?: Theme;
/** localStorage key for persisting theme (default: 'theme') */
storageKey?: string;
/** Document to theme when rendering inside an iframe or embedded document */
targetDocument?: Document;
}
/**
* ThemeProvider component
*
* Provides theme context to the application with support for:
* - Persistent theme storage via localStorage
* - DOM class management for CSS-based theming
* - Cross-tab synchronization via storage events
*
* @llms Theme context provider with localStorage persistence, cross-tab sync, light/dark modes
* @example
* ```tsx
*
*
*
* ```
*/
export declare function ThemeProvider({ children, defaultTheme, storageKey, targetDocument, }: ThemeProviderProps): import("react").JSX.Element;
/**
* Hook to access the theme context
*
* @throws Error if used outside of ThemeProvider
*
* @example
* ```tsx
* function MyComponent() {
* const { theme, setTheme, toggleTheme } = useTheme();
*
* return (
*
* );
* }
* ```
*/
export declare function useTheme(): ThemeContextValue;
/**
* Hook to optionally access the theme context without throwing
*
* Returns null if used outside of ThemeProvider, making it safe for
* components that support both controlled and uncontrolled modes.
*
* @example
* ```tsx
* function MyComponent({ value, onValueChange }) {
* const themeContext = useThemeOptional();
* const isControlled = value !== undefined;
*
* // Use controlled value if provided, otherwise context
* const theme = isControlled ? value : themeContext?.theme;
* }
* ```
*/
export declare function useThemeOptional(): ThemeContextValue | null;