/**
 * Headless theme state machine — pure TypeScript, zero DOM dependencies.
 * Manages light/dark/system mode with system preference tracking.
 */
type ThemeMode = 'light' | 'dark' | 'system';
type ResolvedTheme = 'light' | 'dark';
interface ThemeState {
    /** User's chosen mode */
    mode: ThemeMode;
    /** Resolved theme after system preference detection */
    resolved: ResolvedTheme;
}
interface ThemeConfig {
    /** Initial mode. Default: 'system' */
    defaultMode?: ThemeMode;
    /** localStorage key. Default: 'rfr-theme' */
    storageKey?: string;
    /** HTML attribute to set. Default: 'class' */
    attribute?: 'class' | 'data-theme';
}
interface StorageAdapter {
    get(key: string): string | null;
    set(key: string, value: string): void;
}
interface MediaQueryAdapter {
    matches(query: string): boolean;
    subscribe(query: string, callback: (matches: boolean) => void): () => void;
}
interface ThemeAPI {
    /** Get current state */
    getState(): ThemeState;
    /** Set mode (light/dark/system) */
    setMode(mode: ThemeMode): void;
    /** Subscribe to state changes */
    subscribe(fn: (state: ThemeState) => void): () => void;
    /** Clean up subscriptions */
    destroy(): void;
}
declare function createTheme(config?: ThemeConfig, storage?: StorageAdapter, mediaQuery?: MediaQueryAdapter): ThemeAPI;

/**
 * Inline script for preventing theme flash on page load.
 * Inject this as a <script> tag in the <head> before any CSS.
 * Works with any framework (React, Astro, plain HTML).
 */
declare function getThemeScript(storageKey?: string, attribute?: 'class' | 'data-theme'): string;

/**
 * Browser DOM adapters for the theme machine.
 * These bridge the headless core to browser APIs.
 */

/** localStorage adapter */
declare function createLocalStorageAdapter(): StorageAdapter;
/** matchMedia adapter */
declare function createMediaQueryAdapter(): MediaQueryAdapter;
/** Apply resolved theme to the document */
declare function applyThemeToDOM(resolved: ResolvedTheme, attribute?: 'class' | 'data-theme'): void;

export { type MediaQueryAdapter, type ResolvedTheme, type StorageAdapter, type ThemeAPI, type ThemeConfig, type ThemeMode, type ThemeState, applyThemeToDOM, createLocalStorageAdapter, createMediaQueryAdapter, createTheme, getThemeScript };
