/**
 * @file Elegant theme context management. Async-aware theming with automatic
 *   context isolation via AsyncLocalStorage.
 */
import type { Theme } from './types';
import { type ThemeName } from './themes';
/**
 * Theme change event listener signature.
 */
export type ThemeChangeListener = (theme: Theme) => void;
/**
 * Emit theme change event to listeners.
 *
 * @private
 */
export declare function emitThemeChange(theme: Theme): void;
/**
 * Lazily load the async_hooks module to avoid Webpack errors.
 *
 * @private
 */
export declare function getAsyncHooks(): typeof import('node:async_hooks');
/**
 * Get the active theme from context.
 *
 * @example
 *   ;```ts
 *   const theme = getTheme()
 *   console.log(theme.displayName)
 *   ```
 *
 * @returns Current theme
 */
export declare function getTheme(): Theme;
/**
 * Subscribe to theme change events.
 *
 * @example
 *   ;```ts
 *   const unsubscribe = onThemeChange(theme => {
 *     console.log('Theme:', theme.displayName)
 *   })
 *
 *   // Cleanup
 *   unsubscribe()
 *   ```
 *
 * @param listener - Change handler.
 *
 * @returns Unsubscribe function
 */
export declare function onThemeChange(listener: ThemeChangeListener): () => void;
/**
 * Set the global fallback theme.
 *
 * @example
 *   ;```ts
 *   setTheme('socket-firewall')
 *   ```
 *
 * @param theme - Theme name or object.
 */
export declare function setTheme(theme: Theme | ThemeName): void;
/**
 * Execute async operation with scoped theme. Theme automatically restored on
 * completion.
 *
 * @example
 *   ;```ts
 *   await withTheme('ultra', async () => {
 *     // Operations use Ultra theme
 *   })
 *   ```
 *
 * @template T - Return type.
 *
 * @param theme - Scoped theme.
 * @param fn - Async operation.
 *
 * @returns Operation result
 */
export declare function withTheme<T>(theme: Theme | ThemeName, fn: () => Promise<T>): Promise<T>;
/**
 * Execute sync operation with scoped theme. Theme automatically restored on
 * completion.
 *
 * @example
 *   ;```ts
 *   const result = withThemeSync('coana', () => {
 *     return processData()
 *   })
 *   ```
 *
 * @template T - Return type.
 *
 * @param theme - Scoped theme.
 * @param fn - Sync operation.
 *
 * @returns Operation result
 */
export declare function withThemeSync<T>(theme: Theme | ThemeName, fn: () => T): T;
