/**
 * Tasty Configuration Module
 *
 * Centralizes all tasty configuration, including:
 * - Style injector settings (nonce, cleanup thresholds, etc.)
 * - Global predefined states for advanced state mapping
 * - stylesGenerated flag that locks configuration after first style generation
 *
 * Configuration must be done BEFORE any styles are generated.
 * After the first `inject()` call, configuration is locked and attempts to
 * reconfigure will emit a warning and be ignored.
 */
import type { KeyframesSteps } from './injector/types';
import type { StyleDetails, UnitHandler } from './parser/types';
import type { TastyPlugin } from './plugins/types';
/**
 * Configuration options for the Tasty style system
 */
export interface TastyConfig {
    /** CSP nonce for style elements */
    nonce?: string;
    /** Maximum rules per stylesheet (default: 8192) */
    maxRulesPerSheet?: number;
    /** Threshold for bulk cleanup of unused styles (default: 500) */
    unusedStylesThreshold?: number;
    /** Delay before bulk cleanup in ms, ignored if idleCleanup is true (default: 5000) */
    bulkCleanupDelay?: number;
    /** Use requestIdleCallback for cleanup when available (default: true) */
    idleCleanup?: boolean;
    /** Force text injection mode, auto-detected in test environments (default: auto) */
    forceTextInjection?: boolean;
    /** Enable development mode features: performance metrics and debug info (default: auto) */
    devMode?: boolean;
    /**
     * Ratio of unused styles to delete per bulk cleanup run (0..1).
     * Defaults to 0.5 (oldest half) to reduce risk of removing styles
     * that may be restored shortly after being marked unused.
     */
    bulkCleanupBatchRatio?: number;
    /**
     * Minimum age (in ms) a style must remain unused before eligible for deletion.
     * Helps avoid races during rapid mount/unmount cycles. Default: 10000ms.
     */
    unusedStylesMinAgeMs?: number;
    /**
     * Global predefined states for advanced state mapping.
     * These are state aliases that can be used in any component.
     * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
     */
    states?: Record<string, string>;
    /**
     * Parser LRU cache size (default: 1000).
     * Larger values improve performance for apps with many unique style values.
     */
    parserCacheSize?: number;
    /**
     * Custom units for the style parser (merged with built-in units).
     * Units transform numeric values like `2x` → `calc(2 * var(--gap))`.
     * @example { em: 'em', vw: 'vw', custom: (n) => `${n * 10}px` }
     */
    units?: Record<string, string | UnitHandler>;
    /**
     * Custom functions for the style parser (merged with existing).
     * Functions process parsed style groups and return CSS values.
     * @example { myFunc: (groups) => groups.map(g => g.output).join(' ') }
     */
    funcs?: Record<string, (groups: StyleDetails[]) => string>;
    /**
     * Plugins that extend tasty with custom functions, units, or states.
     * Plugins are processed in order, with later plugins overriding earlier ones.
     * @example
     * ```ts
     * import { okhslPlugin } from '@cube-dev/ui-kit/tasty/plugins';
     *
     * configure({
     *   plugins: [okhslPlugin()],
     * });
     * ```
     */
    plugins?: TastyPlugin[];
    /**
     * Global keyframes definitions that can be referenced by animation names in styles.
     * Keys are animation names, values are keyframes step definitions.
     * Keyframes are only injected when actually used in styles.
     * @example
     * ```ts
     * configure({
     *   keyframes: {
     *     fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } },
     *     pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } },
     *   },
     * });
     * ```
     */
    keyframes?: Record<string, KeyframesSteps>;
}
declare const GLOBAL_INJECTOR_KEY = "__TASTY_GLOBAL_INJECTOR__";
declare global {
    interface Window {
        [GLOBAL_INJECTOR_KEY]?: import('./injector/injector').StyleInjector;
    }
}
/**
 * Detect if we're running in a test environment
 */
export declare function isTestEnvironment(): boolean;
/**
 * Mark that styles have been generated (called by injector on first inject)
 * This locks the configuration - no further changes allowed.
 */
export declare function markStylesGenerated(): void;
/**
 * Check if styles have been generated (configuration is locked)
 */
export declare function hasStylesGenerated(): boolean;
/**
 * Reset styles generated flag (for testing only)
 */
export declare function resetStylesGenerated(): void;
/**
 * Check if any global keyframes are configured.
 * Fast path: returns false if no keyframes were ever set.
 */
export declare function hasGlobalKeyframes(): boolean;
/**
 * Get global keyframes configuration.
 * Returns null if no keyframes configured (fast path for zero-overhead).
 */
export declare function getGlobalKeyframes(): Record<string, KeyframesSteps> | null;
/**
 * Check if configuration is locked (styles have been generated)
 */
export declare function isConfigLocked(): boolean;
/**
 * Configure the Tasty style system.
 *
 * Must be called BEFORE any styles are generated (before first render that uses tasty).
 * After styles are generated, configuration is locked and calls to configure() will
 * emit a warning and be ignored.
 *
 * @example
 * ```ts
 * import { configure } from '@cube-dev/ui-kit';
 *
 * // Configure before app renders
 * configure({
 *   nonce: 'abc123',
 *   states: {
 *     '@mobile': '@media(w < 768px)',
 *     '@dark': '@root(theme=dark)',
 *   },
 * });
 * ```
 */
export declare function configure(config?: Partial<TastyConfig>): void;
/**
 * Get the current configuration.
 * If not configured, returns default configuration.
 */
export declare function getConfig(): TastyConfig;
/**
 * Get the global injector instance.
 * Auto-configures with defaults if not already configured.
 */
export declare function getGlobalInjector(): import('./injector/injector').StyleInjector;
/**
 * Reset configuration (for testing only).
 * Clears the global injector and allows reconfiguration.
 */
export declare function resetConfig(): void;
export type { TastyConfig as StyleInjectorConfig };
