import { Component, JSX, Accessor } from 'solid-js';
export { createSpring } from './utils/spring.js';

/**
 * Enhanced Styled Components
 *
 * This file provides an enhanced version of the styled components system
 * that automatically detects animation props and applies animation capabilities
 * without requiring explicit wrapping.
 */

type CssArg$1 = string | number | boolean | undefined | null;
declare const enhanced: Record<string, (strings: TemplateStringsArray | any, ...args: CssArg$1[]) => Component<Record<string, unknown>>>;

/**
 * Error Handling Module for Styled Components
 *
 * Provides comprehensive error handling, logging, and recovery mechanisms
 */
declare enum ErrorType {
    STYLE_PARSE_ERROR = "STYLE_PARSE_ERROR",
    ANIMATION_ERROR = "ANIMATION_ERROR",
    THEME_ERROR = "THEME_ERROR",
    LIGHTNING_CSS_ERROR = "LIGHTNING_CSS_ERROR",
    RUNTIME_ERROR = "RUNTIME_ERROR",
    SSR_ERROR = "SSR_ERROR"
}
declare enum ErrorSeverity {
    WARNING = "warning",
    ERROR = "error",
    CRITICAL = "critical"
}
interface StyledError {
    type: ErrorType;
    severity: ErrorSeverity;
    message: string;
    component?: string;
    props?: Record<string, any>;
    stack?: string;
    timestamp: number;
    context?: Record<string, any>;
    originalError?: Error;
}
interface ErrorHandlerConfig {
    enableLogging: boolean;
    enableRecovery: boolean;
    onError?: (error: StyledError) => void;
    maxErrors?: number;
    suppressErrors?: boolean;
}
declare class ErrorHandler {
    private errors;
    private config;
    configure(config: Partial<ErrorHandlerConfig>): void;
    handleError(error: StyledError): void;
    private logError;
    private attemptRecovery;
    private recoverFromStyleError;
    private recoverFromAnimationError;
    private recoverFromThemeError;
    private recoverFromLightningError;
    private genericRecovery;
    getErrors(): StyledError[];
    clearErrors(): void;
    getErrorCount(): number;
    getErrorsByType(type: ErrorType): StyledError[];
    getErrorsBySeverity(severity: ErrorSeverity): StyledError[];
}
declare const errorHandler: ErrorHandler;
declare function createError(type: ErrorType, message: string, severity?: ErrorSeverity, context?: Record<string, any>): StyledError;
declare function safeExecute<T>(fn: () => T, errorTypeOrFallback?: any, component?: string, fallback?: T): T | undefined;
declare function safeExecuteAsync<T>(fn: () => Promise<T>, errorTypeOrFallback?: any, component?: string, fallback?: T): Promise<T | undefined>;
declare function validateStyles(styles: string | Record<string, any>, component?: string): boolean;
declare function validateAnimation(config: any, component?: string): boolean;
declare function handleSSRError(error: Error, component?: string): void;
declare function devWarning(message: string, context?: Record<string, any>): void;
type PerformanceResult<T> = {
    result: T;
    duration: number;
};
type PerformanceFn<T> = () => T | Promise<T>;
declare function measurePerformance<T>(arg1: string | PerformanceFn<T>, arg2?: PerformanceFn<T> | string, threshold?: number): T | PerformanceResult<T> | Promise<PerformanceResult<T>>;

/**
 * Performance Monitoring Module for Styled Components
 *
 * Tracks and optimizes performance metrics for styled components
 */
interface PerformanceMetrics {
    renderTime: number;
    styleApplicationTime: number;
    animationFrameTime: number;
    memoryUsage: number;
    componentCount: number;
    styleUpdateCount: number;
    cacheHitRate: number;
}
interface PerformanceThresholds {
    renderTime: number;
    styleApplicationTime: number;
    animationFrameTime: number;
    memoryUsage: number;
    cacheHitRate: number;
}
declare class PerformanceMonitor {
    private metrics;
    private thresholds;
    private observers;
    private isMonitoring;
    private animationFrameId;
    private lastFrameTime;
    private cacheHits;
    private cacheMisses;
    startMonitoring(): void;
    stopMonitoring(): void;
    private monitorAnimationFrame;
    private monitorMemory;
    recordRenderTime(componentName: string, time: number): void;
    recordStyleApplicationTime(time: number): void;
    recordCacheHit(): void;
    recordCacheMiss(): void;
    private updateCacheHitRate;
    setThresholds(thresholds: Partial<PerformanceThresholds>): void;
    getMetrics(): PerformanceMetrics;
    subscribe(observer: (metrics: PerformanceMetrics) => void): () => boolean;
    private notifyObservers;
    private notifyThresholdExceeded;
    reset(): void;
}
declare function measureRenderTime<T = void>(componentName: string, fn?: () => T): T | {
    startRender: () => void;
    endRender: () => number;
};
declare function measureStyleApplication<T>(fn: () => T): T;
declare class StyleCache {
    private cache;
    private maxSize;
    private hits;
    private misses;
    constructor(maxSize?: number);
    get(key: string): string | undefined;
    set(key: string, value: string): void;
    clear(): void;
    size(): number;
    /**
     * Expose stats used by the test-suite.
     */
    getStats(): {
        hits: number;
        misses: number;
        hitRate: number;
    };
}
declare class ObjectPool<T> {
    private pool;
    private factory;
    private reset;
    private maxSize;
    constructor(factory: () => T, reset: (obj: T) => void, maxSize?: number);
    acquire(): T;
    release(obj: T): void;
    clear(): void;
    size(): number;
}
declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number, immediate?: boolean): T & {
    cancel: () => void;
};
interface ThrottleOptions {
    leading?: boolean;
    trailing?: boolean;
}
declare function throttle<T extends (...args: any[]) => any>(fn: T, limit: number, options?: ThrottleOptions): T & {
    cancel: () => void;
};
declare function whenIdle(callback: () => void, timeout?: number): void;
declare class UpdateBatcher<T extends (...args: any[]) => any> {
    private updates;
    private scheduled;
    private delay;
    private processor;
    constructor(delayOrProcessor?: number | ((updates: T[]) => void), maybeProcessor?: (updates: T[]) => void);
    add(update: T): void;
    flush(): void;
}
declare function usePerformanceMetrics(componentName?: string): {
    mark(label: string): void;
    measure(metricName: string, startLabel: string, endLabel: string): number;
};

type HybridPerformanceMonitor = PerformanceMonitor & ((name?: string, opts?: {
    threshold?: number;
}) => {
    end(): number;
});
declare var performanceMonitor: HybridPerformanceMonitor;

/**
 * Styled Components for SolidJS with Lightning CSS Integration
 */

type CssArg = string | number | boolean | undefined | null;
type StyledComponentDefiner<BaseP> = <UserP = Record<string, unknown>>(// UserP represents the props specific to this styled component instance
strings: TemplateStringsArray, ...interpolations: Array<string | number | ((props: UserP & BaseP & {
    theme?: any;
}) => string | number | undefined | null | boolean | CssArg) | Accessor<any>>) => Component<(UserP & BaseP) & {
    class?: string;
    style?: JSX.CSSProperties | string;
    theme?: any;
    as?: keyof JSX.IntrinsicElements | Component<any>;
    [key: string]: any;
}>;
interface IStyledFactory {
    <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponentDefiner<JSX.IntrinsicElements[T]>;
    <P extends Record<string, unknown>>(tag: Component<P>): StyledComponentDefiner<P>;
    <P extends Record<string, unknown>>(tag: Component<P> & {
        defaultProps?: Partial<P>;
        toString?: () => string;
    }): StyledComponentDefiner<P>;
}
declare let css: (strings: TemplateStringsArray, ...args: CssArg[]) => string;
declare let keyframes: (strings: TemplateStringsArray, ...args: CssArg[]) => string;
declare let createGlobalStyles: (strings: TemplateStringsArray, ...args: CssArg[]) => any;
/**
 * Setup function for compatibility with previous API and Lightning CSS initialization
 *
 * @param prefix Optional function to prefix class names
 * @param filter Optional function to filter properties
 */
declare function setup(prefix?: ((className: string) => string) | null, filter?: ((props: Record<string, any>) => Record<string, any>) | null): void;

/**
 * Extract CSS for server-side rendering
 * Returns all CSS registered during SSR
 *
 * @returns Concatenated CSS string of all styles
 */
declare function extractCss(): string;

declare const styledProxy: IStyledFactory & { [K in keyof JSX.IntrinsicElements]: StyledComponentDefiner<JSX.IntrinsicElements[K]>; };

export { ErrorSeverity, ErrorType, ObjectPool, StyleCache, UpdateBatcher, createError, createGlobalStyles, css, debounce, devWarning, enhanced, errorHandler, extractCss, handleSSRError, keyframes, measurePerformance, measureRenderTime, measureStyleApplication, performanceMonitor, safeExecute, safeExecuteAsync, setup, styledProxy as styled, throttle, usePerformanceMetrics, validateAnimation, validateStyles, whenIdle };
