import { z } from 'zod';
import { EventEmitter } from 'events';
import * as cheerio from 'cheerio';
import { AnyNode } from 'domhandler';
import { ParserOptions } from '@babel/parser';
import { NodePath } from '@babel/traverse';
import * as t from '@babel/types';
export * from '@babel/types';
import { Stats } from 'fs';
import { Result, Plugin } from 'postcss';
export { Plugin, PluginCreator, Result, Root } from 'postcss';

/**
 * Backup metadata interface
 */
interface BackupMetadata {
    id: string;
    originalPath: string;
    backupPath: string;
    timestamp: Date;
    version: string;
    checksum: string;
    size: number;
    description?: string;
    tags: string[];
    isAutomatic: boolean;
}
/**
 * Backup verification result
 */
interface BackupVerification {
    isValid: boolean;
    checksumMatch: boolean;
    fileExists: boolean;
    isReadable: boolean;
    isValidJson: boolean;
    errors: string[];
    warnings: string[];
}
/**
 * Backup restoration result
 */
interface RestoreResult {
    success: boolean;
    backupId: string;
    originalPath: string;
    restoredAt: Date;
    errors: string[];
    warnings: string[];
    backupCreated?: string;
}
/**
 * Backup retention policy
 */
interface RetentionPolicy {
    maxBackups: number;
    maxAge: number;
    keepDaily: number;
    keepWeekly: number;
    keepMonthly: number;
    autoCleanup: boolean;
}
/**
 * Backup options
 */
interface BackupOptions {
    description?: string;
    tags?: string[];
    compress?: boolean;
    encrypt?: boolean;
    includeMetadata?: boolean;
}
/**
 * Default retention policy
 */
declare const DEFAULT_RETENTION_POLICY: RetentionPolicy;
/**
 * Configuration backup manager
 */
declare class ConfigBackup extends EventEmitter {
    private configPath;
    private backupDir;
    private metadataFile;
    private retentionPolicy;
    private backups;
    constructor(configPath: string, backupDir?: string, retentionPolicy?: Partial<RetentionPolicy>);
    /**
     * Initialize backup system
     */
    private initializeBackupSystem;
    /**
     * Load backup metadata
     */
    private loadBackupMetadata;
    /**
     * Save backup metadata
     */
    private saveBackupMetadata;
    /**
     * Create a backup of the configuration
     */
    createBackup(options?: BackupOptions): Promise<BackupMetadata>;
    /**
     * Restore configuration from backup
     */
    restoreFromBackup(backupId: string, createBackupBeforeRestore?: boolean): Promise<RestoreResult>;
    /**
     * Verify backup integrity
     */
    verifyBackup(backupId: string): Promise<BackupVerification>;
    /**
     * List all backups
     */
    listBackups(filter?: {
        tags?: string[];
        isAutomatic?: boolean;
        fromDate?: Date;
        toDate?: Date;
    }): BackupMetadata[];
    /**
     * Delete a backup
     */
    deleteBackup(backupId: string, force?: boolean): Promise<boolean>;
    /**
     * Apply retention policy
     */
    applyRetentionPolicy(): Promise<{
        deleted: string[];
        kept: string[];
        errors: string[];
    }>;
    /**
     * Get backup statistics
     */
    getBackupStatistics(): {
        totalBackups: number;
        automaticBackups: number;
        manualBackups: number;
        totalSize: number;
        oldestBackup?: Date;
        newestBackup?: Date;
        corruptedBackups: number;
    };
    /**
     * Generate backup ID
     */
    private generateBackupId;
    /**
     * Calculate checksum for content
     */
    private calculateChecksum;
    /**
     * Extract configuration version from content
     */
    private extractConfigVersion;
    /**
     * Create emergency backup
     */
    createEmergencyBackup(reason: string): Promise<BackupMetadata>;
    /**
     * Get latest backup
     */
    getLatestBackup(): BackupMetadata | null;
    /**
     * Cleanup corrupted backups
     */
    cleanupCorruptedBackups(): Promise<string[]>;
}
/**
 * Create configuration backup manager
 */
declare function createConfigBackup(configPath: string, backupDir?: string, retentionPolicy?: Partial<RetentionPolicy>): ConfigBackup;
/**
 * Quick backup utility
 */
declare function backupConfig(configPath: string, options?: BackupOptions): Promise<BackupMetadata>;
/**
 * Quick restore utility
 */
declare function restoreConfig(configPath: string, backupId: string): Promise<RestoreResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Log levels following Log4j standard
 */
declare const LogLevel: {
    readonly TRACE: 0;
    readonly DEBUG: 1;
    readonly INFO: 2;
    readonly WARN: 3;
    readonly ERROR: 4;
    readonly FATAL: 5;
};
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
/**
 * Log level names for easy reference
 */
declare const LogLevelNames: Record<LogLevel, string>;
/**
 * File output options for logging
 */
interface FileOutputOptions {
    filePath: string;
    format?: 'human' | 'json' | 'csv';
    maxSize?: number;
    maxFiles?: number;
    compress?: boolean;
}
/**
 * Progress tracking options
 */
interface ProgressOptions {
    total: number;
    current?: number;
    label?: string;
    showPercentage?: boolean;
    showETA?: boolean;
}
/**
 * Configuration options for the logger
 */
interface LoggerOptions {
    level?: LogLevel;
    verbose?: boolean;
    veryVerbose?: boolean;
    quiet?: boolean;
    silent?: boolean;
    outputFormat?: 'human' | 'json';
    colorize?: boolean;
    timestamp?: boolean;
    component?: string;
    fileOutput?: FileOutputOptions;
    enableProgressTracking?: boolean;
}
/**
 * Structured log entry for JSON output
 */
interface LogEntry {
    level: string;
    message: string;
    timestamp: string;
    component?: string;
    context?: Record<string, unknown>;
    error?: {
        name: string;
        message: string;
        stack?: string;
        code?: string;
    };
}
/**
 * Enhanced error context for detailed logging
 */
interface ErrorContext {
    component?: string;
    operation?: string;
    userId?: string;
    requestId?: string;
    filePath?: string;
    processingTime?: number;
    memoryUsage?: number;
    fileSize?: number;
    compressionRatio?: number;
    [key: string]: unknown;
}
/**
 * Performance metrics for detailed logging
 */
interface PerformanceMetrics$1 {
    memoryUsage: NodeJS.MemoryUsage;
    processingTime: number;
    fileCount?: number;
    totalFileSize?: number;
    optimizationRatio?: number;
}
/**
 * Centralized logger class for the Tailwind Enigma Core application
 */
declare class Logger {
    private level;
    private verbose;
    private veryVerbose;
    private quiet;
    private silent;
    private outputFormat;
    private colorize;
    private timestamp;
    private component?;
    private fileOutput?;
    private fileStream?;
    private enableProgressTracking;
    private progressStates;
    constructor(options?: LoggerOptions);
    /**
     * Initialize file output with rotation support
     */
    private initializeFileOutput;
    /**
     * Rotate log files if size limit exceeded
     */
    private rotateLogsIfNeeded;
    /**
     * Perform log file rotation with optional compression
     */
    private rotateLogFiles;
    /**
     * Set the minimum log level
     */
    setLevel(level: LogLevel): void;
    /**
     * Enable or disable verbose logging
     */
    setVerbose(verbose: boolean): void;
    /**
     * Enable or disable very verbose logging
     */
    setVeryVerbose(veryVerbose: boolean): void;
    /**
     * Enable or disable quiet mode
     */
    setQuiet(quiet: boolean): void;
    /**
     * Enable or disable silent mode
     */
    setSilent(silent: boolean): void;
    /**
     * Set output format
     */
    setOutputFormat(format: 'human' | 'json'): void;
    /**
     * Configure file output
     */
    setFileOutput(options: FileOutputOptions): void;
    /**
     * Disable file output
     */
    disableFileOutput(): void;
    /**
     * Start progress tracking for an operation
     */
    startProgress(id: string, options: ProgressOptions): void;
    /**
     * Update progress for an operation
     */
    updateProgress(id: string, current: number, additionalInfo?: string): void;
    /**
     * Complete progress tracking for an operation
     */
    completeProgress(id: string, summary?: string): void;
    /**
     * Log performance metrics
     */
    performanceMetrics(operation: string, metrics: PerformanceMetrics$1, context?: ErrorContext): void;
    /**
     * Log detailed file operation
     */
    fileOperation(operation: string, filePath: string, details?: {
        size?: number;
        processingTime?: number;
        result?: string;
    }): void;
    /**
     * Log step-by-step process details
     */
    processStep(step: string, details?: string, context?: ErrorContext): void;
    /**
     * Create a child logger with additional context
     */
    child(component: string, options?: Partial<LoggerOptions>): Logger;
    /**
     * Check if a log level should be output
     */
    private shouldLog;
    /**
     * Format timestamp
     */
    private getTimestamp;
    /**
     * Create a structured log entry
     */
    private createLogEntry;
    /**
     * Format log entry for human-readable output
     */
    private formatHuman;
    /**
     * Format log entry for CSV output
     */
    private formatCSV;
    /**
     * Output a log entry to console and/or file
     */
    private output;
    /**
     * Core logging method
     */
    private log;
    /**
     * Log a trace message (most verbose)
     */
    trace(message: string, context?: ErrorContext): void;
    /**
     * Log a debug message
     */
    debug(message: string, context?: ErrorContext): void;
    /**
     * Log an info message
     */
    info(message: string, context?: ErrorContext): void;
    /**
     * Log a warning message
     */
    warn(message: string, context?: ErrorContext): void;
    /**
     * Log an error message
     */
    error(messageOrError: string | Error, context?: ErrorContext): void;
    /**
     * Log a fatal error message
     */
    fatal(messageOrError: string | Error, context?: ErrorContext): void;
    /**
     * Log performance timing
     */
    timing(operation: string, duration: number, context?: ErrorContext): void;
    /**
     * Clean up resources (close file streams)
     */
    cleanup(): void;
    /**
     * Get current logger state for debugging
     */
    getState(): {
        level: LogLevel;
        verbose: boolean;
        veryVerbose: boolean;
        quiet: boolean;
        silent: boolean;
        fileOutputEnabled: boolean;
        progressTrackingEnabled: boolean;
        activeProgressCount: number;
    };
}
/**
 * Default logger instance
 */
declare const logger: Logger;
/**
 * Create a logger with specific component context
 */
declare function createLogger(component: string, _options?: Partial<LoggerOptions>): Logger;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Base error class for all Tailwind Enigma Core errors
 * Provides standardized error handling with logging integration
 */
declare abstract class EnigmaError extends Error {
    readonly timestamp: Date;
    readonly errorId: string;
    readonly code: string;
    readonly context?: ErrorContext;
    readonly cause?: Error;
    constructor(message: string, code: string, context?: ErrorContext, cause?: Error);
    /**
     * Generate a unique error ID for tracking
     */
    private generateErrorId;
    /**
     * Log the error using the centralized logger
     */
    private logError;
    /**
     * Convert error to JSON for structured logging
     */
    toJSON(): Record<string, unknown>;
}
/**
 * Configuration-related errors
 */
declare class ConfigError extends EnigmaError {
    readonly filepath?: string;
    constructor(message: string, filepath?: string, cause?: Error, context?: ErrorContext);
}
/**
 * File discovery operation errors
 */
declare class FileDiscoveryError$1 extends EnigmaError {
    readonly patterns?: string | string[];
    constructor(message: string, patterns?: string | string[], cause?: Error, context?: ErrorContext);
}
/**
 * HTML parsing and extraction errors
 */
declare class HtmlParsingError$1 extends EnigmaError {
    readonly source?: string;
    constructor(message: string, source?: string, cause?: Error, context?: ErrorContext);
}
/**
 * JavaScript/JSX parsing and extraction errors
 */
declare class JsParsingError$1 extends EnigmaError {
    readonly source?: string;
    readonly framework?: string;
    constructor(message: string, source?: string, framework?: string, cause?: Error, context?: ErrorContext);
}
/**
 * CSS processing and optimization errors
 */
declare class CssProcessingError extends EnigmaError {
    readonly source?: string;
    readonly operation?: string;
    constructor(message: string, source?: string, operation?: string, cause?: Error, context?: ErrorContext);
}
/**
 * CLI command execution errors
 */
declare class CliError extends EnigmaError {
    readonly command?: string;
    readonly suggestions?: string[];
    constructor(message: string, command?: string, suggestions?: string[], cause?: Error, context?: ErrorContext);
    /**
     * Display CLI-specific error formatting
     */
    displayError(): void;
}
/**
 * Validation errors for user input
 */
declare class ValidationError$1 extends EnigmaError {
    readonly field?: string;
    readonly value?: unknown;
    constructor(message: string, field?: string, value?: unknown, cause?: Error, context?: ErrorContext);
}
/**
 * Performance and timeout errors
 */
declare class TimeoutError extends EnigmaError {
    readonly operation?: string;
    readonly timeoutMs?: number;
    constructor(message: string, operation?: string, timeoutMs?: number, cause?: Error, context?: ErrorContext);
}
/**
 * External dependency errors (libraries, APIs, etc.)
 */
declare class DependencyError extends EnigmaError {
    readonly dependency?: string;
    readonly version?: string;
    constructor(message: string, dependency?: string, version?: string, cause?: Error, context?: ErrorContext);
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Validation result with detailed feedback
 */
interface ValidationResult$2 {
    isValid: boolean;
    errors: ValidationError$1[];
    warnings: string[];
    suggestions: string[];
    performance: {
        validationTime: number;
        rulesApplied: number;
    };
}
/**
 * Convenience function for validating configuration
 */
declare function validateConfig(config: unknown, filepath?: string): Promise<ValidationResult$2>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Runtime validation configuration
 */
interface RuntimeValidatorConfig {
    enabled: boolean;
    checkInterval: number;
    resourceThresholds: {
        memory: number;
        cpu: number;
        fileHandles: number;
        diskSpace: number;
    };
    performanceBaselines: {
        processingTime: number;
        memoryUsage: number;
        fileOperations: number;
    };
    securityChecks: {
        pathTraversal: boolean;
        filePermissions: boolean;
        resourceLimits: boolean;
    };
    autoCorrection: {
        enabled: boolean;
        maxAttempts: number;
        fallbackToDefaults: boolean;
    };
}
/**
 * Runtime configuration validator
 */
declare class RuntimeValidator extends EventEmitter {
    private config;
    private validatorConfig;
    private isRunning;
    private checkInterval?;
    private resourceBaselines;
    private performanceHistory;
    private violationCounts;
    constructor(config: EnigmaConfig, validatorConfig?: Partial<RuntimeValidatorConfig>);
    /**
     * Start runtime validation monitoring
     */
    start(): void;
    /**
     * Stop runtime validation monitoring
     */
    stop(): void;
    /**
     * Update configuration and re-validate
     */
    updateConfig(newConfig: EnigmaConfig): ValidationResult$2;
    /**
     * Validate a specific configuration value at runtime
     */
    validateValue(field: string, value: unknown, constraints?: Record<string, unknown>): ValidationResult$2;
    /**
     * Validate file paths and directories
     */
    validatePaths(): Promise<{
        isValid: boolean;
        errors: string[];
        warnings: string[];
    }>;
    /**
     * Validate resource constraints (expected by tests)
     */
    validateConstraints(): Promise<{
        isValid: boolean;
        errors: string[];
        warnings: string[];
    }>;
    /**
     * Get current resource usage statistics
     */
    getResourceUsage(): Record<string, number>;
    /**
     * Initialize performance baselines
     */
    private initializeBaselines;
    /**
     * Perform comprehensive runtime checks
     */
    private performRuntimeChecks;
    /**
     * Check resource usage against thresholds
     */
    private checkResourceUsage;
    /**
     * Check performance metrics for degradation
     */
    private checkPerformanceMetrics;
    /**
     * Check security constraints
     */
    private checkSecurityConstraints;
    /**
     * Check configuration consistency
     */
    private checkConfigurationConsistency;
    /**
     * Update performance history for trend analysis
     */
    private updatePerformanceHistory;
    /**
     * Validate configuration change
     */
    private validateConfigurationChange;
    private validateConcurrency;
    private validatePath;
    private validateFileSize;
    private validateGenericField;
    private emitResourceAlert;
    private emitPerformanceAlert;
    private emitSecurityAlert;
    private emitValidationWarning;
}

type Config = EnigmaConfig;
/**
 * Environment types for configuration defaults
 */
type Environment = 'development' | 'production' | 'test' | 'ci';
/**
 * Fallback priority levels
 */
declare const FallbackPriority: {
    readonly USER: 1;
    readonly PROJECT: 2;
    readonly ENVIRONMENT: 3;
    readonly GLOBAL: 4;
    readonly SYSTEM: 5;
};
type FallbackPriority = (typeof FallbackPriority)[keyof typeof FallbackPriority];
/**
 * Configuration source metadata
 */
interface ConfigSource {
    priority: FallbackPriority;
    source: string;
    environment?: Environment;
    timestamp: Date;
    validated: boolean;
}
/**
 * Default configuration values by environment
 */
declare const ENVIRONMENT_DEFAULTS: Record<Environment, Partial<Config>>;
/**
 * System-level safe defaults (lowest priority fallback)
 */
declare const SYSTEM_DEFAULTS: Config;
/**
 * Global configuration paths for fallback resolution
 */
declare const GLOBAL_CONFIG_PATHS: string[];
/**
 * Project-level configuration paths
 */
declare const PROJECT_CONFIG_PATHS: string[];
/**
 * Configuration defaults manager
 */
declare class ConfigDefaults {
    private environment;
    private fallbackChain;
    constructor(environment?: Environment);
    /**
     * Detect current environment
     */
    private detectEnvironment;
    /**
     * Get comprehensive defaults with progressive fallback
     */
    getDefaults(): Config;
    /**
     * Build configuration using progressive fallback strategy
     */
    private buildFallbackChain;
    /**
     * Get global configuration defaults
     */
    private getGlobalDefaults;
    /**
     * Get project-level configuration defaults
     */
    private getProjectDefaults;
    /**
     * Merge configurations with deep merge strategy
     */
    private mergeConfigs;
    /**
     * Add configuration source to fallback chain
     */
    private addToChain;
    /**
     * Validate configuration defaults
     */
    private validateDefaults;
    /**
     * Check if configuration is valid
     */
    private isValidConfig;
    /**
     * Log fallback chain for debugging
     */
    private logFallbackChain;
    /**
     * Get fallback chain information
     */
    getFallbackChain(): ConfigSource[];
    /**
     * Get environment-specific defaults
     */
    getEnvironmentDefaults(env?: Environment): Partial<Config>;
    /**
     * Create configuration with defaults applied (expected by tests)
     */
    createConfigWithDefaults(partialConfig: Partial<Config>): Config;
    /**
     * Check if path is safe for configuration
     */
    isSafePath(path: string): boolean;
    /**
     * Get safe default paths for different purposes
     */
    getSafeDefaults(): {
        outputDir: string;
        cacheDir: string;
        tempDir: string;
        logDir: string;
    };
    /**
     * Create environment-specific configuration
     */
    createEnvironmentConfig(env: Environment, overrides?: Partial<Config>): Config;
    /**
     * Validate configuration against environment constraints
     */
    validateEnvironmentConfig(config: Config, env?: Environment): {
        valid: boolean;
        warnings: string[];
        errors: string[];
    };
}
/**
 * Create default configuration manager
 */
declare function createConfigDefaults(environment?: Environment): ConfigDefaults;
/**
 * Get quick defaults for current environment
 */
declare function getQuickDefaults(): Config;
/**
 * Get safe defaults with minimal configuration
 */
declare function getSafeDefaults(): Config;
/**
 * Get environment-specific defaults (expected by tests)
 */
declare function getEnvironmentDefaults(environment: Environment): Partial<Config>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Safe update operation result
 */
interface SafeUpdateResult {
    success: boolean;
    filepath: string;
    backupPath?: string;
    transactionId: string;
    timestamp: Date;
    validation?: ValidationResult$2;
    error?: ConfigError;
    rollbackAvailable: boolean;
    changes: {
        added: string[];
        modified: string[];
        removed: string[];
    };
}
/**
 * Update transaction for atomic operations
 */
interface UpdateTransaction {
    id: string;
    timestamp: Date;
    filepath: string;
    originalContent: string;
    newContent: string;
    backupPath: string;
    tempPath: string;
    status: 'pending' | 'committed' | 'rolled-back' | 'failed';
    validation?: ValidationResult$2;
}
/**
 * Safe update options
 */
interface SafeUpdateOptions {
    validateBeforeWrite: boolean;
    createBackup: boolean;
    backupDirectory?: string;
    maxBackups: number;
    atomicWrite: boolean;
    verifyAfterWrite: boolean;
    rollbackOnFailure: boolean;
    permissions?: number;
    encoding: BufferEncoding;
    retryAttempts: number;
    retryDelay: number;
}
/**
 * Configuration merge strategy
 */
type MergeStrategy = 'replace' | 'merge-deep' | 'merge-shallow' | 'merge-arrays' | 'custom';
/**
 * Custom merge function
 */
type CustomMergeFunction = (existing: unknown, incoming: unknown, path: string[]) => unknown;
/**
 * Safe configuration updater with atomic operations
 */
declare class ConfigSafeUpdater {
    private options;
    private activeTransactions;
    private backupHistory;
    constructor(options?: Partial<SafeUpdateOptions>);
    /**
     * Safely update configuration file with atomic operations
     */
    updateConfig(filepath: string, updates: Partial<EnigmaConfig> | ((current: EnigmaConfig) => EnigmaConfig), mergeStrategy?: MergeStrategy, customMerge?: CustomMergeFunction): Promise<SafeUpdateResult>;
    /**
     * Batch update multiple configuration files
     */
    batchUpdate(updates: Array<{
        filepath: string;
        updates: Partial<EnigmaConfig> | ((current: EnigmaConfig) => EnigmaConfig);
        mergeStrategy?: MergeStrategy;
        customMerge?: CustomMergeFunction;
    }>): Promise<SafeUpdateResult[]>;
    /**
     * Rollback a configuration update by transaction ID
     */
    rollbackByTransactionId(transactionId: string): Promise<boolean>;
    /**
     * Get list of available backups for a file
     */
    getBackupHistory(filepath?: string): Array<{
        timestamp: Date;
        filepath: string;
        backupPath: string;
    }>;
    /**
     * Restore configuration from a backup
     */
    restoreFromBackup(backupPath: string, targetPath?: string): Promise<SafeUpdateResult>;
    /**
     * Create a new transaction
     */
    private createTransaction;
    /**
     * Load current configuration
     */
    private loadCurrentConfig;
    /**
     * Apply updates to configuration
     */
    private applyUpdates;
    /**
     * Deep merge two objects
     */
    private deepMerge;
    /**
     * Merge with special array handling
     */
    private mergeWithArrays;
    /**
     * Commit transaction with atomic write
     */
    private commitTransaction;
    /**
     * Rollback transaction
     */
    private rollbackTransaction;
    /**
     * Verify write operation
     */
    private verifyWrite;
    /**
     * Clean up old backups
     */
    private cleanupOldBackups;
    /**
     * Calculate changes between configurations
     */
    private calculateChanges;
    /**
     * Get original path from backup filename
     */
    private getOriginalPathFromBackup;
}
/**
 * Factory function for creating safe updater
 */
declare function createConfigSafeUpdater(options?: Partial<SafeUpdateOptions>): ConfigSafeUpdater;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration watcher events
 */
interface ConfigWatcherEvents {
    'config-changed': (result: ConfigChangeResult) => void;
    'config-validated': (result: ValidationResult$2) => void;
    'config-error': (error: ConfigError) => void;
    'file-added': (filepath: string) => void;
    'file-removed': (filepath: string) => void;
    'watcher-ready': () => void;
    'watcher-error': (error: Error) => void;
}
/**
 * Configuration change result
 */
interface ConfigChangeResult {
    filepath: string;
    timestamp: Date;
    changeType: 'added' | 'changed' | 'removed';
    isValid: boolean;
    config?: EnigmaConfig;
    validation?: ValidationResult$2;
    error?: ConfigError;
    previousConfig?: EnigmaConfig;
}
/**
 * Configuration watcher options
 */
interface ConfigWatcherOptions {
    enabled: boolean;
    debounceMs: number;
    ignoreInitial: boolean;
    persistent: boolean;
    followSymlinks: boolean;
    ignorePermissionErrors: boolean;
    atomic: boolean;
    awaitWriteFinish: {
        stabilityThreshold: number;
        pollInterval: number;
    };
    watchPatterns: string[];
    ignorePatterns: string[];
    validateOnChange: boolean;
    backupOnChange: boolean;
    maxBackups: number;
}
/**
 * Configuration file watcher
 */
declare class ConfigWatcher extends EventEmitter {
    private options;
    private watcher?;
    private isWatching;
    private watchedFiles;
    private fileTrackers;
    private currentConfig?;
    private configHistory;
    constructor(options?: Partial<ConfigWatcherOptions>);
    /**
     * Start watching configuration files
     */
    start(watchPaths?: string[]): Promise<void>;
    /**
     * Stop watching configuration files
     */
    stop(): Promise<void>;
    /**
     * Add a file or pattern to watch
     */
    addWatch(path: string): void;
    /**
     * Remove a file or pattern from watching
     */
    removeWatch(path: string): void;
    /**
     * Get currently watched files
     */
    getWatchedFiles(): string[];
    /**
     * Get configuration change history
     */
    getConfigHistory(): Array<{
        timestamp: Date;
        config: EnigmaConfig;
        filepath: string;
    }>;
    /**
     * Manually trigger validation of a configuration file
     */
    validateFile(filepath: string): Promise<ValidationResult$2>;
    /**
     * Set up watcher event handlers
     */
    private setupWatcherEvents;
    /**
     * Handle file change with debouncing
     */
    private handleFileChange;
    /**
     * Process file change after debounce period
     */
    private processFileChange;
    /**
     * Load configuration from file
     */
    private loadConfigFile;
    /**
     * Add configuration to history
     */
    private addToHistory;
    /**
     * Backup current configuration
     */
    private backupConfiguration;
    /**
     * Check if a file is a configuration file
     */
    private isConfigFile;
}
/**
 * Factory function for creating configuration watcher
 */
declare function createConfigWatcher(options?: Partial<ConfigWatcherOptions>): ConfigWatcher;
/**
 * Convenience function for watching a specific configuration file
 */
declare function watchConfigFile(filepath: string, options?: Partial<ConfigWatcherOptions>): Promise<ConfigWatcher>;

/**
 * Configuration schema using Zod for validation
 * Defines all possible configuration options for Tailwind Enigma
 */
declare const EnigmaConfigSchema: z.ZodObject<{
    pretty: z.ZodDefault<z.ZodBoolean>;
    input: z.ZodDefault<z.ZodString>;
    output: z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodObject<{
        format: z.ZodDefault<z.ZodString>;
        filename: z.ZodDefault<z.ZodString>;
        preserveOriginal: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        format: string;
        filename: string;
        preserveOriginal: boolean;
    }, {
        format?: string | undefined;
        filename?: string | undefined;
        preserveOriginal?: boolean | undefined;
    }>]>>;
    minify: z.ZodDefault<z.ZodBoolean>;
    removeUnused: z.ZodDefault<z.ZodBoolean>;
    verbose: z.ZodDefault<z.ZodBoolean>;
    veryVerbose: z.ZodDefault<z.ZodBoolean>;
    quiet: z.ZodDefault<z.ZodBoolean>;
    debug: z.ZodDefault<z.ZodBoolean>;
    logLevel: z.ZodOptional<z.ZodEnum<["trace", "debug", "info", "warn", "error", "fatal"]>>;
    logFile: z.ZodOptional<z.ZodString>;
    logFormat: z.ZodOptional<z.ZodEnum<["human", "json", "csv"]>>;
    maxConcurrency: z.ZodDefault<z.ZodNumber>;
    classPrefix: z.ZodDefault<z.ZodString>;
    excludePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    followSymlinks: z.ZodDefault<z.ZodBoolean>;
    maxFiles: z.ZodOptional<z.ZodNumber>;
    includeFileTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["HTML", "JAVASCRIPT", "CSS", "TEMPLATE"]>, "many">>;
    excludeExtensions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    preserveComments: z.ZodDefault<z.ZodBoolean>;
    sourceMaps: z.ZodDefault<z.ZodBoolean>;
    dev: z.ZodDefault<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        watch: z.ZodDefault<z.ZodBoolean>;
        server: z.ZodDefault<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            port: z.ZodDefault<z.ZodNumber>;
            host: z.ZodDefault<z.ZodString>;
            open: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            open: boolean;
            enabled: boolean;
            port: number;
            host: string;
        }, {
            open?: boolean | undefined;
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
        }>>;
        diagnostics: z.ZodDefault<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            performance: z.ZodDefault<z.ZodBoolean>;
            memory: z.ZodDefault<z.ZodBoolean>;
            fileWatcher: z.ZodDefault<z.ZodBoolean>;
            classAnalysis: z.ZodDefault<z.ZodBoolean>;
            thresholds: z.ZodDefault<z.ZodObject<{
                memoryWarning: z.ZodDefault<z.ZodNumber>;
                memoryError: z.ZodDefault<z.ZodNumber>;
                cpuWarning: z.ZodDefault<z.ZodNumber>;
                cpuError: z.ZodDefault<z.ZodNumber>;
            }, "strip", z.ZodTypeAny, {
                memoryWarning: number;
                memoryError: number;
                cpuWarning: number;
                cpuError: number;
            }, {
                memoryWarning?: number | undefined;
                memoryError?: number | undefined;
                cpuWarning?: number | undefined;
                cpuError?: number | undefined;
            }>>;
        }, "strip", z.ZodTypeAny, {
            memory: boolean;
            enabled: boolean;
            performance: boolean;
            fileWatcher: boolean;
            classAnalysis: boolean;
            thresholds: {
                memoryWarning: number;
                memoryError: number;
                cpuWarning: number;
                cpuError: number;
            };
        }, {
            memory?: boolean | undefined;
            enabled?: boolean | undefined;
            performance?: boolean | undefined;
            fileWatcher?: boolean | undefined;
            classAnalysis?: boolean | undefined;
            thresholds?: {
                memoryWarning?: number | undefined;
                memoryError?: number | undefined;
                cpuWarning?: number | undefined;
                cpuError?: number | undefined;
            } | undefined;
        }>>;
        preview: z.ZodDefault<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            autoRefresh: z.ZodDefault<z.ZodBoolean>;
            showDiff: z.ZodDefault<z.ZodBoolean>;
            highlightChanges: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            enabled: boolean;
            autoRefresh: boolean;
            showDiff: boolean;
            highlightChanges: boolean;
        }, {
            enabled?: boolean | undefined;
            autoRefresh?: boolean | undefined;
            showDiff?: boolean | undefined;
            highlightChanges?: boolean | undefined;
        }>>;
        dashboard: z.ZodDefault<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            port: z.ZodDefault<z.ZodNumber>;
            host: z.ZodDefault<z.ZodString>;
            updateInterval: z.ZodDefault<z.ZodNumber>;
            showMetrics: z.ZodDefault<z.ZodBoolean>;
            showLogs: z.ZodDefault<z.ZodBoolean>;
            maxLogEntries: z.ZodDefault<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            enabled: boolean;
            port: number;
            host: string;
            updateInterval: number;
            showMetrics: boolean;
            showLogs: boolean;
            maxLogEntries: number;
        }, {
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
            updateInterval?: number | undefined;
            showMetrics?: boolean | undefined;
            showLogs?: boolean | undefined;
            maxLogEntries?: number | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        watch: boolean;
        server: {
            open: boolean;
            enabled: boolean;
            port: number;
            host: string;
        };
        diagnostics: {
            memory: boolean;
            enabled: boolean;
            performance: boolean;
            fileWatcher: boolean;
            classAnalysis: boolean;
            thresholds: {
                memoryWarning: number;
                memoryError: number;
                cpuWarning: number;
                cpuError: number;
            };
        };
        preview: {
            enabled: boolean;
            autoRefresh: boolean;
            showDiff: boolean;
            highlightChanges: boolean;
        };
        dashboard: {
            enabled: boolean;
            port: number;
            host: string;
            updateInterval: number;
            showMetrics: boolean;
            showLogs: boolean;
            maxLogEntries: number;
        };
    }, {
        enabled?: boolean | undefined;
        watch?: boolean | undefined;
        server?: {
            open?: boolean | undefined;
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
        } | undefined;
        diagnostics?: {
            memory?: boolean | undefined;
            enabled?: boolean | undefined;
            performance?: boolean | undefined;
            fileWatcher?: boolean | undefined;
            classAnalysis?: boolean | undefined;
            thresholds?: {
                memoryWarning?: number | undefined;
                memoryError?: number | undefined;
                cpuWarning?: number | undefined;
                cpuError?: number | undefined;
            } | undefined;
        } | undefined;
        preview?: {
            enabled?: boolean | undefined;
            autoRefresh?: boolean | undefined;
            showDiff?: boolean | undefined;
            highlightChanges?: boolean | undefined;
        } | undefined;
        dashboard?: {
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
            updateInterval?: number | undefined;
            showMetrics?: boolean | undefined;
            showLogs?: boolean | undefined;
            maxLogEntries?: number | undefined;
        } | undefined;
    }>>;
    htmlExtractor: z.ZodOptional<z.ZodObject<{
        preserveWhitespace: z.ZodDefault<z.ZodBoolean>;
        caseSensitive: z.ZodDefault<z.ZodBoolean>;
        ignoreEmpty: z.ZodDefault<z.ZodBoolean>;
        maxFileSize: z.ZodDefault<z.ZodNumber>;
        timeout: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        timeout: number;
        preserveWhitespace: boolean;
        caseSensitive: boolean;
        ignoreEmpty: boolean;
        maxFileSize: number;
    }, {
        timeout?: number | undefined;
        preserveWhitespace?: boolean | undefined;
        caseSensitive?: boolean | undefined;
        ignoreEmpty?: boolean | undefined;
        maxFileSize?: number | undefined;
    }>>;
    jsExtractor: z.ZodOptional<z.ZodObject<{
        enableFrameworkDetection: z.ZodDefault<z.ZodBoolean>;
        includeDynamicClasses: z.ZodDefault<z.ZodBoolean>;
        caseSensitive: z.ZodDefault<z.ZodBoolean>;
        ignoreEmpty: z.ZodDefault<z.ZodBoolean>;
        maxFileSize: z.ZodDefault<z.ZodNumber>;
        timeout: z.ZodDefault<z.ZodNumber>;
        supportedFrameworks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        timeout: number;
        caseSensitive: boolean;
        ignoreEmpty: boolean;
        maxFileSize: number;
        enableFrameworkDetection: boolean;
        includeDynamicClasses: boolean;
        supportedFrameworks: string[];
    }, {
        timeout?: number | undefined;
        caseSensitive?: boolean | undefined;
        ignoreEmpty?: boolean | undefined;
        maxFileSize?: number | undefined;
        enableFrameworkDetection?: boolean | undefined;
        includeDynamicClasses?: boolean | undefined;
        supportedFrameworks?: string[] | undefined;
    }>>;
    cssInjector: z.ZodOptional<z.ZodObject<{
        cssPath: z.ZodString;
        htmlPath: z.ZodString;
        basePath: z.ZodOptional<z.ZodString>;
        useRelativePaths: z.ZodDefault<z.ZodBoolean>;
        linkAttributes: z.ZodDefault<z.ZodObject<{
            rel: z.ZodDefault<z.ZodString>;
            type: z.ZodDefault<z.ZodString>;
            media: z.ZodOptional<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            type: string;
            rel: string;
            media?: string | undefined;
        }, {
            type?: string | undefined;
            rel?: string | undefined;
            media?: string | undefined;
        }>>;
        insertPosition: z.ZodDefault<z.ZodEnum<["first", "last", "before-existing", "after-meta"]>>;
        preserveFormatting: z.ZodDefault<z.ZodBoolean>;
        preventDuplicates: z.ZodDefault<z.ZodBoolean>;
        duplicateStrategy: z.ZodDefault<z.ZodEnum<["skip", "replace", "error"]>>;
        createHeadIfMissing: z.ZodDefault<z.ZodBoolean>;
        createBackup: z.ZodDefault<z.ZodBoolean>;
        maxFileSize: z.ZodDefault<z.ZodNumber>;
        timeout: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        timeout: number;
        maxFileSize: number;
        cssPath: string;
        htmlPath: string;
        useRelativePaths: boolean;
        linkAttributes: {
            type: string;
            rel: string;
            media?: string | undefined;
        };
        insertPosition: "first" | "last" | "before-existing" | "after-meta";
        preserveFormatting: boolean;
        preventDuplicates: boolean;
        duplicateStrategy: "error" | "skip" | "replace";
        createHeadIfMissing: boolean;
        createBackup: boolean;
        basePath?: string | undefined;
    }, {
        cssPath: string;
        htmlPath: string;
        timeout?: number | undefined;
        maxFileSize?: number | undefined;
        basePath?: string | undefined;
        useRelativePaths?: boolean | undefined;
        linkAttributes?: {
            type?: string | undefined;
            rel?: string | undefined;
            media?: string | undefined;
        } | undefined;
        insertPosition?: "first" | "last" | "before-existing" | "after-meta" | undefined;
        preserveFormatting?: boolean | undefined;
        preventDuplicates?: boolean | undefined;
        duplicateStrategy?: "error" | "skip" | "replace" | undefined;
        createHeadIfMissing?: boolean | undefined;
        createBackup?: boolean | undefined;
    }>>;
    fileIntegrity: z.ZodOptional<z.ZodObject<{
        algorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "sha512"]>>;
        createBackups: z.ZodDefault<z.ZodBoolean>;
        backupDirectory: z.ZodDefault<z.ZodString>;
        backupRetentionDays: z.ZodDefault<z.ZodNumber>;
        maxFileSize: z.ZodDefault<z.ZodNumber>;
        timeout: z.ZodDefault<z.ZodNumber>;
        verifyAfterRollback: z.ZodDefault<z.ZodBoolean>;
        batchSize: z.ZodDefault<z.ZodNumber>;
        enableCaching: z.ZodDefault<z.ZodBoolean>;
        cacheSize: z.ZodDefault<z.ZodNumber>;
        enableCompression: z.ZodDefault<z.ZodBoolean>;
        compressionAlgorithm: z.ZodDefault<z.ZodEnum<["gzip", "deflate", "brotli"]>>;
        compressionLevel: z.ZodDefault<z.ZodNumber>;
        compressionThreshold: z.ZodDefault<z.ZodNumber>;
        enableDeduplication: z.ZodDefault<z.ZodBoolean>;
        deduplicationDirectory: z.ZodDefault<z.ZodString>;
        deduplicationAlgorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "sha512"]>>;
        deduplicationThreshold: z.ZodDefault<z.ZodNumber>;
        useHardLinks: z.ZodDefault<z.ZodBoolean>;
        enableIncrementalBackup: z.ZodDefault<z.ZodBoolean>;
        backupStrategy: z.ZodDefault<z.ZodEnum<["full", "incremental", "auto"]>>;
        changeDetectionMethod: z.ZodDefault<z.ZodEnum<["mtime", "checksum", "hybrid"]>>;
        maxIncrementalChain: z.ZodDefault<z.ZodNumber>;
        fullBackupInterval: z.ZodDefault<z.ZodNumber>;
        incrementalDirectory: z.ZodDefault<z.ZodString>;
        enableDifferentialBackup: z.ZodDefault<z.ZodBoolean>;
        differentialStrategy: z.ZodDefault<z.ZodEnum<["auto", "manual", "threshold-based"]>>;
        differentialFullBackupThreshold: z.ZodDefault<z.ZodNumber>;
        differentialFullBackupInterval: z.ZodDefault<z.ZodNumber>;
        differentialDirectory: z.ZodDefault<z.ZodString>;
        differentialSizeMultiplier: z.ZodDefault<z.ZodNumber>;
        enableBatchProcessing: z.ZodDefault<z.ZodBoolean>;
        minBatchSize: z.ZodDefault<z.ZodNumber>;
        maxBatchSize: z.ZodDefault<z.ZodNumber>;
        dynamicBatchSizing: z.ZodDefault<z.ZodBoolean>;
        memoryThreshold: z.ZodDefault<z.ZodNumber>;
        cpuThreshold: z.ZodDefault<z.ZodNumber>;
        eventLoopLagThreshold: z.ZodDefault<z.ZodNumber>;
        batchProcessingStrategy: z.ZodDefault<z.ZodEnum<["sequential", "parallel", "adaptive"]>>;
        enableProgressTracking: z.ZodDefault<z.ZodBoolean>;
        progressUpdateInterval: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        enableProgressTracking: boolean;
        timeout: number;
        algorithm: "md5" | "sha1" | "sha256" | "sha512";
        maxFileSize: number;
        createBackups: boolean;
        backupDirectory: string;
        backupRetentionDays: number;
        verifyAfterRollback: boolean;
        batchSize: number;
        enableCaching: boolean;
        cacheSize: number;
        enableCompression: boolean;
        compressionAlgorithm: "gzip" | "deflate" | "brotli";
        compressionLevel: number;
        compressionThreshold: number;
        enableDeduplication: boolean;
        deduplicationDirectory: string;
        deduplicationAlgorithm: "md5" | "sha1" | "sha256" | "sha512";
        deduplicationThreshold: number;
        useHardLinks: boolean;
        enableIncrementalBackup: boolean;
        backupStrategy: "full" | "incremental" | "auto";
        changeDetectionMethod: "mtime" | "checksum" | "hybrid";
        maxIncrementalChain: number;
        fullBackupInterval: number;
        incrementalDirectory: string;
        enableDifferentialBackup: boolean;
        differentialStrategy: "auto" | "manual" | "threshold-based";
        differentialFullBackupThreshold: number;
        differentialFullBackupInterval: number;
        differentialDirectory: string;
        differentialSizeMultiplier: number;
        enableBatchProcessing: boolean;
        minBatchSize: number;
        maxBatchSize: number;
        dynamicBatchSizing: boolean;
        memoryThreshold: number;
        cpuThreshold: number;
        eventLoopLagThreshold: number;
        batchProcessingStrategy: "sequential" | "parallel" | "adaptive";
        progressUpdateInterval: number;
    }, {
        enableProgressTracking?: boolean | undefined;
        timeout?: number | undefined;
        algorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
        maxFileSize?: number | undefined;
        createBackups?: boolean | undefined;
        backupDirectory?: string | undefined;
        backupRetentionDays?: number | undefined;
        verifyAfterRollback?: boolean | undefined;
        batchSize?: number | undefined;
        enableCaching?: boolean | undefined;
        cacheSize?: number | undefined;
        enableCompression?: boolean | undefined;
        compressionAlgorithm?: "gzip" | "deflate" | "brotli" | undefined;
        compressionLevel?: number | undefined;
        compressionThreshold?: number | undefined;
        enableDeduplication?: boolean | undefined;
        deduplicationDirectory?: string | undefined;
        deduplicationAlgorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
        deduplicationThreshold?: number | undefined;
        useHardLinks?: boolean | undefined;
        enableIncrementalBackup?: boolean | undefined;
        backupStrategy?: "full" | "incremental" | "auto" | undefined;
        changeDetectionMethod?: "mtime" | "checksum" | "hybrid" | undefined;
        maxIncrementalChain?: number | undefined;
        fullBackupInterval?: number | undefined;
        incrementalDirectory?: string | undefined;
        enableDifferentialBackup?: boolean | undefined;
        differentialStrategy?: "auto" | "manual" | "threshold-based" | undefined;
        differentialFullBackupThreshold?: number | undefined;
        differentialFullBackupInterval?: number | undefined;
        differentialDirectory?: string | undefined;
        differentialSizeMultiplier?: number | undefined;
        enableBatchProcessing?: boolean | undefined;
        minBatchSize?: number | undefined;
        maxBatchSize?: number | undefined;
        dynamicBatchSizing?: boolean | undefined;
        memoryThreshold?: number | undefined;
        cpuThreshold?: number | undefined;
        eventLoopLagThreshold?: number | undefined;
        batchProcessingStrategy?: "sequential" | "parallel" | "adaptive" | undefined;
        progressUpdateInterval?: number | undefined;
    }>>;
    patternValidator: z.ZodOptional<z.ZodObject<{
        enableValidation: z.ZodDefault<z.ZodBoolean>;
        skipInvalidClasses: z.ZodDefault<z.ZodBoolean>;
        warnOnInvalidClasses: z.ZodDefault<z.ZodBoolean>;
        customClasses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        enableValidation: boolean;
        skipInvalidClasses: boolean;
        warnOnInvalidClasses: boolean;
        customClasses: string[];
    }, {
        enableValidation?: boolean | undefined;
        skipInvalidClasses?: boolean | undefined;
        warnOnInvalidClasses?: boolean | undefined;
        customClasses?: string[] | undefined;
    }>>;
    validation: z.ZodDefault<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        validateOnLoad: z.ZodDefault<z.ZodBoolean>;
        validateOnChange: z.ZodDefault<z.ZodBoolean>;
        strictMode: z.ZodDefault<z.ZodBoolean>;
        warnOnDeprecated: z.ZodDefault<z.ZodBoolean>;
        failOnInvalid: z.ZodDefault<z.ZodBoolean>;
        crossFieldValidation: z.ZodDefault<z.ZodBoolean>;
        securityValidation: z.ZodDefault<z.ZodBoolean>;
        performanceValidation: z.ZodDefault<z.ZodBoolean>;
        customRules: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        validateOnLoad: boolean;
        validateOnChange: boolean;
        strictMode: boolean;
        warnOnDeprecated: boolean;
        failOnInvalid: boolean;
        crossFieldValidation: boolean;
        securityValidation: boolean;
        performanceValidation: boolean;
        customRules: string[];
    }, {
        enabled?: boolean | undefined;
        validateOnLoad?: boolean | undefined;
        validateOnChange?: boolean | undefined;
        strictMode?: boolean | undefined;
        warnOnDeprecated?: boolean | undefined;
        failOnInvalid?: boolean | undefined;
        crossFieldValidation?: boolean | undefined;
        securityValidation?: boolean | undefined;
        performanceValidation?: boolean | undefined;
        customRules?: string[] | undefined;
    }>>;
    runtime: z.ZodDefault<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        checkInterval: z.ZodDefault<z.ZodNumber>;
        resourceThresholds: z.ZodDefault<z.ZodObject<{
            memory: z.ZodDefault<z.ZodNumber>;
            cpu: z.ZodDefault<z.ZodNumber>;
            fileHandles: z.ZodDefault<z.ZodNumber>;
            diskSpace: z.ZodDefault<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            memory: number;
            cpu: number;
            fileHandles: number;
            diskSpace: number;
        }, {
            memory?: number | undefined;
            cpu?: number | undefined;
            fileHandles?: number | undefined;
            diskSpace?: number | undefined;
        }>>;
        autoCorrection: z.ZodDefault<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            maxAttempts: z.ZodDefault<z.ZodNumber>;
            fallbackToDefaults: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            enabled: boolean;
            maxAttempts: number;
            fallbackToDefaults: boolean;
        }, {
            enabled?: boolean | undefined;
            maxAttempts?: number | undefined;
            fallbackToDefaults?: boolean | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        checkInterval: number;
        resourceThresholds: {
            memory: number;
            cpu: number;
            fileHandles: number;
            diskSpace: number;
        };
        autoCorrection: {
            enabled: boolean;
            maxAttempts: number;
            fallbackToDefaults: boolean;
        };
    }, {
        enabled?: boolean | undefined;
        checkInterval?: number | undefined;
        resourceThresholds?: {
            memory?: number | undefined;
            cpu?: number | undefined;
            fileHandles?: number | undefined;
            diskSpace?: number | undefined;
        } | undefined;
        autoCorrection?: {
            enabled?: boolean | undefined;
            maxAttempts?: number | undefined;
            fallbackToDefaults?: boolean | undefined;
        } | undefined;
    }>>;
    watcher: z.ZodDefault<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        debounceMs: z.ZodDefault<z.ZodNumber>;
        followSymlinks: z.ZodDefault<z.ZodBoolean>;
        ignoreInitial: z.ZodDefault<z.ZodBoolean>;
        validateOnChange: z.ZodDefault<z.ZodBoolean>;
        backupOnChange: z.ZodDefault<z.ZodBoolean>;
        maxBackups: z.ZodDefault<z.ZodNumber>;
        watchPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        ignorePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        followSymlinks: boolean;
        enabled: boolean;
        validateOnChange: boolean;
        debounceMs: number;
        ignoreInitial: boolean;
        backupOnChange: boolean;
        maxBackups: number;
        watchPatterns: string[];
        ignorePatterns: string[];
    }, {
        followSymlinks?: boolean | undefined;
        enabled?: boolean | undefined;
        validateOnChange?: boolean | undefined;
        debounceMs?: number | undefined;
        ignoreInitial?: boolean | undefined;
        backupOnChange?: boolean | undefined;
        maxBackups?: number | undefined;
        watchPatterns?: string[] | undefined;
        ignorePatterns?: string[] | undefined;
    }>>;
    safeUpdates: z.ZodDefault<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        validateBeforeWrite: z.ZodDefault<z.ZodBoolean>;
        createBackup: z.ZodDefault<z.ZodBoolean>;
        atomicWrite: z.ZodDefault<z.ZodBoolean>;
        verifyAfterWrite: z.ZodDefault<z.ZodBoolean>;
        rollbackOnFailure: z.ZodDefault<z.ZodBoolean>;
        maxBackups: z.ZodDefault<z.ZodNumber>;
        backupDirectory: z.ZodOptional<z.ZodString>;
        retryAttempts: z.ZodDefault<z.ZodNumber>;
        retryDelay: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        createBackup: boolean;
        maxBackups: number;
        validateBeforeWrite: boolean;
        atomicWrite: boolean;
        verifyAfterWrite: boolean;
        rollbackOnFailure: boolean;
        retryAttempts: number;
        retryDelay: number;
        backupDirectory?: string | undefined;
    }, {
        enabled?: boolean | undefined;
        createBackup?: boolean | undefined;
        backupDirectory?: string | undefined;
        maxBackups?: number | undefined;
        validateBeforeWrite?: boolean | undefined;
        atomicWrite?: boolean | undefined;
        verifyAfterWrite?: boolean | undefined;
        rollbackOnFailure?: boolean | undefined;
        retryAttempts?: number | undefined;
        retryDelay?: number | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    validation: {
        enabled: boolean;
        validateOnLoad: boolean;
        validateOnChange: boolean;
        strictMode: boolean;
        warnOnDeprecated: boolean;
        failOnInvalid: boolean;
        crossFieldValidation: boolean;
        securityValidation: boolean;
        performanceValidation: boolean;
        customRules: string[];
    };
    verbose: boolean;
    veryVerbose: boolean;
    quiet: boolean;
    pretty: boolean;
    input: string;
    output: string | {
        format: string;
        filename: string;
        preserveOriginal: boolean;
    };
    minify: boolean;
    removeUnused: boolean;
    debug: boolean;
    maxConcurrency: number;
    classPrefix: string;
    excludePatterns: string[];
    followSymlinks: boolean;
    excludeExtensions: string[];
    preserveComments: boolean;
    sourceMaps: boolean;
    dev: {
        enabled: boolean;
        watch: boolean;
        server: {
            open: boolean;
            enabled: boolean;
            port: number;
            host: string;
        };
        diagnostics: {
            memory: boolean;
            enabled: boolean;
            performance: boolean;
            fileWatcher: boolean;
            classAnalysis: boolean;
            thresholds: {
                memoryWarning: number;
                memoryError: number;
                cpuWarning: number;
                cpuError: number;
            };
        };
        preview: {
            enabled: boolean;
            autoRefresh: boolean;
            showDiff: boolean;
            highlightChanges: boolean;
        };
        dashboard: {
            enabled: boolean;
            port: number;
            host: string;
            updateInterval: number;
            showMetrics: boolean;
            showLogs: boolean;
            maxLogEntries: number;
        };
    };
    runtime: {
        enabled: boolean;
        checkInterval: number;
        resourceThresholds: {
            memory: number;
            cpu: number;
            fileHandles: number;
            diskSpace: number;
        };
        autoCorrection: {
            enabled: boolean;
            maxAttempts: number;
            fallbackToDefaults: boolean;
        };
    };
    watcher: {
        followSymlinks: boolean;
        enabled: boolean;
        validateOnChange: boolean;
        debounceMs: number;
        ignoreInitial: boolean;
        backupOnChange: boolean;
        maxBackups: number;
        watchPatterns: string[];
        ignorePatterns: string[];
    };
    safeUpdates: {
        enabled: boolean;
        createBackup: boolean;
        maxBackups: number;
        validateBeforeWrite: boolean;
        atomicWrite: boolean;
        verifyAfterWrite: boolean;
        rollbackOnFailure: boolean;
        retryAttempts: number;
        retryDelay: number;
        backupDirectory?: string | undefined;
    };
    logLevel?: "error" | "info" | "debug" | "trace" | "warn" | "fatal" | undefined;
    logFile?: string | undefined;
    logFormat?: "human" | "json" | "csv" | undefined;
    maxFiles?: number | undefined;
    includeFileTypes?: ("HTML" | "JAVASCRIPT" | "CSS" | "TEMPLATE")[] | undefined;
    htmlExtractor?: {
        timeout: number;
        preserveWhitespace: boolean;
        caseSensitive: boolean;
        ignoreEmpty: boolean;
        maxFileSize: number;
    } | undefined;
    jsExtractor?: {
        timeout: number;
        caseSensitive: boolean;
        ignoreEmpty: boolean;
        maxFileSize: number;
        enableFrameworkDetection: boolean;
        includeDynamicClasses: boolean;
        supportedFrameworks: string[];
    } | undefined;
    cssInjector?: {
        timeout: number;
        maxFileSize: number;
        cssPath: string;
        htmlPath: string;
        useRelativePaths: boolean;
        linkAttributes: {
            type: string;
            rel: string;
            media?: string | undefined;
        };
        insertPosition: "first" | "last" | "before-existing" | "after-meta";
        preserveFormatting: boolean;
        preventDuplicates: boolean;
        duplicateStrategy: "error" | "skip" | "replace";
        createHeadIfMissing: boolean;
        createBackup: boolean;
        basePath?: string | undefined;
    } | undefined;
    fileIntegrity?: {
        enableProgressTracking: boolean;
        timeout: number;
        algorithm: "md5" | "sha1" | "sha256" | "sha512";
        maxFileSize: number;
        createBackups: boolean;
        backupDirectory: string;
        backupRetentionDays: number;
        verifyAfterRollback: boolean;
        batchSize: number;
        enableCaching: boolean;
        cacheSize: number;
        enableCompression: boolean;
        compressionAlgorithm: "gzip" | "deflate" | "brotli";
        compressionLevel: number;
        compressionThreshold: number;
        enableDeduplication: boolean;
        deduplicationDirectory: string;
        deduplicationAlgorithm: "md5" | "sha1" | "sha256" | "sha512";
        deduplicationThreshold: number;
        useHardLinks: boolean;
        enableIncrementalBackup: boolean;
        backupStrategy: "full" | "incremental" | "auto";
        changeDetectionMethod: "mtime" | "checksum" | "hybrid";
        maxIncrementalChain: number;
        fullBackupInterval: number;
        incrementalDirectory: string;
        enableDifferentialBackup: boolean;
        differentialStrategy: "auto" | "manual" | "threshold-based";
        differentialFullBackupThreshold: number;
        differentialFullBackupInterval: number;
        differentialDirectory: string;
        differentialSizeMultiplier: number;
        enableBatchProcessing: boolean;
        minBatchSize: number;
        maxBatchSize: number;
        dynamicBatchSizing: boolean;
        memoryThreshold: number;
        cpuThreshold: number;
        eventLoopLagThreshold: number;
        batchProcessingStrategy: "sequential" | "parallel" | "adaptive";
        progressUpdateInterval: number;
    } | undefined;
    patternValidator?: {
        enableValidation: boolean;
        skipInvalidClasses: boolean;
        warnOnInvalidClasses: boolean;
        customClasses: string[];
    } | undefined;
}, {
    validation?: {
        enabled?: boolean | undefined;
        validateOnLoad?: boolean | undefined;
        validateOnChange?: boolean | undefined;
        strictMode?: boolean | undefined;
        warnOnDeprecated?: boolean | undefined;
        failOnInvalid?: boolean | undefined;
        crossFieldValidation?: boolean | undefined;
        securityValidation?: boolean | undefined;
        performanceValidation?: boolean | undefined;
        customRules?: string[] | undefined;
    } | undefined;
    verbose?: boolean | undefined;
    veryVerbose?: boolean | undefined;
    quiet?: boolean | undefined;
    pretty?: boolean | undefined;
    input?: string | undefined;
    output?: string | {
        format?: string | undefined;
        filename?: string | undefined;
        preserveOriginal?: boolean | undefined;
    } | undefined;
    minify?: boolean | undefined;
    removeUnused?: boolean | undefined;
    debug?: boolean | undefined;
    logLevel?: "error" | "info" | "debug" | "trace" | "warn" | "fatal" | undefined;
    logFile?: string | undefined;
    logFormat?: "human" | "json" | "csv" | undefined;
    maxConcurrency?: number | undefined;
    classPrefix?: string | undefined;
    excludePatterns?: string[] | undefined;
    followSymlinks?: boolean | undefined;
    maxFiles?: number | undefined;
    includeFileTypes?: ("HTML" | "JAVASCRIPT" | "CSS" | "TEMPLATE")[] | undefined;
    excludeExtensions?: string[] | undefined;
    preserveComments?: boolean | undefined;
    sourceMaps?: boolean | undefined;
    dev?: {
        enabled?: boolean | undefined;
        watch?: boolean | undefined;
        server?: {
            open?: boolean | undefined;
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
        } | undefined;
        diagnostics?: {
            memory?: boolean | undefined;
            enabled?: boolean | undefined;
            performance?: boolean | undefined;
            fileWatcher?: boolean | undefined;
            classAnalysis?: boolean | undefined;
            thresholds?: {
                memoryWarning?: number | undefined;
                memoryError?: number | undefined;
                cpuWarning?: number | undefined;
                cpuError?: number | undefined;
            } | undefined;
        } | undefined;
        preview?: {
            enabled?: boolean | undefined;
            autoRefresh?: boolean | undefined;
            showDiff?: boolean | undefined;
            highlightChanges?: boolean | undefined;
        } | undefined;
        dashboard?: {
            enabled?: boolean | undefined;
            port?: number | undefined;
            host?: string | undefined;
            updateInterval?: number | undefined;
            showMetrics?: boolean | undefined;
            showLogs?: boolean | undefined;
            maxLogEntries?: number | undefined;
        } | undefined;
    } | undefined;
    htmlExtractor?: {
        timeout?: number | undefined;
        preserveWhitespace?: boolean | undefined;
        caseSensitive?: boolean | undefined;
        ignoreEmpty?: boolean | undefined;
        maxFileSize?: number | undefined;
    } | undefined;
    jsExtractor?: {
        timeout?: number | undefined;
        caseSensitive?: boolean | undefined;
        ignoreEmpty?: boolean | undefined;
        maxFileSize?: number | undefined;
        enableFrameworkDetection?: boolean | undefined;
        includeDynamicClasses?: boolean | undefined;
        supportedFrameworks?: string[] | undefined;
    } | undefined;
    cssInjector?: {
        cssPath: string;
        htmlPath: string;
        timeout?: number | undefined;
        maxFileSize?: number | undefined;
        basePath?: string | undefined;
        useRelativePaths?: boolean | undefined;
        linkAttributes?: {
            type?: string | undefined;
            rel?: string | undefined;
            media?: string | undefined;
        } | undefined;
        insertPosition?: "first" | "last" | "before-existing" | "after-meta" | undefined;
        preserveFormatting?: boolean | undefined;
        preventDuplicates?: boolean | undefined;
        duplicateStrategy?: "error" | "skip" | "replace" | undefined;
        createHeadIfMissing?: boolean | undefined;
        createBackup?: boolean | undefined;
    } | undefined;
    fileIntegrity?: {
        enableProgressTracking?: boolean | undefined;
        timeout?: number | undefined;
        algorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
        maxFileSize?: number | undefined;
        createBackups?: boolean | undefined;
        backupDirectory?: string | undefined;
        backupRetentionDays?: number | undefined;
        verifyAfterRollback?: boolean | undefined;
        batchSize?: number | undefined;
        enableCaching?: boolean | undefined;
        cacheSize?: number | undefined;
        enableCompression?: boolean | undefined;
        compressionAlgorithm?: "gzip" | "deflate" | "brotli" | undefined;
        compressionLevel?: number | undefined;
        compressionThreshold?: number | undefined;
        enableDeduplication?: boolean | undefined;
        deduplicationDirectory?: string | undefined;
        deduplicationAlgorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
        deduplicationThreshold?: number | undefined;
        useHardLinks?: boolean | undefined;
        enableIncrementalBackup?: boolean | undefined;
        backupStrategy?: "full" | "incremental" | "auto" | undefined;
        changeDetectionMethod?: "mtime" | "checksum" | "hybrid" | undefined;
        maxIncrementalChain?: number | undefined;
        fullBackupInterval?: number | undefined;
        incrementalDirectory?: string | undefined;
        enableDifferentialBackup?: boolean | undefined;
        differentialStrategy?: "auto" | "manual" | "threshold-based" | undefined;
        differentialFullBackupThreshold?: number | undefined;
        differentialFullBackupInterval?: number | undefined;
        differentialDirectory?: string | undefined;
        differentialSizeMultiplier?: number | undefined;
        enableBatchProcessing?: boolean | undefined;
        minBatchSize?: number | undefined;
        maxBatchSize?: number | undefined;
        dynamicBatchSizing?: boolean | undefined;
        memoryThreshold?: number | undefined;
        cpuThreshold?: number | undefined;
        eventLoopLagThreshold?: number | undefined;
        batchProcessingStrategy?: "sequential" | "parallel" | "adaptive" | undefined;
        progressUpdateInterval?: number | undefined;
    } | undefined;
    patternValidator?: {
        enableValidation?: boolean | undefined;
        skipInvalidClasses?: boolean | undefined;
        warnOnInvalidClasses?: boolean | undefined;
        customClasses?: string[] | undefined;
    } | undefined;
    runtime?: {
        enabled?: boolean | undefined;
        checkInterval?: number | undefined;
        resourceThresholds?: {
            memory?: number | undefined;
            cpu?: number | undefined;
            fileHandles?: number | undefined;
            diskSpace?: number | undefined;
        } | undefined;
        autoCorrection?: {
            enabled?: boolean | undefined;
            maxAttempts?: number | undefined;
            fallbackToDefaults?: boolean | undefined;
        } | undefined;
    } | undefined;
    watcher?: {
        followSymlinks?: boolean | undefined;
        enabled?: boolean | undefined;
        validateOnChange?: boolean | undefined;
        debounceMs?: number | undefined;
        ignoreInitial?: boolean | undefined;
        backupOnChange?: boolean | undefined;
        maxBackups?: number | undefined;
        watchPatterns?: string[] | undefined;
        ignorePatterns?: string[] | undefined;
    } | undefined;
    safeUpdates?: {
        enabled?: boolean | undefined;
        createBackup?: boolean | undefined;
        backupDirectory?: string | undefined;
        maxBackups?: number | undefined;
        validateBeforeWrite?: boolean | undefined;
        atomicWrite?: boolean | undefined;
        verifyAfterWrite?: boolean | undefined;
        rollbackOnFailure?: boolean | undefined;
        retryAttempts?: number | undefined;
        retryDelay?: number | undefined;
    } | undefined;
}>;
/**
 * Inferred TypeScript type from the Zod schema
 */
type EnigmaConfig = z.infer<typeof EnigmaConfigSchema>;
/**
 * CLI arguments interface for type safety
 */
interface CliArguments {
    pretty?: boolean;
    config?: string;
    verbose?: boolean;
    veryVerbose?: boolean;
    quiet?: boolean;
    debug?: boolean;
    logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
    logFile?: string;
    logFormat?: 'human' | 'json' | 'csv';
    input?: string;
    output?: string;
    minify?: boolean;
    removeUnused?: boolean;
    maxConcurrency?: number;
    classPrefix?: string;
    excludePatterns?: string[];
    followSymlinks?: boolean;
    maxFiles?: number;
    includeFileTypes?: ('HTML' | 'JAVASCRIPT' | 'CSS' | 'TEMPLATE')[];
    excludeExtensions?: string[];
    preserveComments?: boolean;
    sourceMaps?: boolean;
    htmlCaseSensitive?: boolean;
    htmlIgnoreEmpty?: boolean;
    htmlMaxFileSize?: number;
    htmlTimeout?: number;
    htmlPreserveWhitespace?: boolean;
    jsEnableFrameworkDetection?: boolean;
    jsIncludeDynamicClasses?: boolean;
    jsCaseSensitive?: boolean;
    jsIgnoreEmpty?: boolean;
    jsMaxFileSize?: number;
    jsTimeout?: number;
    jsSupportedFrameworks?: string[];
    cssPath?: string;
    htmlPath?: string;
    cssUseRelativePaths?: boolean;
    cssPreventDuplicates?: boolean;
    cssInsertPosition?: 'first' | 'last' | 'before-existing' | 'after-meta';
    cssCreateBackup?: boolean;
    cssMaxFileSize?: number;
    cssTimeout?: number;
    integrityAlgorithm?: 'md5' | 'sha1' | 'sha256' | 'sha512';
    integrityCreateBackups?: boolean;
    integrityBackupDirectory?: string;
    integrityBackupRetentionDays?: number;
    integrityMaxFileSize?: number;
    integrityTimeout?: number;
    integrityVerifyAfterRollback?: boolean;
    integrityBatchSize?: number;
    integrityEnableCaching?: boolean;
    integrityCacheSize?: number;
    integrityEnableCompression?: boolean;
    integrityCompressionAlgorithm?: 'gzip' | 'deflate' | 'brotli';
    integrityCompressionLevel?: number;
    integrityCompressionThreshold?: number;
    integrityEnableDeduplication?: boolean;
    integrityDeduplicationDirectory?: string;
    integrityDeduplicationAlgorithm?: 'md5' | 'sha1' | 'sha256' | 'sha512';
    integrityDeduplicationThreshold?: number;
    integrityUseHardLinks?: boolean;
    integrityEnableIncrementalBackup?: boolean;
    integrityBackupStrategy?: 'full' | 'incremental' | 'auto';
    integrityChangeDetectionMethod?: 'mtime' | 'checksum' | 'hybrid';
    integrityMaxIncrementalChain?: number;
    integrityFullBackupInterval?: number;
    integrityIncrementalDirectory?: string;
    integrityEnableDifferentialBackup?: boolean;
    integrityDifferentialStrategy?: 'auto' | 'manual' | 'threshold-based';
    integrityDifferentialFullBackupThreshold?: number;
    integrityDifferentialFullBackupInterval?: number;
    integrityDifferentialDirectory?: string;
    integrityDifferentialSizeMultiplier?: number;
    integrityEnableBatchProcessing?: boolean;
    integrityMinBatchSize?: number;
    integrityMaxBatchSize?: number;
    integrityDynamicBatchSizing?: boolean;
    integrityMemoryThreshold?: number;
    integrityCpuThreshold?: number;
    integrityEventLoopLagThreshold?: number;
    integrityBatchProcessingStrategy?: 'sequential' | 'parallel' | 'adaptive';
    integrityEnableProgressTracking?: boolean;
    integrityProgressUpdateInterval?: number;
    patternValidatorEnable?: boolean;
    patternValidatorSkipInvalid?: boolean;
    patternValidatorWarnOnInvalid?: boolean;
    patternValidatorCustomClasses?: string[];
    dryRun?: boolean;
    dev?: boolean;
    devWatch?: boolean;
    devServer?: boolean;
    devServerPort?: number;
    devServerHost?: string;
    devServerOpen?: boolean;
    devDiagnostics?: boolean;
    devDiagnosticsPerformance?: boolean;
    devDiagnosticsMemory?: boolean;
    devDiagnosticsFileWatcher?: boolean;
    devDiagnosticsClassAnalysis?: boolean;
    devPreview?: boolean;
    devPreviewAutoRefresh?: boolean;
    devPreviewShowDiff?: boolean;
    devPreviewHighlightChanges?: boolean;
    devDashboard?: boolean;
    devDashboardUpdateInterval?: number;
    devDashboardShowMetrics?: boolean;
    devDashboardShowLogs?: boolean;
    devDashboardMaxLogEntries?: number;
}
/**
 * Configuration loading result
 */
interface ConfigResult {
    config: EnigmaConfig;
    filepath?: string;
    isEmpty?: boolean;
    validation?: ValidationResult$2;
    runtimeValidator?: RuntimeValidator;
    watcher?: ConfigWatcher;
    safeUpdater?: ConfigSafeUpdater;
}
/**
 * Load configuration asynchronously with CLI args support
 */
declare function loadConfig(cliArgs?: CliArguments, searchFrom?: string): Promise<ConfigResult>;
/**
 * Load configuration synchronously with CLI args support
 */
declare function loadConfigSync(cliArgs?: CliArguments, searchFrom?: string): ConfigResult;
/**
 * Get configuration with sensible defaults for common use cases
 */
declare function getConfig(cliArgs?: CliArguments): Promise<EnigmaConfig>;
/**
 * Get configuration synchronously with sensible defaults
 */
declare function getConfigSync(cliArgs?: CliArguments): EnigmaConfig;
/**
 * Create a sample configuration file content for users
 */
declare function createSampleConfig(): string;

/**
 * Configuration version schema
 */
declare const ConfigVersionSchema: z.ZodObject<{
    version: z.ZodString;
    schemaVersion: z.ZodNumber;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
    migratedFrom: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    version: string;
    createdAt: string;
    schemaVersion: number;
    updatedAt: string;
    migratedFrom?: string | undefined;
}, {
    version: string;
    createdAt: string;
    schemaVersion: number;
    updatedAt: string;
    migratedFrom?: string | undefined;
}>;
type ConfigVersion = z.infer<typeof ConfigVersionSchema>;
/**
 * Migration script interface
 */
interface MigrationScript {
    fromVersion: string;
    toVersion: string;
    schemaVersion: number;
    description: string;
    migrate: (config: any) => Promise<any>;
    rollback?: (config: any) => Promise<any>;
    validate?: (config: any) => boolean;
}
/**
 * Migration result
 */
interface MigrationResult {
    success: boolean;
    fromVersion: string;
    toVersion: string;
    migrationsApplied: string[];
    warnings: string[];
    errors: string[];
    backupPath?: string;
}
/**
 * Migration options
 */
interface MigrationOptions {
    autoMigrate?: boolean;
    createBackup?: boolean;
    dryRun?: boolean;
    force?: boolean;
    targetVersion?: string;
}
/**
 * Current configuration schema version
 */
declare const CURRENT_SCHEMA_VERSION = 3;
declare const CURRENT_CONFIG_VERSION = "1.0.0";
/**
 * Configuration migration manager
 */
declare class ConfigMigration {
    private migrations;
    private configPath;
    private backupDir;
    constructor(configPath: string, backupDir?: string);
    /**
     * Initialize built-in migration scripts
     */
    private initializeMigrations;
    /**
     * Add a migration script
     */
    addMigration(migration: MigrationScript): void;
    /**
     * Detect configuration version
     */
    detectVersion(config: any): ConfigVersion;
    /**
     * Infer version from configuration structure
     */
    private inferVersionFromStructure;
    /**
     * Get schema version for configuration version
     */
    private getSchemaVersionForConfigVersion;
    /**
     * Check if migration is needed
     */
    needsMigration(config: any): boolean;
    /**
     * Get migration path from current version to target version
     */
    getMigrationPath(fromVersion: string, toVersion?: string): MigrationScript[];
    /**
     * Migrate configuration
     */
    migrate(options?: MigrationOptions): Promise<MigrationResult>;
    /**
     * Create configuration backup
     */
    private createBackup;
    /**
     * Restore configuration from backup
     */
    restoreFromBackup(backupPath: string): Promise<boolean>;
    /**
     * List available backups
     */
    listBackups(): Array<{
        path: string;
        version: string;
        createdAt: string;
        size: number;
    }>;
    /**
     * Get deprecation warnings for current configuration
     */
    getDeprecationWarnings(config: any): string[];
    /**
     * Get upgrade suggestions
     */
    getUpgradeSuggestions(config: any): string[];
    /**
     * Create migration from current configuration
     */
    createMigrationFromCurrent(toVersion: string, description: string, migrationFn: (config: any) => Promise<any>): Promise<void>;
}
/**
 * Create configuration migration manager
 */
declare function createConfigMigration(configPath: string, backupDir?: string): ConfigMigration;
/**
 * Quick migration utility
 */
declare function migrateConfig(configPath: string, options?: MigrationOptions): Promise<MigrationResult>;
/**
 * Check if configuration needs migration
 */
declare function needsConfigMigration(configPath: string): boolean;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

interface CssOutputCliArguments extends CliArguments {
    preset?: 'cdn' | 'serverless' | 'spa' | 'ssr';
    environment?: 'development' | 'production' | 'test';
    strategy?: OutputStrategy;
    compress?: boolean | CompressionType;
    'critical-css'?: boolean;
    'asset-hash'?: boolean;
    'hash-length'?: number;
    'performance-budget'?: string | number;
    'max-critical-css'?: string | number;
    'max-chunk-size'?: string | number;
    'max-chunks'?: string | number;
    'max-total-size'?: string | number;
    'max-load-time'?: string | number;
}
/**
 * CSS output strategies for different production needs
 */
type OutputStrategy = 'single' | 'chunked' | 'modular';
/**
 * Compression types available for CSS assets
 */
type CompressionType = 'none' | 'gzip' | 'brotli' | 'auto';
/**
 * Asset hash algorithms for fingerprinting
 */
type HashAlgorithm = 'md5' | 'sha1' | 'sha256' | 'xxhash';
/**
 * Main CSS output configuration schema
 */
declare const CssOutputConfigSchema: z.ZodObject<{
    /** Output strategy to use */
    strategy: z.ZodEnum<["single", "chunked", "modular"]>;
    /** Enable output optimization */
    enabled: z.ZodDefault<z.ZodBoolean>;
    /** Environment-specific settings */
    environment: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
    /** Chunking configuration */
    chunking: z.ZodObject<{
        /** Chunking strategy to use */
        strategy: z.ZodDefault<z.ZodEnum<["size", "usage", "route", "component", "hybrid"]>>;
        /** Maximum size per chunk in bytes */
        maxSize: z.ZodDefault<z.ZodNumber>;
        /** Minimum size per chunk in bytes */
        minSize: z.ZodDefault<z.ZodNumber>;
        /** Minimum chunk size in bytes (alias for minSize) */
        minChunkSize: z.ZodOptional<z.ZodNumber>;
        /** Maximum chunk size in bytes (alias for maxSize) */
        maxChunkSize: z.ZodOptional<z.ZodNumber>;
        /** Maximum number of chunks to create */
        maxChunks: z.ZodDefault<z.ZodNumber>;
        /** Target number of chunks to create */
        targetChunks: z.ZodOptional<z.ZodNumber>;
        /** Threshold for usage-based chunking (0-1) */
        usageThreshold: z.ZodDefault<z.ZodNumber>;
        /** Enable dynamic imports for chunks */
        dynamicImports: z.ZodDefault<z.ZodBoolean>;
        /** Include vendor CSS in separate chunk */
        separateVendor: z.ZodDefault<z.ZodBoolean>;
        /** Include critical CSS in main chunk */
        inlineCritical: z.ZodDefault<z.ZodBoolean>;
        /** Routes for route-based chunking */
        routes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        strategy: "component" | "size" | "hybrid" | "usage" | "route";
        maxSize: number;
        minSize: number;
        maxChunks: number;
        usageThreshold: number;
        dynamicImports: boolean;
        separateVendor: boolean;
        inlineCritical: boolean;
        minChunkSize?: number | undefined;
        maxChunkSize?: number | undefined;
        targetChunks?: number | undefined;
        routes?: string[] | undefined;
    }, {
        strategy?: "component" | "size" | "hybrid" | "usage" | "route" | undefined;
        maxSize?: number | undefined;
        minSize?: number | undefined;
        minChunkSize?: number | undefined;
        maxChunkSize?: number | undefined;
        maxChunks?: number | undefined;
        targetChunks?: number | undefined;
        usageThreshold?: number | undefined;
        dynamicImports?: boolean | undefined;
        separateVendor?: boolean | undefined;
        inlineCritical?: boolean | undefined;
        routes?: string[] | undefined;
    }>;
    /** Optimization configuration */
    optimization: z.ZodObject<{
        /** Enable CSS minification */
        minify: z.ZodDefault<z.ZodBoolean>;
        /** Remove unused CSS rules */
        purge: z.ZodDefault<z.ZodBoolean>;
        /** Enable CSS autoprefixer */
        autoprefix: z.ZodDefault<z.ZodBoolean>;
        /** Merge duplicate selectors */
        mergeDuplicates: z.ZodDefault<z.ZodBoolean>;
        /** Remove comments from output */
        removeComments: z.ZodDefault<z.ZodBoolean>;
        /** Optimize calc() expressions */
        optimizeCalc: z.ZodDefault<z.ZodBoolean>;
        /** Merge media queries */
        mergeMedia: z.ZodDefault<z.ZodBoolean>;
        /** Convert colors to shortest form */
        normalizeColors: z.ZodDefault<z.ZodBoolean>;
        /** Remove empty rules and blocks */
        removeEmpty: z.ZodDefault<z.ZodBoolean>;
        /** Optimize font declarations */
        optimizeFonts: z.ZodDefault<z.ZodBoolean>;
        /** Generate source maps */
        sourceMap: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        minify: boolean;
        mergeDuplicates: boolean;
        purge: boolean;
        autoprefix: boolean;
        removeComments: boolean;
        optimizeCalc: boolean;
        mergeMedia: boolean;
        normalizeColors: boolean;
        removeEmpty: boolean;
        optimizeFonts: boolean;
        sourceMap: boolean;
    }, {
        minify?: boolean | undefined;
        mergeDuplicates?: boolean | undefined;
        purge?: boolean | undefined;
        autoprefix?: boolean | undefined;
        removeComments?: boolean | undefined;
        optimizeCalc?: boolean | undefined;
        mergeMedia?: boolean | undefined;
        normalizeColors?: boolean | undefined;
        removeEmpty?: boolean | undefined;
        optimizeFonts?: boolean | undefined;
        sourceMap?: boolean | undefined;
    }>;
    /** Compression configuration */
    compression: z.ZodObject<{
        /** Compression type to use */
        type: z.ZodDefault<z.ZodEnum<["none", "gzip", "brotli", "auto"]>>;
        /** Compression level (1-9 for gzip, 1-11 for brotli) */
        level: z.ZodDefault<z.ZodNumber>;
        /** Minimum file size to compress (bytes) */
        threshold: z.ZodDefault<z.ZodNumber>;
        /** Include original uncompressed files */
        includeOriginal: z.ZodDefault<z.ZodBoolean>;
        /** Generate compression reports */
        generateReports: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        type: "gzip" | "brotli" | "auto" | "none";
        level: number;
        threshold: number;
        includeOriginal: boolean;
        generateReports: boolean;
    }, {
        type?: "gzip" | "brotli" | "auto" | "none" | undefined;
        level?: number | undefined;
        threshold?: number | undefined;
        includeOriginal?: boolean | undefined;
        generateReports?: boolean | undefined;
    }>;
    /** Asset hashing configuration */
    hashing: z.ZodObject<{
        /** Hash algorithm to use */
        algorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "xxhash"]>>;
        /** Hash length for filenames */
        length: z.ZodDefault<z.ZodNumber>;
        /** Include file content in hash calculation */
        includeContent: z.ZodDefault<z.ZodBoolean>;
        /** Include metadata in hash calculation */
        includeMetadata: z.ZodDefault<z.ZodBoolean>;
        /** Generate integrity hashes for subresource integrity */
        generateIntegrity: z.ZodDefault<z.ZodBoolean>;
        /** Algorithm for integrity hashes */
        integrityAlgorithm: z.ZodDefault<z.ZodEnum<["sha256", "sha384", "sha512"]>>;
    }, "strip", z.ZodTypeAny, {
        length: number;
        algorithm: "md5" | "sha1" | "sha256" | "xxhash";
        includeMetadata: boolean;
        includeContent: boolean;
        generateIntegrity: boolean;
        integrityAlgorithm: "sha256" | "sha512" | "sha384";
    }, {
        length?: number | undefined;
        algorithm?: "md5" | "sha1" | "sha256" | "xxhash" | undefined;
        includeMetadata?: boolean | undefined;
        includeContent?: boolean | undefined;
        generateIntegrity?: boolean | undefined;
        integrityAlgorithm?: "sha256" | "sha512" | "sha384" | undefined;
    }>;
    /** Critical CSS configuration */
    critical: z.ZodObject<{
        /** Critical CSS extraction strategy */
        strategy: z.ZodDefault<z.ZodEnum<["none", "inline", "preload", "async"]>>;
        /** Enable critical CSS extraction */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Maximum critical CSS size in bytes */
        maxSize: z.ZodDefault<z.ZodNumber>;
        /** Viewport dimensions for critical CSS calculation */
        viewport: z.ZodDefault<z.ZodObject<{
            width: z.ZodDefault<z.ZodNumber>;
            height: z.ZodDefault<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            width: number;
            height: number;
        }, {
            width?: number | undefined;
            height?: number | undefined;
        }>>;
        /** Include font-face declarations in critical CSS */
        includeFonts: z.ZodDefault<z.ZodBoolean>;
        /** Include media queries in critical CSS */
        includeMedia: z.ZodDefault<z.ZodBoolean>;
        /** Ignore certain selectors from critical extraction */
        ignore: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Force include certain selectors in critical CSS */
        forceInclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Routes to analyze for critical CSS */
        routes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Components to include in critical CSS */
        components: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Inline threshold in bytes */
        inlineThreshold: z.ZodDefault<z.ZodNumber>;
        /** Critical CSS extraction method */
        extractionMethod: z.ZodDefault<z.ZodEnum<["automatic", "manual"]>>;
        /** Viewport dimensions for critical CSS analysis */
        viewports: z.ZodDefault<z.ZodArray<z.ZodObject<{
            width: z.ZodNumber;
            height: z.ZodNumber;
        }, "strip", z.ZodTypeAny, {
            width: number;
            height: number;
        }, {
            width: number;
            height: number;
        }>, "many">>;
        /** Timeout for critical CSS extraction in milliseconds */
        timeout: z.ZodDefault<z.ZodNumber>;
        /** Enable fallback behavior for failed extraction */
        fallback: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        timeout: number;
        enabled: boolean;
        strategy: "inline" | "none" | "preload" | "async";
        fallback: boolean;
        maxSize: number;
        routes: string[];
        viewport: {
            width: number;
            height: number;
        };
        includeFonts: boolean;
        includeMedia: boolean;
        ignore: string[];
        forceInclude: string[];
        components: string[];
        inlineThreshold: number;
        extractionMethod: "manual" | "automatic";
        viewports: {
            width: number;
            height: number;
        }[];
    }, {
        timeout?: number | undefined;
        enabled?: boolean | undefined;
        strategy?: "inline" | "none" | "preload" | "async" | undefined;
        fallback?: boolean | undefined;
        maxSize?: number | undefined;
        routes?: string[] | undefined;
        viewport?: {
            width?: number | undefined;
            height?: number | undefined;
        } | undefined;
        includeFonts?: boolean | undefined;
        includeMedia?: boolean | undefined;
        ignore?: string[] | undefined;
        forceInclude?: string[] | undefined;
        components?: string[] | undefined;
        inlineThreshold?: number | undefined;
        extractionMethod?: "manual" | "automatic" | undefined;
        viewports?: {
            width: number;
            height: number;
        }[] | undefined;
    }>;
    /** Delivery optimization configuration */
    delivery: z.ZodObject<{
        /** Delivery method for CSS assets */
        method: z.ZodDefault<z.ZodEnum<["standard", "preload", "prefetch", "async", "defer"]>>;
        /** Priority for resource loading */
        priority: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
        /** Cross-origin resource sharing settings */
        crossorigin: z.ZodDefault<z.ZodEnum<["anonymous", "use-credentials"]>>;
        /** Enable integrity checks for resources */
        integrity: z.ZodDefault<z.ZodBoolean>;
        /** Cache configuration */
        cache: z.ZodDefault<z.ZodObject<{
            strategy: z.ZodDefault<z.ZodEnum<["no-cache", "immutable", "revalidate"]>>;
            maxAge: z.ZodDefault<z.ZodNumber>;
            staleWhileRevalidate: z.ZodDefault<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            strategy: "no-cache" | "immutable" | "revalidate";
            maxAge: number;
            staleWhileRevalidate: number;
        }, {
            strategy?: "no-cache" | "immutable" | "revalidate" | undefined;
            maxAge?: number | undefined;
            staleWhileRevalidate?: number | undefined;
        }>>;
        /** Resource hints configuration */
        resourceHints: z.ZodDefault<z.ZodObject<{
            preload: z.ZodDefault<z.ZodBoolean>;
            prefetch: z.ZodDefault<z.ZodBoolean>;
            preconnect: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            preload: boolean;
            prefetch: boolean;
            preconnect: boolean;
        }, {
            preload?: boolean | undefined;
            prefetch?: boolean | undefined;
            preconnect?: boolean | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        method: "preload" | "async" | "standard" | "prefetch" | "defer";
        priority: "low" | "medium" | "high";
        crossorigin: "anonymous" | "use-credentials";
        integrity: boolean;
        cache: {
            strategy: "no-cache" | "immutable" | "revalidate";
            maxAge: number;
            staleWhileRevalidate: number;
        };
        resourceHints: {
            preload: boolean;
            prefetch: boolean;
            preconnect: boolean;
        };
    }, {
        method?: "preload" | "async" | "standard" | "prefetch" | "defer" | undefined;
        priority?: "low" | "medium" | "high" | undefined;
        crossorigin?: "anonymous" | "use-credentials" | undefined;
        integrity?: boolean | undefined;
        cache?: {
            strategy?: "no-cache" | "immutable" | "revalidate" | undefined;
            maxAge?: number | undefined;
            staleWhileRevalidate?: number | undefined;
        } | undefined;
        resourceHints?: {
            preload?: boolean | undefined;
            prefetch?: boolean | undefined;
            preconnect?: boolean | undefined;
        } | undefined;
    }>;
    /** Output paths configuration */
    paths: z.ZodObject<{
        /** Base directory for CSS output */
        base: z.ZodDefault<z.ZodString>;
        /** CSS output directory (alias for base) */
        css: z.ZodOptional<z.ZodString>;
        /** Directory for chunked CSS files */
        chunks: z.ZodDefault<z.ZodString>;
        /** Directory for critical CSS files */
        critical: z.ZodDefault<z.ZodString>;
        /** Directory for compressed assets */
        compressed: z.ZodDefault<z.ZodString>;
        /** Asset manifest filename */
        manifest: z.ZodDefault<z.ZodString>;
        /** Reports directory */
        reports: z.ZodDefault<z.ZodString>;
        /** Source maps directory */
        sourceMaps: z.ZodDefault<z.ZodString>;
        /** Public URL base path */
        publicPath: z.ZodDefault<z.ZodString>;
        /** Enable hash-based filenames */
        useHashes: z.ZodDefault<z.ZodBoolean>;
        /** Hash length for filenames */
        hashLength: z.ZodDefault<z.ZodNumber>;
        /** Hash algorithm to use */
        hashAlgorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "xxhash"]>>;
    }, "strip", z.ZodTypeAny, {
        critical: string;
        sourceMaps: string;
        compressed: string;
        base: string;
        chunks: string;
        manifest: string;
        reports: string;
        publicPath: string;
        useHashes: boolean;
        hashLength: number;
        hashAlgorithm: "md5" | "sha1" | "sha256" | "xxhash";
        css?: string | undefined;
    }, {
        critical?: string | undefined;
        css?: string | undefined;
        sourceMaps?: string | undefined;
        compressed?: string | undefined;
        base?: string | undefined;
        chunks?: string | undefined;
        manifest?: string | undefined;
        reports?: string | undefined;
        publicPath?: string | undefined;
        useHashes?: boolean | undefined;
        hashLength?: number | undefined;
        hashAlgorithm?: "md5" | "sha1" | "sha256" | "xxhash" | undefined;
    }>;
    /** Reporting configuration */
    reporting: z.ZodObject<{
        /** Enable detailed optimization reports */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Include size analysis in reports */
        sizeAnalysis: z.ZodDefault<z.ZodBoolean>;
        /** Include performance metrics */
        performance: z.ZodDefault<z.ZodBoolean>;
        /** Include compression statistics */
        compression: z.ZodDefault<z.ZodBoolean>;
        /** Include critical CSS analysis */
        criticalAnalysis: z.ZodDefault<z.ZodBoolean>;
        /** Generate visual dependency graphs */
        dependencyGraphs: z.ZodDefault<z.ZodBoolean>;
        /** Output format for reports */
        format: z.ZodDefault<z.ZodEnum<["json", "html", "markdown", "all"]>>;
        /** Include detailed per-chunk analysis */
        perChunkAnalysis: z.ZodDefault<z.ZodBoolean>;
        /** Set performance budget thresholds */
        budgets: z.ZodDefault<z.ZodObject<{
            /** Maximum total CSS size (bytes) */
            maxTotalSize: z.ZodOptional<z.ZodNumber>;
            /** Maximum individual chunk size (bytes) */
            maxChunkSize: z.ZodOptional<z.ZodNumber>;
            /** Maximum number of HTTP requests */
            maxRequests: z.ZodOptional<z.ZodNumber>;
            /** Maximum critical CSS size (bytes) */
            maxCriticalSize: z.ZodOptional<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        }, {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        format: "json" | "html" | "all" | "markdown";
        enabled: boolean;
        performance: boolean;
        sizeAnalysis: boolean;
        compression: boolean;
        criticalAnalysis: boolean;
        dependencyGraphs: boolean;
        perChunkAnalysis: boolean;
        budgets: {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        };
    }, {
        format?: "json" | "html" | "all" | "markdown" | undefined;
        enabled?: boolean | undefined;
        performance?: boolean | undefined;
        sizeAnalysis?: boolean | undefined;
        compression?: boolean | undefined;
        criticalAnalysis?: boolean | undefined;
        dependencyGraphs?: boolean | undefined;
        perChunkAnalysis?: boolean | undefined;
        budgets?: {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        } | undefined;
    }>;
    /** Enable source map generation */
    sourceMaps: z.ZodDefault<z.ZodBoolean>;
    /** Enable watch mode for development */
    watch: z.ZodDefault<z.ZodBoolean>;
    /** Enable verbose logging */
    verbose: z.ZodDefault<z.ZodBoolean>;
    /** Custom PostCSS plugins to include */
    plugins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    /** Performance budget configuration */
    performanceBudget: z.ZodOptional<z.ZodObject<{
        /** Maximum bundle size in bytes */
        maxBundleSize: z.ZodNumber;
        /** Maximum critical CSS size in bytes */
        maxCriticalCssSize: z.ZodNumber;
        /** Maximum chunk size in bytes */
        maxChunkSize: z.ZodNumber;
        /** Maximum total CSS size in bytes */
        maxTotalSize: z.ZodNumber;
        /** Maximum number of chunks */
        maxChunks: z.ZodNumber;
        /** Estimated load time in milliseconds */
        estimatedLoadTime: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        maxChunkSize: number;
        maxChunks: number;
        maxTotalSize: number;
        maxBundleSize: number;
        maxCriticalCssSize: number;
        estimatedLoadTime: number;
    }, {
        maxChunkSize: number;
        maxChunks: number;
        maxTotalSize: number;
        maxBundleSize: number;
        maxCriticalCssSize: number;
        estimatedLoadTime: number;
    }>>;
}, "strip", z.ZodTypeAny, {
    verbose: boolean;
    optimization: {
        minify: boolean;
        mergeDuplicates: boolean;
        purge: boolean;
        autoprefix: boolean;
        removeComments: boolean;
        optimizeCalc: boolean;
        mergeMedia: boolean;
        normalizeColors: boolean;
        removeEmpty: boolean;
        optimizeFonts: boolean;
        sourceMap: boolean;
    };
    critical: {
        timeout: number;
        enabled: boolean;
        strategy: "inline" | "none" | "preload" | "async";
        fallback: boolean;
        maxSize: number;
        routes: string[];
        viewport: {
            width: number;
            height: number;
        };
        includeFonts: boolean;
        includeMedia: boolean;
        ignore: string[];
        forceInclude: string[];
        components: string[];
        inlineThreshold: number;
        extractionMethod: "manual" | "automatic";
        viewports: {
            width: number;
            height: number;
        }[];
    };
    sourceMaps: boolean;
    enabled: boolean;
    watch: boolean;
    strategy: "single" | "chunked" | "modular";
    paths: {
        critical: string;
        sourceMaps: string;
        compressed: string;
        base: string;
        chunks: string;
        manifest: string;
        reports: string;
        publicPath: string;
        useHashes: boolean;
        hashLength: number;
        hashAlgorithm: "md5" | "sha1" | "sha256" | "xxhash";
        css?: string | undefined;
    };
    environment: "development" | "production" | "test";
    compression: {
        type: "gzip" | "brotli" | "auto" | "none";
        level: number;
        threshold: number;
        includeOriginal: boolean;
        generateReports: boolean;
    };
    chunking: {
        strategy: "component" | "size" | "hybrid" | "usage" | "route";
        maxSize: number;
        minSize: number;
        maxChunks: number;
        usageThreshold: number;
        dynamicImports: boolean;
        separateVendor: boolean;
        inlineCritical: boolean;
        minChunkSize?: number | undefined;
        maxChunkSize?: number | undefined;
        targetChunks?: number | undefined;
        routes?: string[] | undefined;
    };
    hashing: {
        length: number;
        algorithm: "md5" | "sha1" | "sha256" | "xxhash";
        includeMetadata: boolean;
        includeContent: boolean;
        generateIntegrity: boolean;
        integrityAlgorithm: "sha256" | "sha512" | "sha384";
    };
    delivery: {
        method: "preload" | "async" | "standard" | "prefetch" | "defer";
        priority: "low" | "medium" | "high";
        crossorigin: "anonymous" | "use-credentials";
        integrity: boolean;
        cache: {
            strategy: "no-cache" | "immutable" | "revalidate";
            maxAge: number;
            staleWhileRevalidate: number;
        };
        resourceHints: {
            preload: boolean;
            prefetch: boolean;
            preconnect: boolean;
        };
    };
    reporting: {
        format: "json" | "html" | "all" | "markdown";
        enabled: boolean;
        performance: boolean;
        sizeAnalysis: boolean;
        compression: boolean;
        criticalAnalysis: boolean;
        dependencyGraphs: boolean;
        perChunkAnalysis: boolean;
        budgets: {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        };
    };
    plugins: string[];
    performanceBudget?: {
        maxChunkSize: number;
        maxChunks: number;
        maxTotalSize: number;
        maxBundleSize: number;
        maxCriticalCssSize: number;
        estimatedLoadTime: number;
    } | undefined;
}, {
    optimization: {
        minify?: boolean | undefined;
        mergeDuplicates?: boolean | undefined;
        purge?: boolean | undefined;
        autoprefix?: boolean | undefined;
        removeComments?: boolean | undefined;
        optimizeCalc?: boolean | undefined;
        mergeMedia?: boolean | undefined;
        normalizeColors?: boolean | undefined;
        removeEmpty?: boolean | undefined;
        optimizeFonts?: boolean | undefined;
        sourceMap?: boolean | undefined;
    };
    critical: {
        timeout?: number | undefined;
        enabled?: boolean | undefined;
        strategy?: "inline" | "none" | "preload" | "async" | undefined;
        fallback?: boolean | undefined;
        maxSize?: number | undefined;
        routes?: string[] | undefined;
        viewport?: {
            width?: number | undefined;
            height?: number | undefined;
        } | undefined;
        includeFonts?: boolean | undefined;
        includeMedia?: boolean | undefined;
        ignore?: string[] | undefined;
        forceInclude?: string[] | undefined;
        components?: string[] | undefined;
        inlineThreshold?: number | undefined;
        extractionMethod?: "manual" | "automatic" | undefined;
        viewports?: {
            width: number;
            height: number;
        }[] | undefined;
    };
    strategy: "single" | "chunked" | "modular";
    paths: {
        critical?: string | undefined;
        css?: string | undefined;
        sourceMaps?: string | undefined;
        compressed?: string | undefined;
        base?: string | undefined;
        chunks?: string | undefined;
        manifest?: string | undefined;
        reports?: string | undefined;
        publicPath?: string | undefined;
        useHashes?: boolean | undefined;
        hashLength?: number | undefined;
        hashAlgorithm?: "md5" | "sha1" | "sha256" | "xxhash" | undefined;
    };
    compression: {
        type?: "gzip" | "brotli" | "auto" | "none" | undefined;
        level?: number | undefined;
        threshold?: number | undefined;
        includeOriginal?: boolean | undefined;
        generateReports?: boolean | undefined;
    };
    chunking: {
        strategy?: "component" | "size" | "hybrid" | "usage" | "route" | undefined;
        maxSize?: number | undefined;
        minSize?: number | undefined;
        minChunkSize?: number | undefined;
        maxChunkSize?: number | undefined;
        maxChunks?: number | undefined;
        targetChunks?: number | undefined;
        usageThreshold?: number | undefined;
        dynamicImports?: boolean | undefined;
        separateVendor?: boolean | undefined;
        inlineCritical?: boolean | undefined;
        routes?: string[] | undefined;
    };
    hashing: {
        length?: number | undefined;
        algorithm?: "md5" | "sha1" | "sha256" | "xxhash" | undefined;
        includeMetadata?: boolean | undefined;
        includeContent?: boolean | undefined;
        generateIntegrity?: boolean | undefined;
        integrityAlgorithm?: "sha256" | "sha512" | "sha384" | undefined;
    };
    delivery: {
        method?: "preload" | "async" | "standard" | "prefetch" | "defer" | undefined;
        priority?: "low" | "medium" | "high" | undefined;
        crossorigin?: "anonymous" | "use-credentials" | undefined;
        integrity?: boolean | undefined;
        cache?: {
            strategy?: "no-cache" | "immutable" | "revalidate" | undefined;
            maxAge?: number | undefined;
            staleWhileRevalidate?: number | undefined;
        } | undefined;
        resourceHints?: {
            preload?: boolean | undefined;
            prefetch?: boolean | undefined;
            preconnect?: boolean | undefined;
        } | undefined;
    };
    reporting: {
        format?: "json" | "html" | "all" | "markdown" | undefined;
        enabled?: boolean | undefined;
        performance?: boolean | undefined;
        sizeAnalysis?: boolean | undefined;
        compression?: boolean | undefined;
        criticalAnalysis?: boolean | undefined;
        dependencyGraphs?: boolean | undefined;
        perChunkAnalysis?: boolean | undefined;
        budgets?: {
            maxChunkSize?: number | undefined;
            maxTotalSize?: number | undefined;
            maxRequests?: number | undefined;
            maxCriticalSize?: number | undefined;
        } | undefined;
    };
    verbose?: boolean | undefined;
    sourceMaps?: boolean | undefined;
    enabled?: boolean | undefined;
    watch?: boolean | undefined;
    environment?: "development" | "production" | "test" | undefined;
    plugins?: string[] | undefined;
    performanceBudget?: {
        maxChunkSize: number;
        maxChunks: number;
        maxTotalSize: number;
        maxBundleSize: number;
        maxCriticalCssSize: number;
        estimatedLoadTime: number;
    } | undefined;
}>;
type CssOutputConfig = z.infer<typeof CssOutputConfigSchema>;
/**
 * Performance budget configuration for CSS optimization
 */
type PerformanceBudget = {
    /** Maximum bundle size in bytes */
    maxBundleSize: number;
    /** Maximum critical CSS size in bytes */
    maxCriticalCssSize: number;
    /** Maximum chunk size in bytes */
    maxChunkSize: number;
    /** Maximum total CSS size in bytes */
    maxTotalSize: number;
    /** Maximum number of chunks */
    maxChunks: number;
    /** Estimated load time in milliseconds */
    estimatedLoadTime: number;
};
/**
 * ProductionCssConfigManager
 *
 * Test-facing wrapper for CssOutputConfigManager, providing the interface expected by tests.
 */
declare class ProductionCssConfigManager {
    private manager;
    private performanceBudget?;
    constructor(initialConfig?: Partial<CssOutputConfig>);
    /**
     * Create configuration from CLI arguments (delegated to manager)
     */
    fromCliArgs(args: CssOutputCliArguments): CssOutputConfig;
    /**
     * Get current configuration
     */
    getConfig(): CssOutputConfig;
    /**
     * Apply preset configuration
     */
    applyPreset(preset: 'production' | 'development'): CssOutputConfig;
    /**
     * Set performance budget
     */
    setPerformanceBudget(budget: PerformanceBudget): void;
    /**
     * Get performance budget
     */
    getPerformanceBudget(): PerformanceBudget | undefined;
    /**
     * Apply CLI overrides to configuration
     */
    applyCliOverrides(cliArgs: any): CssOutputConfig;
    /**
     * Create optimized preset configuration
     */
    createOptimizedPreset(preset: string): Partial<CssOutputConfig>;
    /**
     * Update configuration with new settings
     */
    updateConfig(updates: Partial<CssOutputConfig>): CssOutputConfig;
    /**
     * Validate results against performance budgets
     */
    validateAgainstBudgets(budgetResults?: any): {
        passed: boolean;
        errors: string[];
        warnings: string[];
    };
    /**
     * Calculate performance budget from CLI args or config
     */
    calculatePerformanceBudget(args: Record<string, any>): PerformanceBudget;
    /**
     * Generate configuration documentation (string)
     */
    generateConfigDocumentation(): string;
    /**
     * Detect CI environment (returns { isCI: boolean, provider?: string })
     */
    detectCIEnvironment(): {
        isCI: boolean;
        provider?: string;
    };
    /**
     * Create CI-optimized configuration
     */
    createCIConfiguration(args: Partial<CssOutputCliArguments>): CssOutputConfig;
    /**
     * Serialize config to JSON
     */
    serializeConfig(config: CssOutputConfig): string;
    /**
     * Deserialize config from JSON
     */
    deserializeConfig(json: string): CssOutputConfig;
}
/**
 * Create a performance budget from basic parameters
 * Used by CLI to create budget objects
 */
declare function createPerformanceBudget(params: {
    maxTotalSize?: number;
    maxChunks?: number;
    maxBundleSize?: number;
    maxCriticalCssSize?: number;
    maxChunkSize?: number;
    estimatedLoadTime?: number;
}): PerformanceBudget;
/**
 * Create a production configuration manager instance
 * Factory function for CLI usage
 */
declare function createProductionConfigManager(initialConfig?: Partial<CssOutputConfig>, _performanceBudget?: PerformanceBudget): ProductionCssConfigManager;
declare function validateProductionConfig(config: any): {
    isValid: boolean;
    errors: string[];
    warnings: string[];
    suggestions: string[];
};
/**
 * Generate configuration documentation (CLI compatibility export)
 * Creates a ProductionCssConfigManager instance and calls generateConfigDocumentation
 */
declare function generateConfigDocs(): string;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * CSS rule dependency information
 */
interface CssRuleDependency {
    /** The CSS selector or at-rule identifier */
    selector: string;
    /** Dependencies on other selectors/rules */
    dependencies: Set<string>;
    /** Selectors that depend on this rule */
    dependents: Set<string>;
    /** Rule size in bytes */
    size: number;
    /** Usage frequency (0-1) */
    usage: number;
    /** Associated routes/pages */
    routes: Set<string>;
    /** Component associations */
    components: Set<string>;
    /** Rule priority for ordering */
    priority: number;
    /** Source location */
    source?: {
        file: string;
        line: number;
        column: number;
    };
}
/**
 * CSS chunk information
 */
interface CssChunk {
    /** Unique chunk identifier */
    id: string;
    /** Chunk name for output files */
    name: string;
    /** CSS content of the chunk */
    content: string;
    /** Chunk size in bytes */
    size: number;
    /** Rules included in this chunk */
    rules: CssRuleDependency[];
    /** Dependencies on other chunks */
    dependencies: Set<string>;
    /** Associated routes/pages */
    routes: Set<string>;
    /** Associated components */
    components: Set<string>;
    /** Chunk type classification */
    type: 'critical' | 'vendor' | 'component' | 'route' | 'utility' | 'main';
    /** Load priority (higher = more important) */
    priority: number;
    /** Whether this chunk should be loaded async */
    async: boolean;
    /** Loading strategy for this chunk */
    loadingStrategy: 'inline' | 'preload' | 'prefetch' | 'lazy';
    /** Additional metadata for the chunk */
    metadata?: Record<string, unknown>;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Asset hash information
 */
interface AssetHash {
    /** Original filename */
    original: string;
    /** Hashed filename */
    hashed: string;
    /** Hash value */
    hash: string;
    /** Hash algorithm used */
    algorithm: HashAlgorithm;
    /** File size in bytes */
    size: number;
    /** Content MIME type */
    mimeType: string;
    /** Last modified timestamp */
    lastModified: Date;
    /** Integrity hash for SRI */
    integrity?: string;
}
/**
 * Optimization result information
 */
interface OptimizationResult$1 {
    /** Original CSS content */
    original: string;
    /** Optimized CSS content */
    optimized: string;
    /** Optimization statistics */
    stats: {
        /** Original size in bytes */
        originalSize: number;
        /** Optimized size in bytes */
        optimizedSize: number;
        /** Size reduction percentage */
        reduction: number;
        /** Rules removed count */
        rulesRemoved: number;
        /** Declarations optimized count */
        declarationsOptimized: number;
        /** Optimization time in milliseconds */
        optimizationTime: number;
    };
    /** Optimization plugins used */
    plugins: string[];
    /** Source map if generated */
    sourceMap?: string;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

interface ValidationResult$1 {
    isValid: boolean;
    validationType: 'core' | 'custom' | 'unknown';
    className: string;
    warnings?: string[];
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for HTML class extraction
 */
declare const HtmlExtractionOptionsSchema: z.ZodObject<{
    preserveWhitespace: z.ZodDefault<z.ZodBoolean>;
    caseSensitive: z.ZodDefault<z.ZodBoolean>;
    ignoreEmpty: z.ZodDefault<z.ZodBoolean>;
    maxFileSize: z.ZodDefault<z.ZodNumber>;
    timeout: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    timeout: number;
    preserveWhitespace: boolean;
    caseSensitive: boolean;
    ignoreEmpty: boolean;
    maxFileSize: number;
}, {
    timeout?: number | undefined;
    preserveWhitespace?: boolean | undefined;
    caseSensitive?: boolean | undefined;
    ignoreEmpty?: boolean | undefined;
    maxFileSize?: number | undefined;
}>;
type HtmlExtractionOptions = z.infer<typeof HtmlExtractionOptionsSchema>;
/**
 * Data structure for individual class information
 */
interface ClassData {
    name: string;
    frequency: number;
    contexts: Array<{
        tagName: string;
        attributes: Record<string, string>;
        depth: number;
    }>;
}
/**
 * Result of HTML class extraction operation
 */
interface HtmlClassExtractionResult {
    classes: Map<string, ClassData>;
    totalElements: number;
    totalClasses: number;
    uniqueClasses: number;
    metadata: {
        source: string;
        processedAt: Date;
        processingTime: number;
        fileSize?: number;
        errors: string[];
    };
}
/**
 * Custom error classes for HTML parsing operations
 */
declare class HtmlParsingError extends Error {
    source?: string;
    cause?: Error;
    constructor(message: string, source?: string, cause?: Error);
}
declare class FileReadError extends Error {
    filePath?: string;
    cause?: Error;
    constructor(message: string, filePath?: string, cause?: Error);
}
/**
 * Main HTML class extractor class
 */
declare class HtmlExtractor {
    private options;
    constructor(options?: Partial<HtmlExtractionOptions>);
    /**
     * Extract classes from HTML string
     */
    extractFromString(html: string, source?: string): Promise<HtmlClassExtractionResult>;
    /**
     * Extract classes from HTML file
     */
    extractFromFile(filePath: string): Promise<HtmlClassExtractionResult>;
    /**
     * Extract classes from multiple HTML files
     */
    extractFromFiles(filePaths: string[]): Promise<HtmlClassExtractionResult[]>;
    /**
     * Parse class attribute string into individual class names
     */
    private parseClassAttribute;
    /**
     * Calculate the depth of an element in the DOM tree
     */
    private calculateDepth;
    /**
     * Sanitize element attributes to avoid sensitive data exposure
     */
    private sanitizeAttributes;
    /**
     * Read file with timeout protection
     */
    private readFileWithTimeout;
}
/**
 * Convenience function to create extractor with default options
 */
declare function createHtmlExtractor(options?: Partial<HtmlExtractionOptions>): HtmlExtractor;
/**
 * Convenience function to extract from string with default options
 */
declare function extractClassesFromHtml(html: string, options?: Partial<HtmlExtractionOptions>): Promise<HtmlClassExtractionResult>;
/**
 * Convenience function to extract from file with default options
 */
declare function extractClassesFromFile(filePath: string, options?: Partial<HtmlExtractionOptions>): Promise<HtmlClassExtractionResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for JavaScript/JSX class extraction
 */
declare const JsExtractionOptionsSchema: z.ZodObject<{
    enableFrameworkDetection: z.ZodDefault<z.ZodBoolean>;
    includeDynamicClasses: z.ZodDefault<z.ZodBoolean>;
    caseSensitive: z.ZodDefault<z.ZodBoolean>;
    ignoreEmpty: z.ZodDefault<z.ZodBoolean>;
    maxFileSize: z.ZodDefault<z.ZodNumber>;
    timeout: z.ZodDefault<z.ZodNumber>;
    supportedFrameworks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
    timeout: number;
    caseSensitive: boolean;
    ignoreEmpty: boolean;
    maxFileSize: number;
    enableFrameworkDetection: boolean;
    includeDynamicClasses: boolean;
    supportedFrameworks: string[];
}, {
    timeout?: number | undefined;
    caseSensitive?: boolean | undefined;
    ignoreEmpty?: boolean | undefined;
    maxFileSize?: number | undefined;
    enableFrameworkDetection?: boolean | undefined;
    includeDynamicClasses?: boolean | undefined;
    supportedFrameworks?: string[] | undefined;
}>;
type JsExtractionOptions = z.infer<typeof JsExtractionOptionsSchema>;
/**
 * Supported JavaScript/JSX frameworks
 */
type SupportedFramework = 'react' | 'preact' | 'solid' | 'vue' | 'angular' | 'unknown';
/**
 * Data structure for individual class information (JavaScript-specific)
 */
interface JsClassData {
    name: string;
    frequency: number;
    contexts: Array<{
        pattern: string;
        lineNumber: number;
        framework?: SupportedFramework;
        extractionType: 'static' | 'dynamic' | 'template' | 'utility';
    }>;
}
/**
 * Result of JavaScript class extraction operation
 */
interface JsClassExtractionResult {
    classes: Map<string, JsClassData>;
    totalMatches: number;
    totalClasses: number;
    uniqueClasses: number;
    framework: SupportedFramework;
    metadata: {
        source: string;
        processedAt: Date;
        processingTime: number;
        fileSize?: number;
        errors: string[];
        extractionStats: {
            staticMatches: number;
            dynamicMatches: number;
            templateMatches: number;
            utilityMatches: number;
        };
    };
}
/**
 * Custom error classes for JavaScript parsing operations
 */
declare class JsParsingError extends Error {
    source?: string;
    cause?: Error;
    constructor(message: string, source?: string, cause?: Error);
}
/**
 * Main JavaScript/JSX class extractor class
 */
declare class JsExtractor {
    private options;
    constructor(options?: Partial<JsExtractionOptions>);
    /**
     * Extract classes from JavaScript/JSX string
     */
    extractFromString(code: string, source?: string): Promise<JsClassExtractionResult>;
    /**
     * Extract classes from JavaScript/JSX file
     */
    extractFromFile(filePath: string): Promise<JsClassExtractionResult>;
    /**
     * Extract classes from multiple JavaScript/JSX files
     */
    extractFromFiles(filePaths: string[]): Promise<JsClassExtractionResult[]>;
    /**
     * Detect the JavaScript framework used in the code
     */
    private detectFramework;
    /**
     * Extract static className/class attributes
     */
    private extractStaticClasses;
    /**
     * Extract template literal classes
     */
    private extractTemplateClasses;
    /**
     * Extract JavaScript string literals from variable assignments
     */
    private extractJsStringLiterals;
    /**
     * Extract object property strings (for class definitions in object literals)
     */
    private extractObjectPropertyStrings;
    /**
     * Extract utility function classes (clsx, classnames, etc.)
     */
    private extractUtilityClasses;
    /**
     * Extract dynamic expression classes (basic implementation)
     */
    private extractDynamicClasses;
    /**
     * Process matches and add to classes map
     */
    private processMatches;
    /**
     * Parse class attribute string (reuse HTML pattern)
     */
    private parseClassAttribute;
    /**
     * Parse utility function arguments for class names
     */
    private parseUtilityFunctionArgs;
    /**
     * Parse template string for class names
     */
    private parseTemplateString;
    /**
     * Parse JSX expression for potential class names
     */
    private parseJsxExpression;
    /**
     * Read file with timeout protection
     */
    private readFileWithTimeout;
}
/**
 * Factory function to create JS extractor instance
 */
declare function createJsExtractor(options?: Partial<JsExtractionOptions>): JsExtractor;
/**
 * Convenience function to extract classes from JavaScript/JSX string
 */
declare function extractClassesFromJs(code: string, options?: Partial<JsExtractionOptions>): Promise<JsClassExtractionResult>;
/**
 * Convenience function to extract classes from JavaScript/JSX file
 */
declare function extractClassesFromJsFile(filePath: string, options?: Partial<JsExtractionOptions>): Promise<JsClassExtractionResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for pattern analysis
 */
declare const PatternAnalysisOptionsSchema: z.ZodObject<{
    caseSensitive: z.ZodDefault<z.ZodBoolean>;
    minimumFrequency: z.ZodDefault<z.ZodNumber>;
    enablePatternGrouping: z.ZodDefault<z.ZodBoolean>;
    enableCoOccurrenceAnalysis: z.ZodDefault<z.ZodBoolean>;
    maxCoOccurrenceDistance: z.ZodDefault<z.ZodNumber>;
    includeFrameworkAnalysis: z.ZodDefault<z.ZodBoolean>;
    sortBy: z.ZodDefault<z.ZodEnum<["frequency", "alphabetical", "source"]>>;
    sortDirection: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
    outputFormat: z.ZodDefault<z.ZodEnum<["map", "array", "json"]>>;
    enableValidation: z.ZodDefault<z.ZodBoolean>;
    validationOptions: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
}, "strip", z.ZodTypeAny, {
    enableValidation: boolean;
    outputFormat: "map" | "json" | "array";
    caseSensitive: boolean;
    minimumFrequency: number;
    enablePatternGrouping: boolean;
    enableCoOccurrenceAnalysis: boolean;
    maxCoOccurrenceDistance: number;
    includeFrameworkAnalysis: boolean;
    sortBy: "source" | "frequency" | "alphabetical";
    sortDirection: "asc" | "desc";
    validationOptions?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}, {
    enableValidation?: boolean | undefined;
    outputFormat?: "map" | "json" | "array" | undefined;
    caseSensitive?: boolean | undefined;
    minimumFrequency?: number | undefined;
    enablePatternGrouping?: boolean | undefined;
    enableCoOccurrenceAnalysis?: boolean | undefined;
    maxCoOccurrenceDistance?: number | undefined;
    includeFrameworkAnalysis?: boolean | undefined;
    sortBy?: "source" | "frequency" | "alphabetical" | undefined;
    sortDirection?: "asc" | "desc" | undefined;
    validationOptions?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}>;
type PatternAnalysisOptions = z.infer<typeof PatternAnalysisOptionsSchema>;
/**
 * Source attribution for class patterns
 */
interface SourceAttribution {
    sourceType: 'html' | 'jsx' | 'mixed';
    filePaths: string[];
    frameworks: Set<SupportedFramework>;
    extractionTypes: Set<'static' | 'dynamic' | 'template' | 'utility'>;
}
/**
 * Aggregated class data combining HTML and JSX contexts
 */
interface AggregatedClassData {
    name: string;
    totalFrequency: number;
    htmlFrequency: number;
    jsxFrequency: number;
    sources: SourceAttribution;
    contexts: {
        html: Array<{
            tagName: string;
            attributes: Record<string, string>;
            depth: number;
            filePath: string;
        }>;
        jsx: Array<{
            pattern: string;
            lineNumber: number;
            framework?: SupportedFramework;
            extractionType: 'static' | 'dynamic' | 'template' | 'utility';
            filePath: string;
        }>;
    };
    coOccurrences: Map<string, number>;
    validation?: ValidationResult$1;
}
/**
 * Pattern frequency map interface
 */
interface PatternFrequencyMap extends Map<string, AggregatedClassData> {
    readonly __patternFrequencyMapBrand?: unique symbol;
}
/**
 * Pattern grouping result for related classes
 */
interface PatternGroup {
    pattern: string;
    regex: RegExp;
    classes: string[];
    totalFrequency: number;
    examples: string[];
}
/**
 * Co-occurrence analysis result
 */
interface CoOccurrencePattern {
    classes: string[];
    frequency: number;
    strength: number;
    contexts: Array<{
        sourceType: 'html' | 'jsx';
        filePath: string;
        framework?: SupportedFramework;
    }>;
}
/**
 * Framework-specific analysis result
 */
interface FrameworkAnalysis {
    framework: SupportedFramework;
    totalClasses: number;
    uniqueClasses: number;
    mostCommonClasses: Array<{
        name: string;
        frequency: number;
    }>;
    extractionTypeDistribution: {
        static: number;
        dynamic: number;
        template: number;
        utility: number;
    };
}
/**
 * Complete frequency analysis result
 */
interface FrequencyAnalysisResult {
    frequencyMap: PatternFrequencyMap;
    totalClasses: number;
    uniqueClasses: number;
    totalFiles: number;
    patternGroups: PatternGroup[];
    coOccurrencePatterns: CoOccurrencePattern[];
    frameworkAnalysis: FrameworkAnalysis[];
    metadata: {
        processedAt: Date;
        processingTime: number;
        options: PatternAnalysisOptions;
        sources: {
            htmlFiles: number;
            jsxFiles: number;
            totalExtractionResults: number;
        };
        statistics: {
            averageFrequency: number;
            medianFrequency: number;
            mostFrequentClass: {
                name: string;
                frequency: number;
            } | null;
            leastFrequentClass: {
                name: string;
                frequency: number;
            } | null;
            classesAboveThreshold: number;
            classesBelowThreshold: number;
        };
        errors: string[];
    };
}
/**
 * Input data for pattern analysis
 */
interface PatternAnalysisInput {
    htmlResults: HtmlClassExtractionResult[];
    jsxResults: JsClassExtractionResult[];
}
/**
 * Sort function type for custom sorting
 */
type SortFunction = (a: [string, AggregatedClassData], b: [string, AggregatedClassData]) => number;
/**
 * Filter function type for custom filtering
 */
type FilterFunction = (className: string, data: AggregatedClassData) => boolean;
/**
 * Export format types
 */
interface JsonExportFormat {
    frequencyMap: Record<string, {
        name: string;
        totalFrequency: number;
        htmlFrequency: number;
        jsxFrequency: number;
        sources: {
            sourceType: string;
            filePaths: string[];
            frameworks: string[];
            extractionTypes: string[];
        };
    }>;
    metadata: FrequencyAnalysisResult['metadata'];
    summary: {
        totalClasses: number;
        uniqueClasses: number;
        totalFiles: number;
        topClasses: Array<{
            name: string;
            frequency: number;
        }>;
    };
}
/**
 * Error classes for pattern analysis operations
 */
declare class PatternAnalysisError extends Error {
    cause?: Error;
    constructor(message: string, cause?: Error);
}
declare class DataAggregationError extends PatternAnalysisError {
    sourceType?: 'html' | 'jsx';
    constructor(message: string, sourceType?: 'html' | 'jsx', cause?: Error);
}
declare class FrequencyCalculationError extends PatternAnalysisError {
    className?: string;
    constructor(message: string, className?: string, cause?: Error);
}
/**
 * Utility type guards
 */
declare function isHtmlResult(result: HtmlClassExtractionResult | JsClassExtractionResult): result is HtmlClassExtractionResult;
declare function isJsxResult(result: HtmlClassExtractionResult | JsClassExtractionResult): result is JsClassExtractionResult;
/**
 * Common Tailwind CSS pattern regexes for grouping
 */
declare const COMMON_TAILWIND_PATTERNS: {
    readonly spacing: RegExp;
    readonly colors: RegExp;
    readonly layout: RegExp;
    readonly sizing: RegExp;
    readonly typography: RegExp;
    readonly borders: RegExp;
    readonly effects: RegExp;
    readonly positioning: RegExp;
    readonly flexbox: RegExp;
    readonly grid: RegExp;
    readonly transforms: RegExp;
    readonly transitions: RegExp;
    readonly interactivity: RegExp;
    readonly responsive: RegExp;
    readonly darkMode: RegExp;
    readonly hover: RegExp;
    readonly focus: RegExp;
    readonly active: RegExp;
    readonly disabled: RegExp;
};
type TailwindPatternType = keyof typeof COMMON_TAILWIND_PATTERNS;
/**
 * Data aggregation functions for combining HTML and JSX extraction results
 */
/**
 * Combine multiple HTML and JSX extraction results into aggregated class data
 */
declare function aggregateExtractionResults(input: PatternAnalysisInput, options?: Partial<PatternAnalysisOptions>): Map<string, AggregatedClassData>;
/**
 * Deduplicate file paths and clean up aggregated data
 */
declare function cleanupAggregatedData(data: Map<string, AggregatedClassData>): void;
/**
 * Frequency map generation and pattern analysis functions
 */
/**
 * Generate a comprehensive frequency map from extraction results
 */
declare function generateFrequencyMap(input: PatternAnalysisInput, options?: Partial<PatternAnalysisOptions>): PatternFrequencyMap;
/**
 * Generate pattern groups based on common Tailwind CSS patterns
 */
declare function generatePatternGroups(frequencyMap: PatternFrequencyMap, options?: Partial<PatternAnalysisOptions>): PatternGroup[];
/**
 * Calculate comprehensive frequency statistics
 */
declare function calculateFrequencyStatistics(frequencyMap: PatternFrequencyMap, options?: Partial<PatternAnalysisOptions>): FrequencyAnalysisResult['metadata']['statistics'];
/**
 * Advanced pattern analysis functions
 */
/**
 * Generate detailed co-occurrence patterns from aggregated data
 */
declare function generateCoOccurrenceAnalysis(frequencyMap: PatternFrequencyMap, options?: Partial<PatternAnalysisOptions>): CoOccurrencePattern[];
/**
 * Generate framework-specific analysis
 */
declare function generateFrameworkAnalysis(frequencyMap: PatternFrequencyMap, options?: Partial<PatternAnalysisOptions>): FrameworkAnalysis[];
/**
 * Sorting and filtering functions
 */
/**
 * Sort frequency map entries by various criteria
 */
declare function sortFrequencyMap(frequencyMap: PatternFrequencyMap, options?: Partial<PatternAnalysisOptions>): Array<[string, AggregatedClassData]>;
/**
 * Apply custom filtering to frequency map
 */
declare function filterFrequencyMap(frequencyMap: PatternFrequencyMap, filterFn: FilterFunction): PatternFrequencyMap;
/**
 * Create common filter functions
 */
declare const CommonFilters: {
    minFrequency: (threshold: number) => FilterFunction;
    maxFrequency: (threshold: number) => FilterFunction;
    sourceType: (sourceType: "html" | "jsx" | "mixed") => FilterFunction;
    framework: (framework: SupportedFramework) => FilterFunction;
    pattern: (regex: RegExp) => FilterFunction;
    tailwindPattern: (patternType: TailwindPatternType) => FilterFunction;
};
/**
 * Export and utility functions
 */
/**
 * Convert frequency map to JSON export format
 */
declare function exportToJson(analysisResult: FrequencyAnalysisResult, options?: Partial<PatternAnalysisOptions>): JsonExportFormat;
/**
 * Main pattern analysis function that combines all functionality
 */
declare function analyzePatterns(input: PatternAnalysisInput, options?: Partial<PatternAnalysisOptions>): Promise<FrequencyAnalysisResult>;
/**
 * Convenience function for quick frequency analysis
 */
declare function quickFrequencyAnalysis(input: PatternAnalysisInput, minimumFrequency?: number): Map<string, number>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

interface FrequencyAnalyzer {
    analyze(data: any): Promise<any>;
}
interface GeneratedCSS {
    css: string;
    sourceMap?: string;
    metadata: any;
    processingTime?: number;
    optimizationMetrics?: any;
    errors?: Error[];
}
declare const CssGenerationOptionsSchema: z.ZodObject<{
    strategy: z.ZodDefault<z.ZodEnum<["atomic", "utility", "component", "mixed"]>>;
    useApplyDirective: z.ZodDefault<z.ZodBoolean>;
    sortingStrategy: z.ZodDefault<z.ZodEnum<["specificity", "frequency", "alphabetical", "custom"]>>;
    commentLevel: z.ZodDefault<z.ZodEnum<["none", "minimal", "detailed", "verbose"]>>;
    selectorNaming: z.ZodDefault<z.ZodEnum<["sequential", "frequency-optimized", "pretty", "custom"]>>;
    minimumFrequency: z.ZodDefault<z.ZodNumber>;
    includeSourceMaps: z.ZodDefault<z.ZodBoolean>;
    formatOutput: z.ZodDefault<z.ZodBoolean>;
    maxRulesPerFile: z.ZodDefault<z.ZodNumber>;
    enableOptimizations: z.ZodDefault<z.ZodBoolean>;
    customSortFunction: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>>;
    customNamingFunction: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodString>>;
    enableValidation: z.ZodDefault<z.ZodBoolean>;
    skipInvalidClasses: z.ZodDefault<z.ZodBoolean>;
    warnOnInvalidClasses: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    enableValidation: boolean;
    skipInvalidClasses: boolean;
    warnOnInvalidClasses: boolean;
    strategy: "component" | "mixed" | "utility" | "atomic";
    minimumFrequency: number;
    includeSourceMaps: boolean;
    useApplyDirective: boolean;
    sortingStrategy: "custom" | "frequency" | "alphabetical" | "specificity";
    commentLevel: "verbose" | "none" | "minimal" | "detailed";
    selectorNaming: "custom" | "pretty" | "sequential" | "frequency-optimized";
    formatOutput: boolean;
    maxRulesPerFile: number;
    enableOptimizations: boolean;
    customSortFunction?: ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
    customNamingFunction?: ((args_0: any, ...args: unknown[]) => string) | undefined;
}, {
    enableValidation?: boolean | undefined;
    skipInvalidClasses?: boolean | undefined;
    warnOnInvalidClasses?: boolean | undefined;
    strategy?: "component" | "mixed" | "utility" | "atomic" | undefined;
    minimumFrequency?: number | undefined;
    includeSourceMaps?: boolean | undefined;
    useApplyDirective?: boolean | undefined;
    sortingStrategy?: "custom" | "frequency" | "alphabetical" | "specificity" | undefined;
    commentLevel?: "verbose" | "none" | "minimal" | "detailed" | undefined;
    selectorNaming?: "custom" | "pretty" | "sequential" | "frequency-optimized" | undefined;
    formatOutput?: boolean | undefined;
    maxRulesPerFile?: number | undefined;
    enableOptimizations?: boolean | undefined;
    customSortFunction?: ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
    customNamingFunction?: ((args_0: any, ...args: unknown[]) => string) | undefined;
}>;
declare const PatternTypeSchema: z.ZodEnum<["atomic", "utility", "component"]>;
declare const CssRuleSchema: z.ZodObject<{
    selector: z.ZodString;
    declarations: z.ZodArray<z.ZodString, "many">;
    applyDirective: z.ZodOptional<z.ZodString>;
    frequency: z.ZodNumber;
    patternType: z.ZodEnum<["atomic", "utility", "component"]>;
    sourceClasses: z.ZodArray<z.ZodString, "many">;
    complexity: z.ZodNumber;
    coOccurrenceStrength: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
    selector: string;
    frequency: number;
    declarations: string[];
    patternType: "component" | "utility" | "atomic";
    sourceClasses: string[];
    complexity: number;
    coOccurrenceStrength: number;
    applyDirective?: string | undefined;
}, {
    selector: string;
    frequency: number;
    declarations: string[];
    patternType: "component" | "utility" | "atomic";
    sourceClasses: string[];
    complexity: number;
    coOccurrenceStrength: number;
    applyDirective?: string | undefined;
}>;
interface CssGenerationOptions {
    strategy: 'atomic' | 'utility' | 'component' | 'mixed';
    useApplyDirective: boolean;
    sortingStrategy: 'specificity' | 'frequency' | 'alphabetical' | 'custom';
    commentLevel: 'none' | 'minimal' | 'detailed' | 'verbose';
    selectorNaming: 'sequential' | 'frequency-optimized' | 'pretty' | 'custom';
    minimumFrequency: number;
    includeSourceMaps: boolean;
    formatOutput: boolean;
    maxRulesPerFile: number;
    enableOptimizations: boolean;
    customSortFunction?: (a: CssRule, b: CssRule) => number;
    customNamingFunction?: (pattern: AggregatedClassData) => string;
    enableValidation: boolean;
    skipInvalidClasses: boolean;
    warnOnInvalidClasses: boolean;
    enablePostCSS?: boolean;
    generateSourceMaps?: boolean;
    preserveComments?: boolean;
}
interface CssRule {
    selector: string;
    declarations: string[];
    applyDirective?: string;
    frequency: number;
    patternType: 'atomic' | 'utility' | 'component';
    sourceClasses: string[];
    complexity: number;
    coOccurrenceStrength: number;
}
interface ApplyDirective {
    classes: string[];
    variants: string[];
    modifiers: string[];
    isValid: boolean;
    optimized: string;
    conflicts: string[];
}
interface CssGenerationResult {
    css: string;
    rules: CssRule[];
    sourceClasses: string[];
    statistics: CssGenerationStatistics;
    metadata: {
        generatedAt: string;
        strategy: string;
        totalInputClasses: number;
        compressionAchieved: boolean;
        validationMetadata?: {
            totalClassesValidated: number;
            validClasses: number;
            invalidClasses: number;
            warningsGenerated: number;
            skippedClasses: number;
        };
    };
    warnings: string[];
    errors: string[];
    sourceMap?: string;
}
interface CssGenerationStatistics {
    totalRules: number;
    totalDeclarations: number;
    compressionRatio: number;
    generationTime: number;
    memoryUsage: number;
    patternTypeBreakdown: Record<string, number>;
    frequencyDistribution: Record<string, number>;
    optimizationsSaved: number;
}
interface PatternClassification {
    type: 'atomic' | 'utility' | 'component';
    patternType: 'atomic' | 'utility' | 'component';
    className: string;
    complexity: number;
    coOccurrenceStrength: number;
    semanticGroup: string;
    recommendedStrategy: string;
    confidence: number;
}
declare class CssGenerationError extends Error {
    code: string;
    context?: Record<string, unknown> | undefined;
    constructor(message: string, code: string, context?: Record<string, unknown> | undefined);
}
declare class InvalidCssError extends CssGenerationError {
    invalidCss: string;
    reason?: string | undefined;
    constructor(message: string, invalidCss: string, reason?: string | undefined);
}
declare class ApplyDirectiveError extends CssGenerationError {
    directive: string;
    classes?: string[] | undefined;
    constructor(message: string, directive: string, classes?: string[] | undefined);
}
declare class PatternClassificationError extends CssGenerationError {
    className: string;
    constructor(message: string, className: string);
}
declare const CSS_PATTERN_THRESHOLDS: {
    readonly ATOMIC_MAX_CLASSES: 1;
    readonly UTILITY_MAX_CLASSES: 5;
    readonly COMPONENT_MIN_CLASSES: 3;
    readonly HIGH_FREQUENCY_THRESHOLD: 50;
    readonly HIGH_FREQUENCY_MIN: 10;
    readonly RARE_PATTERN_MAX: 2;
    readonly MEDIUM_FREQUENCY_THRESHOLD: 10;
    readonly LOW_FREQUENCY_THRESHOLD: 2;
    readonly COMPLEXITY_THRESHOLD_HIGH: 7;
    readonly COMPLEXITY_THRESHOLD_MEDIUM: 4;
    readonly COMPLEXITY_LOW: 3;
    readonly COMPLEXITY_MEDIUM: 6;
    readonly COMPLEXITY_HIGH: 8;
    readonly CO_OCCURRENCE_STRONG: 0.7;
    readonly CO_OCCURRENCE_MEDIUM: 0.4;
    readonly CO_OCCURRENCE_WEAK: 0.2;
};
declare const CSS_PROPERTY_GROUPS: {
    readonly POSITIONING: readonly ["position", "top", "right", "bottom", "left", "z-index"];
    readonly DISPLAY: readonly ["display", "visibility", "opacity"];
    readonly FLEXBOX: readonly ["flex", "flex-direction", "flex-wrap", "justify-content", "align-items", "align-content"];
    readonly GRID: readonly ["grid", "grid-template", "grid-area", "grid-column", "grid-row"];
    readonly SIZING: readonly ["width", "height", "min-width", "min-height", "max-width", "max-height"];
    readonly SPACING: readonly ["margin", "padding"];
    readonly TYPOGRAPHY: readonly ["font", "font-size", "text", "line-height", "letter-spacing"];
    readonly COLORS: readonly ["color", "background", "border-color"];
    readonly BORDERS: readonly ["border", "border-radius", "outline"];
    readonly EFFECTS: readonly ["box-shadow", "filter", "backdrop-filter", "transform"];
};
declare const TAILWIND_DIRECTIVE_PATTERNS: {
    readonly VARIANTS: RegExp;
    readonly RESPONSIVE: RegExp;
    readonly DARK_MODE: RegExp;
    readonly MOTION: RegExp;
    readonly ARBITRARY_VALUES: RegExp;
    readonly IMPORTANT: RegExp;
    readonly MODIFIERS: RegExp;
};
declare const DEFAULT_CSS_GENERATION_OPTIONS: CssGenerationOptions;
declare function validateCssGenerationOptions(options: unknown): CssGenerationOptions;
declare function validateCssRule(rule: unknown): CssRule;
declare function validateTailwindClass(className: string): boolean;
declare function isValidCssSelector(selector: string): boolean;
declare function isValidCssPropertyValue(property: string, value: string): boolean;
declare function sanitizeCssSelector(selector: string): string;
declare function extractSourceClasses(pattern: AggregatedClassData): string[];
declare function calculateComplexity(pattern: AggregatedClassData): number;
declare function calculateCoOccurrenceStrength(pattern: AggregatedClassData): number;
declare function formatCssSelector(selector: string): string;
declare function formatCssDeclaration(property: string, value: string): string;
declare function formatCssRule(rule: CssRule, options: CssGenerationOptions): string;
declare function generateCssRules(patterns: AggregatedClassData[] | {
    frequencyMap: Map<string, number>;
    [key: string]: any;
}, options?: CssGenerationOptions): CssRule[];
declare function generateApplyDirective(classes: string[], options: CssGenerationOptions): ApplyDirective;
declare function validateApplyDirective(directive: ApplyDirective | string): Array<{
    type: 'error' | 'warning';
    message: string;
}> | boolean;
declare function optimizeApplyDirective(directive: ApplyDirective, _options: CssGenerationOptions): ApplyDirective;
declare function classifyPattern(pattern: AggregatedClassData, optionsOrContext: CssGenerationOptions | any): PatternClassification;
declare function sortCssRulesAdvanced(rules: CssRule[], options: CssGenerationOptions, criteria: Array<{
    field: string;
    weight: number;
    order: 'asc' | 'desc';
} | {
    type: string;
    weight: number;
    direction: 'asc' | 'desc';
}>): CssRule[];
declare function analyzePatternRelationships(classData: AggregatedClassData[] | AggregatedClassData, optionsOrContext: CssGenerationOptions | any): {
    relationships: Array<{
        source: string;
        target: string;
        strength: number;
        type: 'semantic' | 'frequency' | 'structural';
    }>;
    clusters: Array<{
        id: string;
        classes: string[];
        cohesion: number;
    }>;
    recommendations: string[];
};
declare function sortCssRules(rules: CssRule[], strategyOrOptions: CssGenerationOptions['sortingStrategy'] | CssGenerationOptions, customSortFn?: (a: CssRule, b: CssRule) => number): CssRule[];
declare function generateCssComments(rules: CssRule[] | CssRule, statistics: CssGenerationStatistics | CssGenerationOptions, commentLevel?: CssGenerationOptions['commentLevel']): string;
declare function integrateCssGeneration(analysisResult: FrequencyAnalysisResult, options: CssGenerationOptions): CssGenerationResult;
declare function integrateCssGeneration(frequencyMap: PatternFrequencyMap, nameOptions: any, cssOptions: CssGenerationOptions): CssGenerationResult;
declare function generateOptimizedCss(patterns: AggregatedClassData[], options?: Partial<CssGenerationOptions>): CssGenerationResult;
declare function generateOptimizedCss(frequencyMap: PatternFrequencyMap, nameOptions: any, cssOptions: CssGenerationOptions): CssGenerationResult;
declare function formatCssOutput(result: CssGenerationResult, options: CssGenerationOptions): string;
declare class EnhancedCSSGenerator {
    private readonly config;
    private readonly frequencyAnalyzer;
    private readonly logger;
    private readonly pluginAPI;
    private postcssProcessor?;
    constructor(config: EnigmaConfig, frequencyAnalyzer: FrequencyAnalyzer, enablePostCSS?: boolean);
    /**
     * Initialize PostCSS integration
     */
    private initializePostCSS;
    /**
     * Generate CSS with enhanced PostCSS processing
     */
    generateEnhancedCSS(classFrequencies: Map<string, number>, options?: Partial<CssGenerationOptions>): Promise<GeneratedCSS>;
    /**
     * Generate basic CSS without PostCSS processing
     */
    private generateBasicCSS;
    /**
     * Process CSS through PostCSS pipeline
     */
    private processWithPostCSS;
    /**
     * Get PostCSS plugin metrics
     */
    getPostCSSMetrics(): any;
    /**
     * Update PostCSS configuration at runtime
     */
    updatePostCSSConfig(updates: {
        optimizationLevel?: 'none' | 'basic' | 'standard' | 'aggressive';
        enableTailwindOptimizer?: boolean;
        enableCSSMinifier?: boolean;
        enableSourceMapper?: boolean;
        customPluginConfigs?: Record<string, any>;
    }): Promise<void>;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for CSS injection operations
 */
declare const CssInjectionOptionsSchema: z.ZodObject<{
    /** CSS file path to inject */
    cssPath: z.ZodString;
    /** Target HTML file path */
    htmlPath: z.ZodString;
    /** Base path for relative path calculation */
    basePath: z.ZodOptional<z.ZodString>;
    /** Whether to use relative paths (default: true) */
    useRelativePaths: z.ZodDefault<z.ZodBoolean>;
    /** Link tag attributes */
    linkAttributes: z.ZodDefault<z.ZodObject<{
        rel: z.ZodDefault<z.ZodString>;
        type: z.ZodDefault<z.ZodString>;
        media: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        type: string;
        rel: string;
        media?: string | undefined;
    }, {
        type?: string | undefined;
        rel?: string | undefined;
        media?: string | undefined;
    }>>;
    /** Insertion position in head */
    insertPosition: z.ZodDefault<z.ZodEnum<["first", "last", "before-existing", "after-meta"]>>;
    /** Whether to preserve original formatting */
    preserveFormatting: z.ZodDefault<z.ZodBoolean>;
    /** Whether to prevent duplicate injections */
    preventDuplicates: z.ZodDefault<z.ZodBoolean>;
    /** Duplicate resolution strategy */
    duplicateStrategy: z.ZodDefault<z.ZodEnum<["skip", "replace", "error"]>>;
    /** Whether to create head section if missing */
    createHeadIfMissing: z.ZodDefault<z.ZodBoolean>;
    /** Whether to backup original file */
    createBackup: z.ZodDefault<z.ZodBoolean>;
    /** Maximum file size to process (in bytes) */
    maxFileSize: z.ZodDefault<z.ZodNumber>;
    /** Timeout for processing (in ms) */
    timeout: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    timeout: number;
    maxFileSize: number;
    cssPath: string;
    htmlPath: string;
    useRelativePaths: boolean;
    linkAttributes: {
        type: string;
        rel: string;
        media?: string | undefined;
    };
    insertPosition: "first" | "last" | "before-existing" | "after-meta";
    preserveFormatting: boolean;
    preventDuplicates: boolean;
    duplicateStrategy: "error" | "skip" | "replace";
    createHeadIfMissing: boolean;
    createBackup: boolean;
    basePath?: string | undefined;
}, {
    cssPath: string;
    htmlPath: string;
    timeout?: number | undefined;
    maxFileSize?: number | undefined;
    basePath?: string | undefined;
    useRelativePaths?: boolean | undefined;
    linkAttributes?: {
        type?: string | undefined;
        rel?: string | undefined;
        media?: string | undefined;
    } | undefined;
    insertPosition?: "first" | "last" | "before-existing" | "after-meta" | undefined;
    preserveFormatting?: boolean | undefined;
    preventDuplicates?: boolean | undefined;
    duplicateStrategy?: "error" | "skip" | "replace" | undefined;
    createHeadIfMissing?: boolean | undefined;
    createBackup?: boolean | undefined;
}>;
type CssInjectionOptions = z.infer<typeof CssInjectionOptionsSchema>;
/**
 * Document structure analysis result
 */
interface DocumentStructure {
    /** Whether the document has a head section */
    hasHead: boolean;
    /** Whether the document has a body section */
    hasBody: boolean;
    /** Detected document type */
    doctype: string | null;
    /** HTML element attributes */
    htmlAttributes: Record<string, string>;
    /** Existing link tags in head */
    existingLinks: Array<{
        href: string;
        rel: string;
        type?: string;
        media?: string;
        element: cheerio.Cheerio<AnyNode>;
    }>;
    /** Existing style tags in head */
    existingStyles: Array<{
        content: string;
        type?: string;
        media?: string;
        element: cheerio.Cheerio<AnyNode>;
    }>;
    /** Meta tags in head */
    metaTags: Array<{
        name?: string;
        property?: string;
        content?: string;
        element: cheerio.Cheerio<AnyNode>;
    }>;
    /** Original indentation pattern detected */
    indentationPattern: {
        type: 'spaces' | 'tabs' | 'mixed';
        size: number;
        consistent: boolean;
    };
    /** Head section insertion point */
    headInsertionPoint: cheerio.Cheerio<AnyNode> | null;
}
/**
 * CSS injection operation result
 */
interface CssInjectionResult {
    /** Whether the injection was successful */
    success: boolean;
    /** The modified HTML string */
    html: string;
    /** Path to the injected CSS file */
    injectedCssPath: string;
    /** Calculated relative path used in the link tag */
    relativePath: string;
    /** Whether a duplicate was detected */
    duplicateDetected: boolean;
    /** Action taken for duplicate (if any) */
    duplicateAction: 'skipped' | 'replaced' | 'error' | null;
    /** Document structure analysis */
    documentStructure: DocumentStructure;
    /** Processing metadata */
    metadata: {
        source: string;
        processedAt: Date;
        processingTime: number;
        fileSize?: number;
        backupCreated: boolean;
        errors: string[];
        warnings: string[];
    };
}
/**
 * Custom error classes for CSS injection operations
 */
declare class CssInjectionError extends Error {
    source?: string;
    cause?: Error;
    code?: string;
    constructor(message: string, source?: string, cause?: Error, code?: string);
}
declare class DuplicateInjectionError extends CssInjectionError {
    existingHref: string;
    newHref: string;
    constructor(message: string, existingHref: string, newHref: string, source?: string);
}
declare class PathCalculationError extends CssInjectionError {
    fromPath: string;
    toPath: string;
    constructor(message: string, fromPath: string, toPath: string, cause?: Error);
}
declare class HtmlStructureError extends CssInjectionError {
    htmlContent?: string;
    constructor(message: string, htmlContent?: string, cause?: Error);
}
/**
 * Main CSS injection class
 */
declare class CssInjector {
    private readonly logger;
    private readonly options;
    private readonly pathUtils;
    constructor(options: Partial<CssInjectionOptions>);
    /**
     * Inject CSS link tag into HTML string
     */
    injectIntoString(html: string, source?: string): Promise<CssInjectionResult>;
    /**
     * Analyze HTML document structure
     */
    private analyzeDocumentStructure;
    /**
     * Detect indentation pattern from HTML content
     */
    private detectIndentationPattern;
    /**
     * Calculate relative path from HTML file to CSS file
     */
    private calculateRelativePath;
    /**
     * Detect duplicate CSS links
     */
    private detectDuplicate;
    /**
     * Handle duplicate CSS links according to strategy
     */
    private handleDuplicate;
    /**
     * Normalize path for comparison using PathUtils
     */
    private normalizePath;
    /**
     * Inject CSS link tag into document
     */
    private injectLinkTag;
    /**
     * Generate proper indentation string based on detected pattern
     */
    private generateIndentation;
}
/**
 * CSS injection request interface for validation
 */
interface CssInjectionRequest {
    cssFilePath: string;
    htmlFilePath: string;
    position?: string;
    options?: Partial<CssInjectionOptions>;
}
/**
 * Factory function to create CSS injector
 */
declare function createCssInjector(options?: Partial<CssInjectionOptions>): CssInjector;
/**
 * Utility function to validate CSS injection request
 */
declare function validateInjectionRequest(request: CssInjectionRequest): {
    valid: boolean;
    errors: string[];
};

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Optimization Results Caching System
 *
 * Provides intelligent caching for optimization results to dramatically speed up
 * subsequent optimizations of the same project. Uses the existing CacheManager
 * infrastructure with optimization-specific enhancements.
 *
 * Features:
 * - File content hash-based caching
 * - Configuration-aware cache keys
 * - Automatic cache invalidation on file changes
 * - Version-aware caching for tool updates
 * - Performance metrics and analytics
 * - Multi-level cache hierarchy (memory + disk persistence)
 */

/**
 * Cache key components for optimization results
 */
interface OptimizationCacheKey {
    /** Hash of input file contents */
    contentHash: string;
    /** Hash of configuration that affects optimization */
    configHash: string;
    /** Version of the optimization engine */
    engineVersion: string;
    /** Framework/integration type */
    framework?: string;
    /** File type (html, js, vue, etc.) */
    fileType: string;
}
/**
 * Cached optimization entry with metadata
 */
interface CachedOptimizationResult extends OptimizationResult$1 {
    /** When this result was cached */
    cachedAt: Date;
    /** Cache key used to store this result */
    cacheKey: string;
    /** Input files that contributed to this result */
    inputFiles: string[];
    /** Configuration snapshot */
    configSnapshot: Partial<EnigmaConfig>;
    /** Cache hit statistics */
    hitCount: number;
    /** Last time this cache entry was accessed */
    lastAccessed: Date;
}
/**
 * Cache invalidation reasons
 */
type InvalidationReason = 'file-changed' | 'config-changed' | 'engine-updated' | 'manual' | 'expired' | 'dependency-changed';
/**
 * Configuration for optimization cache
 */
interface OptimizationCacheConfig {
    /** Enable caching */
    enabled: boolean;
    /** Maximum cache size in bytes */
    maxSize: number;
    /** Cache TTL in milliseconds (default: 7 days) */
    ttl: number;
    /** Enable file watching for auto-invalidation */
    enableFileWatching: boolean;
    /** Cache persistence directory */
    persistenceDir?: string;
    /** Enable compression for cached data */
    enableCompression: boolean;
    /** Maximum number of cached results per project */
    maxEntriesPerProject: number;
    /** Enable performance analytics */
    enableAnalytics: boolean;
    /** Debounce delay for file change events (ms) */
    fileChangeDebounce: number;
}
/**
 * Cache analytics and performance metrics
 */
interface CacheAnalytics {
    /** Total cache hits */
    totalHits: number;
    /** Total cache misses */
    totalMisses: number;
    /** Cache hit rate percentage */
    hitRate: number;
    /** Average optimization time saved per hit (ms) */
    averageTimeSaved: number;
    /** Total time saved by caching (ms) */
    totalTimeSaved: number;
    /** Most frequently cached file types */
    topFileTypes: Array<{
        type: string;
        count: number;
    }>;
    /** Cache size statistics */
    sizeStats: {
        totalEntries: number;
        totalSize: number;
        averageEntrySize: number;
        largestEntry: number;
    };
    /** Invalidation statistics */
    invalidationStats: {
        byReason: Record<InvalidationReason, number>;
        totalInvalidations: number;
    };
}
/**
 * Optimization cache manager
 */
declare class OptimizationCache extends EventEmitter {
    private readonly config;
    private readonly cache;
    private readonly fileWatcher?;
    private readonly watchedFiles;
    private readonly analytics;
    private readonly configHashes;
    private readonly fileChangeTimers;
    constructor(config?: Partial<OptimizationCacheConfig>);
    /**
     * Get cached optimization result if available
     */
    get(inputFiles: string[], config: EnigmaConfig, framework?: string): Promise<CachedOptimizationResult | null>;
    /**
     * Store optimization result in cache
     */
    set(inputFiles: string[], config: EnigmaConfig, result: OptimizationResult$1, framework?: string): Promise<boolean>;
    /**
     * Invalidate cache entries based on file changes
     */
    invalidateByFiles(files: string[], reason?: InvalidationReason): Promise<number>;
    /**
     * Invalidate cache entries based on configuration changes
     */
    invalidateByConfig(newConfig: EnigmaConfig): Promise<number>;
    /**
     * Clear all cached optimization results
     */
    clear(): Promise<void>;
    /**
     * Get cache analytics and performance metrics
     */
    getAnalytics(): CacheAnalytics;
    /**
     * Generate a unique cache key for the given inputs
     */
    generateCacheKey(inputFiles: string[], config: EnigmaConfig, framework?: string): Promise<string>;
    /**
     * Generate hash of file contents
     */
    private generateContentHash;
    /**
     * Generate hash of optimization-relevant configuration
     */
    private hashConfig;
    /**
     * Extract configuration properties that affect optimization results
     */
    private extractRelevantConfig;
    /**
     * Determine file type from input files
     */
    private determineFileType;
    /**
     * Set up file watching for cache invalidation
     */
    private setupFileWatching;
    /**
     * Watch files for changes and invalidate cache accordingly
     */
    private watchFiles;
    /**
     * Handle file change events with debouncing
     */
    private handleFileChange;
    /**
     * Set up event handlers for cache events
     */
    private setupEventHandlers;
    /**
     * Record cache hit for analytics
     */
    private recordCacheHit;
    /**
     * Record cache miss for analytics
     */
    private recordCacheMiss;
    /**
     * Record cache invalidation for analytics
     */
    private recordInvalidation;
    /**
     * Update analytics with new cache entry
     */
    private updateAnalytics;
    /**
     * Estimate size of cached result in bytes
     */
    private estimateSize;
    /**
     * Reset analytics data
     */
    private resetAnalytics;
    /**
     * Clean up resources
     */
    destroy(): Promise<void>;
}
/**
 * Get or create global optimization cache instance
 */
declare function getOptimizationCache(config?: Partial<OptimizationCacheConfig>): OptimizationCache;
/**
 * Create a new optimization cache instance
 */
declare function createOptimizationCache(config?: Partial<OptimizationCacheConfig>): OptimizationCache;

/**
 * Circuit breaker states for cache availability
 */
type CircuitBreakerState$1 = 'closed' | 'open' | 'half-open';
/**
 * Storage and retrieval statistics
 */
interface StorageRetrievalStats {
    /** Total get operations attempted */
    getOperations: number;
    /** Total set operations attempted */
    setOperations: number;
    /** Successful get operations */
    successfulGets: number;
    /** Successful set operations */
    successfulSets: number;
    /** Cache hit rate */
    hitRate: number;
    /** Average retrieval time (ms) */
    averageRetrievalTime: number;
    /** Average storage time (ms) */
    averageStorageTime: number;
    /** Circuit breaker state */
    circuitBreakerState: CircuitBreakerState$1;
    /** Number of fallback operations */
    fallbackOperations: number;
}
/**
 * Optimization cache integration manager
 */
declare class OptimizationCacheIntegration extends EventEmitter {
    private readonly cache;
    private readonly circuitBreakerConfig;
    private circuitBreakerState;
    private circuitBreakerFailureCount;
    private circuitBreakerLastFailureTime;
    private circuitBreakerSuccessCount;
    private readonly stats;
    private readonly operationTimers;
    private readonly activeOperations;
    constructor(cacheConfig?: Partial<OptimizationCacheConfig>);
    /**
     * Attempt to retrieve optimization result from cache
     * Implements multi-layered cache checking with fallback mechanisms
     */
    retrieveOptimizationResult(inputFiles: string[], config: EnigmaConfig, framework?: string, options?: {
        bypassCache?: boolean;
        operationId?: string;
    }): Promise<CachedOptimizationResult | null>;
    /**
     * Store optimization result in cache with fallback handling
     */
    storeOptimizationResult(inputFiles: string[], config: EnigmaConfig, result: OptimizationResult$1, framework?: string, options?: {
        operationId?: string;
    }): Promise<boolean>;
    /**
     * Invalidate cache entries (with circuit breaker protection)
     */
    invalidateCache(files?: string[], config?: EnigmaConfig, reason?: string): Promise<number>;
    /**
     * Get comprehensive cache statistics
     */
    getStats(): StorageRetrievalStats;
    /**
     * Get detailed cache analytics
     */
    getCacheAnalytics(): CacheAnalytics;
    /**
     * Reset circuit breaker manually
     */
    resetCircuitBreaker(): void;
    /**
     * Perform actual cache retrieval
     */
    private performCacheRetrieval;
    /**
     * Perform actual cache storage
     */
    private performCacheStorage;
    /**
     * Check if cache is available based on circuit breaker state
     */
    private isCacheAvailable;
    /**
     * Handle circuit breaker failure
     */
    private handleCircuitBreakerFailure;
    /**
     * Handle circuit breaker success
     */
    private handleCircuitBreakerSuccess;
    /**
     * Create operation timeout promise
     */
    private createOperationTimeout;
    /**
     * Clear operation timeout
     */
    private clearOperationTimeout;
    /**
     * Generate unique operation ID
     */
    private generateOperationId;
    /**
     * Estimate result size for metrics
     */
    private estimateResultSize;
    /**
     * Record successful get operation
     */
    private recordSuccessfulGet;
    /**
     * Record missed get operation
     */
    private recordMissedGet;
    /**
     * Record failed get operation
     */
    private recordFailedGet;
    /**
     * Record successful set operation
     */
    private recordSuccessfulSet;
    /**
     * Record failed set operation
     */
    private recordFailedSet;
    /**
     * Update average retrieval time
     */
    private updateAverageRetrievalTime;
    /**
     * Update average storage time
     */
    private updateAverageStorageTime;
    /**
     * Set up event handlers
     */
    private setupEventHandlers;
    /**
     * Clean up resources
     */
    destroy(): Promise<void>;
}
/**
 * Get or create global optimization cache integration instance
 */
declare function getOptimizationCacheIntegration(cacheConfig?: Partial<OptimizationCacheConfig>): OptimizationCacheIntegration;
/**
 * Create a new optimization cache integration instance
 */
declare function createOptimizationCacheIntegration(cacheConfig?: Partial<OptimizationCacheConfig>): OptimizationCacheIntegration;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for name generation
 */
declare const NameGenerationOptionsSchema: z.ZodObject<{
    alphabet: z.ZodDefault<z.ZodString>;
    numericSuffix: z.ZodDefault<z.ZodBoolean>;
    strategy: z.ZodDefault<z.ZodEnum<["sequential", "frequency-optimized", "hybrid", "pretty"]>>;
    startIndex: z.ZodDefault<z.ZodNumber>;
    prettyNameMaxLength: z.ZodDefault<z.ZodNumber>;
    prettyNamePreferShorter: z.ZodDefault<z.ZodBoolean>;
    prettyNameExhaustionStrategy: z.ZodDefault<z.ZodEnum<["fallback-sequential", "fallback-hybrid", "error"]>>;
    enableFrequencyOptimization: z.ZodDefault<z.ZodBoolean>;
    frequencyThreshold: z.ZodDefault<z.ZodNumber>;
    reservedNames: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    avoidConflicts: z.ZodDefault<z.ZodBoolean>;
    enableCaching: z.ZodDefault<z.ZodBoolean>;
    batchSize: z.ZodDefault<z.ZodNumber>;
    maxCacheSize: z.ZodDefault<z.ZodNumber>;
    prefix: z.ZodDefault<z.ZodString>;
    suffix: z.ZodDefault<z.ZodString>;
    ensureCssValid: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    batchSize: number;
    enableCaching: boolean;
    strategy: "pretty" | "hybrid" | "sequential" | "frequency-optimized";
    startIndex: number;
    alphabet: string;
    numericSuffix: boolean;
    prettyNameMaxLength: number;
    prettyNamePreferShorter: boolean;
    prettyNameExhaustionStrategy: "error" | "fallback-sequential" | "fallback-hybrid";
    enableFrequencyOptimization: boolean;
    frequencyThreshold: number;
    reservedNames: string[];
    avoidConflicts: boolean;
    maxCacheSize: number;
    prefix: string;
    suffix: string;
    ensureCssValid: boolean;
}, {
    batchSize?: number | undefined;
    enableCaching?: boolean | undefined;
    strategy?: "pretty" | "hybrid" | "sequential" | "frequency-optimized" | undefined;
    startIndex?: number | undefined;
    alphabet?: string | undefined;
    numericSuffix?: boolean | undefined;
    prettyNameMaxLength?: number | undefined;
    prettyNamePreferShorter?: boolean | undefined;
    prettyNameExhaustionStrategy?: "error" | "fallback-sequential" | "fallback-hybrid" | undefined;
    enableFrequencyOptimization?: boolean | undefined;
    frequencyThreshold?: number | undefined;
    reservedNames?: string[] | undefined;
    avoidConflicts?: boolean | undefined;
    maxCacheSize?: number | undefined;
    prefix?: string | undefined;
    suffix?: string | undefined;
    ensureCssValid?: boolean | undefined;
}>;
type NameGenerationOptions = z.infer<typeof NameGenerationOptionsSchema>;
/**
 * Generated name result with metadata
 */
interface GeneratedName {
    original: string;
    optimized: string;
    length: number;
    index: number;
    frequency: number;
    compressionRatio: number;
}
/**
 * Name generation result containing all mappings and metadata
 */
interface NameGenerationResult {
    nameMap: Map<string, string>;
    reverseMap: Map<string, string>;
    generatedNames: GeneratedName[];
    metadata: {
        totalNames: number;
        totalOriginalLength: number;
        totalOptimizedLength: number;
        overallCompressionRatio: number;
        averageNameLength: number;
        collisionCount: number;
        generationTime: number;
        strategy: NameGenerationOptions['strategy'];
        options: NameGenerationOptions;
    };
    statistics: {
        lengthDistribution: Map<number, number>;
        frequencyBuckets: Array<{
            range: string;
            count: number;
            averageCompression: number;
        }>;
        mostCompressed: GeneratedName[];
        leastCompressed: GeneratedName[];
    };
}
/**
 * Cache for collision detection and name persistence
 */
interface NameCollisionCache {
    usedNames: Set<string>;
    reservedNames: Set<string>;
    nameIndex: number;
    lastGenerated: Map<string, string>;
}
/**
 * Base conversion result for debugging and analysis
 */
interface BaseConversionResult {
    input: number;
    output: string;
    base: number;
    length: number;
    valid: boolean;
}
/**
 * Frequency bucket for optimization strategies
 */
interface FrequencyBucket {
    range: [number, number];
    names: string[];
    strategy: 'shortest' | 'short' | 'medium' | 'standard';
}
/**
 * Pretty name permutation cache for performance optimization
 */
interface PrettyNameCache {
    permutations: Map<number, string[]>;
    usedPermutations: Set<string>;
    currentIndex: Map<number, number>;
    totalGenerated: number;
    totalExhausted: number;
    lastGenerated?: string;
}
/**
 * Pretty name generation result with aesthetic scoring
 */
interface PrettyNameResult {
    name: string;
    length: number;
    aestheticScore: number;
    isExhausted: boolean;
    fallbackUsed: boolean;
    generationStrategy: 'permutation' | 'fallback-sequential' | 'fallback-hybrid';
}
/**
 * Pretty name generation statistics
 */
interface PrettyNameStatistics {
    totalPermutations: number;
    usedPermutations: number;
    exhaustionRate: number;
    averageAestheticScore: number;
    fallbackUsageRate: number;
    lengthDistribution: Map<number, number>;
}
/**
 * Error classes for name generation operations
 */
declare class NameGenerationError extends Error {
    cause?: Error;
    constructor(message: string, cause?: Error);
}
declare class CollisionError extends NameGenerationError {
    conflictingName: string;
    attemptedName: string;
    constructor(message: string, conflictingName: string, attemptedName: string, cause?: Error);
}
declare class CacheError extends NameGenerationError {
    operation: 'read' | 'write' | 'clear' | 'validate';
    constructor(message: string, operation: 'read' | 'write' | 'clear' | 'validate', cause?: Error);
}
declare class InvalidNameError extends NameGenerationError {
    invalidName: string;
    reason: 'css-invalid' | 'reserved' | 'collision' | 'format';
    constructor(message: string, invalidName: string, reason: 'css-invalid' | 'reserved' | 'collision' | 'format', cause?: Error);
}
declare class PrettyNameExhaustionError extends NameGenerationError {
    maxLength: number;
    totalGenerated: number;
    availableStrategies: string[];
    constructor(message: string, maxLength: number, totalGenerated: number, availableStrategies: string[], cause?: Error);
}
/**
 * CSS keyword and framework reserved names that should not be used for generation
 */
declare const CSS_RESERVED_KEYWORDS: Set<string>;
/**
 * Base alphabet configurations for different optimization strategies
 */
declare const ALPHABET_CONFIGS: {
    readonly minimal: "abcdefghijklmnopqrstuvwxyz";
    readonly standard: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    readonly full: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    readonly cssSafe: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
};
/**
 * Validation patterns for CSS identifiers
 */
declare const CSS_IDENTIFIER_PATTERNS: {
    readonly valid: RegExp;
    readonly validStart: RegExp;
    readonly validContinuation: RegExp;
};
/**
 * Type guards and utility functions
 */
declare function isValidCssIdentifier(name: string): boolean;
declare function isReservedName(name: string, additionalReserved?: Set<string>): boolean;
declare function validateNameGenerationOptions(options: unknown): NameGenerationOptions;
/**
 * ===================================================================
 * BASE CONVERSION UTILITIES (Step 2)
 * ===================================================================
 */
/**
 * Convert a number to base-26 representation using lowercase letters (a-z)
 * This generates the shortest possible names: a, b, c, ..., z, aa, ab, etc.
 *
 * @param num - The number to convert (0-based)
 * @returns Base-26 string representation
 *
 * @example
 * toBase26(0) => 'a'
 * toBase26(25) => 'z'
 * toBase26(26) => 'aa'
 * toBase26(51) => 'az'
 */
declare function toBase26(num: number): string;
/**
 * Convert a base-26 string back to a number
 *
 * @param str - Base-26 string to convert
 * @returns The corresponding number (0-based)
 */
declare function fromBase26(str: string): number;
/**
 * Convert a number to base-36 representation using letters and numbers
 * Provides more characters for longer sequences: a-z, 0-9
 * Note: Numbers are only used in non-first positions due to CSS rules
 *
 * @param num - The number to convert (0-based)
 * @param useNumbers - Whether to include numbers (0-9) in the alphabet
 * @returns Base-36 string representation
 */
declare function toBase36(num: number, useNumbers?: boolean): string;
/**
 * Convert a base-36 string back to a number
 *
 * @param str - Base-36 string to convert
 * @param useNumbers - Whether numbers were used in generation
 * @returns The corresponding number (0-based)
 */
declare function fromBase36(str: string, _useNumbers?: boolean): number;
/**
 * Convert number to custom alphabet representation
 *
 * @param num - The number to convert
 * @param alphabet - Custom alphabet to use
 * @param ensureCssValid - Ensure first character is CSS-valid (letter or underscore)
 * @returns String representation using custom alphabet
 */
declare function toCustomBase(num: number, alphabet: string, ensureCssValid?: boolean): string;
/**
 * Calculate the optimal name length for a given number of unique identifiers
 *
 * @param count - Number of unique identifiers needed
 * @param alphabet - Alphabet to use for calculation
 * @returns Object with length requirements and capacity information
 */
declare function calculateOptimalLength(count: number, alphabet: string): {
    minLength: number;
    capacity: number;
    efficiency: number;
    charactersPerLength: number[];
};
/**
 * Test and validate base conversion functions
 *
 * @param testCount - Number of values to test
 * @returns Validation result with any errors found
 */
declare function validateBaseConversions(testCount?: number): BaseConversionResult[];
/**
 * ===================================================================
 * SEQUENTIAL NAME GENERATION ALGORITHM (Step 3)
 * ===================================================================
 */
/**
 * Generate a sequential name for a given index using the specified strategy
 *
 * @param index - The sequential index (0-based)
 * @param options - Name generation options
 * @returns Generated name string
 */
declare function generateSequentialName(index: number, options: NameGenerationOptions): string;
/**
 * Generate multiple sequential names efficiently
 *
 * @param count - Number of names to generate
 * @param options - Name generation options
 * @param startIndex - Starting index (default: 0)
 * @returns Array of generated names
 */
declare function generateSequentialNames(count: number, options: NameGenerationOptions, startIndex?: number): string[];
/**
 * ===================================================================
 * PRETTY NAME GENERATION ALGORITHM (Step 2: Permutation Algorithm)
 * ===================================================================
 */
/**
 * Generate all permutations of alphabet characters without repetition up to maxLength
 *
 * @param alphabet - Available characters for generation
 * @param maxLength - Maximum length for generated names
 * @returns Sorted array of permutations by length then aesthetic score
 */
declare function generatePermutationsWithoutRepetition(alphabet: string, maxLength: number): string[];
/**
 * Calculate aesthetic score for a name (0-1, higher is better)
 * Considers factors like pronounceability, character flow, and visual appeal
 *
 * @param name - Name to score
 * @returns Aesthetic score between 0 and 1
 */
declare function calculateAestheticScore(name: string): number;
/**
 * Create a pretty name cache for performance optimization
 *
 * @param alphabet - Available characters
 * @param maxLength - Maximum length for generated names
 * @returns Initialized pretty name cache
 */
declare function createPrettyNameCache(alphabet: string, maxLength: number): PrettyNameCache;
declare function generatePrettyName(index: number, options: NameGenerationOptions): PrettyNameResult;
/**
 * Create a name collision cache instance
 *
 * @param options - Name generation options
 * @returns Initialized collision cache
 */
declare function createNameCollisionCache(options: NameGenerationOptions): NameCollisionCache;
/**
 * Check if a name conflicts with existing names or reserved words
 *
 * @param name - Name to check
 * @param cache - Collision cache
 * @returns True if there's a conflict
 */
declare function hasNameCollision(name: string, cache: NameCollisionCache): boolean;
/**
 * Generate the next available name, skipping conflicts
 *
 * @param cache - Collision cache
 * @param options - Name generation options
 * @returns Next available name and updated index
 */
declare function generateNextAvailableName(cache: NameCollisionCache, options: NameGenerationOptions): {
    name: string;
    index: number;
};
/**
 * Batch generate available names with collision checking
 *
 * @param count - Number of names to generate
 * @param cache - Collision cache
 * @param options - Name generation options
 * @returns Array of generated names with metadata
 */
declare function batchGenerateAvailableNames(count: number, cache: NameCollisionCache, options: NameGenerationOptions): Array<{
    name: string;
    index: number;
}>;
/**
 * Calculate name generation statistics for planning
 *
 * @param count - Expected number of names
 * @param options - Name generation options
 * @returns Statistics about expected name generation
 */
declare function calculateGenerationStatistics(count: number, options: NameGenerationOptions): {
    expectedLength: number;
    minLength: number;
    maxLength: number;
    efficiency: number;
    estimatedCollisions: number;
    totalCapacity: number;
};
/**
 * Validate name generation options and cache compatibility
 *
 * @param options - Options to validate
 * @param cache - Optional cache to validate against
 * @returns Validation result with any warnings
 */
declare function validateGenerationSetup(options: NameGenerationOptions, cache?: NameCollisionCache): {
    valid: boolean;
    warnings: string[];
    errors: string[];
};
/**
 * ===================================================================
 * FREQUENCY-BASED OPTIMIZATION (Step 4)
 * ===================================================================
 */
/**
 * Sort class names by frequency for optimal name assignment
 *
 * @param frequencyMap - Pattern frequency data from analysis
 * @param options - Name generation options
 * @returns Sorted array of class names with frequency data
 */
declare function sortByFrequency(frequencyMap: PatternFrequencyMap, options: NameGenerationOptions): Array<{
    name: string;
    frequency: number;
    data: AggregatedClassData;
}>;
/**
 * Create frequency buckets for different optimization strategies
 *
 * @param sortedClasses - Classes sorted by frequency
 * @param options - Name generation options
 * @returns Frequency buckets with optimization strategies
 */
declare function createFrequencyBuckets(sortedClasses: Array<{
    name: string;
    frequency: number;
    data: AggregatedClassData;
}>, _options: NameGenerationOptions): FrequencyBucket[];
/**
 * Generate optimized names based on frequency analysis
 *
 * @param frequencyMap - Pattern frequency data
 * @param options - Name generation options
 * @returns Map of original names to optimized names
 */
declare function optimizeByFrequency(frequencyMap: PatternFrequencyMap, options: NameGenerationOptions): Map<string, string>;
/**
 * Calculate compression statistics for frequency-based optimization
 *
 * @param originalMap - Original class names with frequency data
 * @param optimizedMap - Map of original to optimized names
 * @returns Compression statistics
 */
declare function calculateCompressionStats(originalMap: Map<string, AggregatedClassData>, optimizedMap: Map<string, string>): {
    totalOriginalLength: number;
    totalOptimizedLength: number;
    overallCompressionRatio: number;
    classCompressionRatios: GeneratedName[];
    frequencyWeightedCompression: number;
    bestCompressed: GeneratedName[];
    worstCompressed: GeneratedName[];
};
/**
 * Analyze frequency distribution and suggest optimization strategies
 *
 * @param frequencyMap - Pattern frequency data
 * @returns Analysis and recommendations
 */
declare function analyzeFrequencyDistribution(frequencyMap: PatternFrequencyMap): {
    totalClasses: number;
    averageFrequency: number;
    medianFrequency: number;
    frequencyRanges: Array<{
        range: string;
        count: number;
        percentage: number;
    }>;
    recommendations: string[];
};
/**
 * ===================================================================
 * MAIN API & INTEGRATION (Steps 5-7)
 * ===================================================================
 */
/**
 * Enhanced collision cache with persistence and performance optimization
 */
declare class NameCollisionManager {
    private cache;
    private options;
    private persistenceEnabled;
    constructor(options: NameGenerationOptions, persistenceEnabled?: boolean);
    /**
     * Load cached names from previous runs for consistency
     */
    loadFromCache(cacheData?: Map<string, string>): Promise<void>;
    /**
     * Save current state for future consistency
     */
    saveToCache(): Promise<Map<string, string>>;
    /**
     * Check and reserve a name, handling collisions
     */
    reserveName(name: string, originalName?: string): boolean;
    /**
     * Get cache statistics
     */
    getStats(): {
        usedNames: number;
        reservedNames: number;
        cacheHitRate: number;
        currentIndex: number;
    };
    /**
     * Clear cache for fresh start
     */
    clear(): void;
}
/**
 * Main function to generate optimized names from pattern frequency data
 *
 * @param frequencyMap - Pattern frequency data from analysis
 * @param options - Name generation options
 * @param existingCache - Optional existing cache for consistency
 * @returns Complete name generation result
 */
declare function generateOptimizedNames(frequencyMap: PatternFrequencyMap, options?: Partial<NameGenerationOptions>, existingCache?: Map<string, string>): Promise<NameGenerationResult>;
/**
 * Export name generation result to JSON format
 *
 * @param result - Name generation result
 * @returns JSON-serializable export format
 */
declare function exportNameGenerationResult(result: NameGenerationResult): {
    nameMap: Record<string, string>;
    reverseMap: Record<string, string>;
    metadata: NameGenerationResult['metadata'];
    statistics: {
        lengthDistribution: Record<number, number>;
        frequencyBuckets: NameGenerationResult['statistics']['frequencyBuckets'];
        mostCompressed: GeneratedName[];
        leastCompressed: GeneratedName[];
    };
};
/**
 * Quick utility function for simple name generation without frequency data
 *
 * @param classNames - Array of class names to optimize
 * @param options - Name generation options
 * @returns Simple mapping of original to optimized names
 */
declare function generateSimpleNames(classNames: string[], options?: Partial<NameGenerationOptions>): Promise<Map<string, string>>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Configuration options for HTML rewriting operations
 */
declare const HtmlRewriteOptionsSchema: z.ZodObject<{
    createBackup: z.ZodDefault<z.ZodBoolean>;
    backupSuffix: z.ZodDefault<z.ZodString>;
    preserveComments: z.ZodDefault<z.ZodBoolean>;
    preserveWhitespace: z.ZodDefault<z.ZodBoolean>;
    validateOutput: z.ZodDefault<z.ZodBoolean>;
    maxFileSize: z.ZodDefault<z.ZodNumber>;
    timeout: z.ZodDefault<z.ZodNumber>;
    dryRun: z.ZodDefault<z.ZodBoolean>;
    xmlMode: z.ZodDefault<z.ZodBoolean>;
    decodeEntities: z.ZodDefault<z.ZodBoolean>;
    lowerCaseAttributeNames: z.ZodDefault<z.ZodBoolean>;
    recognizeSelfClosing: z.ZodDefault<z.ZodBoolean>;
    caseSensitive: z.ZodDefault<z.ZodBoolean>;
    wholeWordsOnly: z.ZodDefault<z.ZodBoolean>;
    preserveOriginalPatterns: z.ZodDefault<z.ZodBoolean>;
    formatOutput: z.ZodDefault<z.ZodBoolean>;
    indentSize: z.ZodDefault<z.ZodNumber>;
    useSpaces: z.ZodDefault<z.ZodBoolean>;
    enableCaching: z.ZodDefault<z.ZodBoolean>;
    batchSize: z.ZodDefault<z.ZodNumber>;
    verbose: z.ZodDefault<z.ZodBoolean>;
    logChanges: z.ZodDefault<z.ZodBoolean>;
    includeSourceMaps: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    verbose: boolean;
    timeout: number;
    preserveComments: boolean;
    preserveWhitespace: boolean;
    caseSensitive: boolean;
    maxFileSize: number;
    createBackup: boolean;
    batchSize: number;
    enableCaching: boolean;
    xmlMode: boolean;
    decodeEntities: boolean;
    dryRun: boolean;
    includeSourceMaps: boolean;
    formatOutput: boolean;
    backupSuffix: string;
    validateOutput: boolean;
    lowerCaseAttributeNames: boolean;
    recognizeSelfClosing: boolean;
    wholeWordsOnly: boolean;
    preserveOriginalPatterns: boolean;
    indentSize: number;
    useSpaces: boolean;
    logChanges: boolean;
}, {
    verbose?: boolean | undefined;
    timeout?: number | undefined;
    preserveComments?: boolean | undefined;
    preserveWhitespace?: boolean | undefined;
    caseSensitive?: boolean | undefined;
    maxFileSize?: number | undefined;
    createBackup?: boolean | undefined;
    batchSize?: number | undefined;
    enableCaching?: boolean | undefined;
    xmlMode?: boolean | undefined;
    decodeEntities?: boolean | undefined;
    dryRun?: boolean | undefined;
    includeSourceMaps?: boolean | undefined;
    formatOutput?: boolean | undefined;
    backupSuffix?: string | undefined;
    validateOutput?: boolean | undefined;
    lowerCaseAttributeNames?: boolean | undefined;
    recognizeSelfClosing?: boolean | undefined;
    wholeWordsOnly?: boolean | undefined;
    preserveOriginalPatterns?: boolean | undefined;
    indentSize?: number | undefined;
    useSpaces?: boolean | undefined;
    logChanges?: boolean | undefined;
}>;
type HtmlRewriteOptions = z.infer<typeof HtmlRewriteOptionsSchema>;
/**
 * Pattern match results and statistics
 */
interface PatternMatchResult {
    pattern: HtmlPattern;
    matches: Array<{
        element: cheerio.Cheerio<AnyNode>;
        originalValue: string;
        matchedPart: string;
        replacement: string;
        context: {
            tagName: string;
            position: number;
            parentSelector?: string;
        };
    }>;
    performance: {
        matchTime: number;
        elementCount: number;
    };
}
/**
 * Advanced pattern matching condition
 */
interface PatternCondition {
    type: 'attribute' | 'text' | 'tag' | 'parent' | 'sibling' | 'custom';
    selector?: string;
    attribute?: string;
    value?: string | RegExp;
    operator?: 'equals' | 'contains' | 'startsWith' | 'endsWith' | 'matches' | 'exists';
    negate?: boolean;
    customCheck?: (element: cheerio.Cheerio<AnyNode>, $: cheerio.CheerioAPI) => boolean;
}
/**
 * Pattern set for batch operations
 */
interface PatternSet {
    id: string;
    name: string;
    description?: string;
    patterns: HtmlPattern[];
    enabled: boolean;
    priority: number;
    executeInOrder: boolean;
    stopOnFirstMatch: boolean;
    conditions?: PatternCondition[];
}
/**
 * Enhanced HTML pattern with advanced matching capabilities
 */
interface HtmlPattern {
    id: string;
    name: string;
    description?: string;
    selector: string;
    attribute: string;
    pattern: string | RegExp;
    replacement: string | ((match: string, element: cheerio.Cheerio<AnyNode>, context: any) => string);
    conditions?: PatternCondition[];
    caseSensitive?: boolean;
    wholeWordOnly?: boolean;
    multipleMatches?: boolean;
    preserveCase?: boolean;
    escapeReplacement?: boolean;
    priority: number;
    enabled: boolean;
    runOnce?: boolean;
    maxMatches?: number;
    tags?: string[];
    excludeTags?: string[];
    parentSelector?: string;
    excludeParentSelector?: string;
    timeout?: number;
    cacheKey?: string;
}
/**
 * Result of a single pattern replacement operation
 */
interface PatternReplacement {
    patternId: string;
    elementSelector: string;
    originalValue: string;
    newValue: string;
    position: {
        line?: number;
        column?: number;
        index: number;
    };
    metadata: {
        tagName: string;
        attributes: Record<string, string>;
        depth: number;
        hasConflicts: boolean;
        appliedAt: Date;
    };
}
/**
 * Complete result of HTML rewriting operation
 */
interface HtmlRewriteResult {
    success: boolean;
    originalHtml: string;
    modifiedHtml: string;
    appliedReplacements: PatternReplacement[];
    skippedReplacements: Array<{
        patternId: string;
        reason: string;
        elementSelector: string;
    }>;
    conflicts: Array<{
        patternIds: string[];
        elementSelector: string;
        resolution: 'highest-priority' | 'first-match' | 'manual-review';
        chosenPatternId?: string;
    }>;
    metadata: {
        source: string;
        processedAt: Date;
        processingTime: number;
        fileSize?: number;
        backupPath?: string;
        totalElements: number;
        modifiedElements: number;
        errors: string[];
        warnings: string[];
    };
    statistics: {
        patternStats: Map<string, {
            attempts: number;
            successes: number;
            failures: number;
            conflicts: number;
        }>;
        elementStats: {
            totalProcessed: number;
            totalModified: number;
            averageDepth: number;
            tagDistribution: Map<string, number>;
        };
        performanceStats: {
            parseTime: number;
            processingTime: number;
            serializationTime: number;
            totalTime: number;
        };
    };
}
/**
 * Configuration for file backup operations
 */
interface BackupConfig {
    enabled: boolean;
    directory: string;
    suffix: string;
    maxBackups: number;
    compressOld: boolean;
    retentionDays: number;
}
/**
 * Cache for pattern matching and element tracking
 */
interface RewriteCache {
    parsedPatterns: Map<string, {
        compiled: RegExp;
        metadata: any;
    }>;
    elementCache: Map<string, cheerio.Cheerio<any>>;
    conflictCache: Map<string, string[]>;
    performanceCache: Map<string, number>;
    lastCleared: Date;
}
/**
 * Custom error classes for HTML rewriting operations
 */
declare class HtmlRewriteError extends Error {
    source?: string;
    operation?: string;
    cause?: Error;
    constructor(message: string, source?: string, operation?: string, cause?: Error);
}
declare class PatternValidationError extends HtmlRewriteError {
    patternId: string;
    validationErrors: string[];
    constructor(message: string, patternId: string, validationErrors: string[], cause?: Error);
}
declare class BackupError extends HtmlRewriteError {
    filePath: string;
    backupPath?: string;
    constructor(message: string, filePath: string, backupPath?: string, cause?: Error);
}
declare class ConflictResolutionError extends HtmlRewriteError {
    conflictingPatterns: string[];
    elementSelector: string;
    constructor(message: string, conflictingPatterns: string[], elementSelector: string, cause?: Error);
}
declare class HtmlValidationError extends HtmlRewriteError {
    validationErrors: string[];
    htmlFragment?: string;
    constructor(message: string, validationErrors: string[], htmlFragment?: string, cause?: Error);
}
interface FormatPreservationOptions {
    preserveWhitespace: boolean;
    preserveIndentation: boolean;
    preserveComments: boolean;
    preserveEmptyLines: boolean;
    indentationStyle: 'spaces' | 'tabs';
    indentationSize: number;
    lineEndings: 'lf' | 'crlf' | 'auto';
    trimTrailingWhitespace: boolean;
}
interface FormatAnalysis {
    indentationStyle: 'spaces' | 'tabs' | 'mixed' | 'none';
    indentationSize: number;
    lineEndings: 'lf' | 'crlf' | 'mixed';
    hasTrailingWhitespace: boolean;
    preservedWhitespace: Map<string, string>;
    preservedComments: Array<{
        content: string;
        position: number;
        type: 'before' | 'after' | 'inline';
    }>;
    originalFormatting: {
        totalLines: number;
        emptyLines: number[];
        indentationMap: Map<number, string>;
    };
}
interface HtmlRewriterIntegration {
    fileDiscovery?: any;
    nameGeneration?: any;
    cssGeneration?: any;
    config?: any;
}
interface BatchOperationOptions {
    concurrency: number;
    continueOnError: boolean;
    progressCallback?: (processed: number, total: number, current: string) => void;
    errorCallback?: (file: string, error: Error) => void;
    dryRun: boolean;
    createBackups: boolean;
    validateResults: boolean;
}
interface BatchOperationResult$1 {
    processedFiles: string[];
    successfulFiles: string[];
    failedFiles: Array<{
        file: string;
        error: string;
    }>;
    totalTime: number;
    statistics: {
        totalPatterns: number;
        totalReplacements: number;
        totalConflicts: number;
        averageProcessingTime: number;
    };
}
interface FileOperationOptions extends Partial<HtmlRewriteOptions> {
    encoding?: BufferEncoding;
    overwrite?: boolean;
    preservePermissions?: boolean;
    createBackup?: boolean;
    backupSuffix?: string;
    validateBeforeWrite?: boolean;
    atomic?: boolean;
}
/**
 * Main HTML rewriter class that handles pattern-based replacements
 */
declare class HtmlRewriter {
    private options;
    private patterns;
    private patternSets;
    private cache;
    private nameMapping?;
    private formatPreservation;
    private formatAnalysis?;
    private integration?;
    constructor(options?: Partial<HtmlRewriteOptions>);
    /**
     * Set the name mapping from the name generation system
     */
    setNameMapping(nameMapping: Map<string, string> | NameGenerationResult): void;
    /**
     * Add a pattern for HTML rewriting
     */
    addPattern(pattern: HtmlPattern): void;
    /**
     * Add multiple patterns at once
     */
    addPatterns(patterns: HtmlPattern[]): void;
    /**
     * Remove a pattern by ID
     */
    removePattern(patternId: string): boolean;
    /**
     * Get all registered patterns
     */
    getPatterns(): HtmlPattern[];
    /**
     * Rewrite HTML string using registered patterns
     */
    rewriteHtml(html: string, source?: string): Promise<HtmlRewriteResult>;
    /**
     * Rewrite HTML file using registered patterns
     */
    rewriteFile(filePath: string): Promise<HtmlRewriteResult>;
    /**
     * Process multiple files in batch
     */
    rewriteFiles(filePaths: string[]): Promise<HtmlRewriteResult[]>;
    /**
     * Load HTML with cheerio using configured options
     */
    private loadHtml;
    /**
     * Process all pattern replacements on the loaded HTML
     */
    private processReplacements;
    /**
     * Rewrite HTML string using registered patterns
     */
    private serializeHtml;
    /**
     * Validate pattern configuration
     */
    private validatePattern;
    /**
     * Create backup of original file
     */
    private createBackup;
    /**
     * Validate HTML output integrity
     */
    private validateHtmlOutput;
    /**
     * Create cache instance
     */
    private createCache;
    /**
     * Clear internal caches
     */
    private clearCache;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        parsedPatterns: number;
        elementCache: number;
        conflictCache: number;
        performanceCache: number;
        lastCleared: Date;
    };
    /**
     * Get rewriter statistics
     */
    getStats(): {
        patternsCount: number;
        enabledPatternsCount: number;
        options: HtmlRewriteOptions;
    };
    /**
     * Add a pattern set for batch operations
     */
    addPatternSet(patternSet: PatternSet): void;
    /**
     * Remove a pattern set
     */
    removePatternSet(patternSetId: string): boolean;
    /**
     * Get all pattern sets
     */
    getPatternSets(): PatternSet[];
    /**
     * Find patterns that match a specific element
     */
    findMatchingPatterns(html: string, elementSelector: string): PatternMatchResult[];
    /**
     * Check if a pattern would match an element (without applying)
     */
    wouldPatternMatch(html: string, elementSelector: string, patternId: string): boolean;
    /**
     * Advanced pattern matching with conditions
     */
    private findPatternMatches;
    /**
     * Evaluate pattern conditions
     */
    private evaluateConditions;
    /**
     * Evaluate condition value based on operator
     */
    private evaluateConditionValue;
    /**
     * Match a pattern against a value
     */
    private matchPattern;
    /**
     * Generate replacement value
     */
    private generateReplacement;
    /**
     * Preserve case from original to replacement
     */
    private preserveCase;
    /**
     * Escape HTML in replacement text
     */
    private escapeHtml;
    /**
     * Check if an element matches all pattern conditions
     */
    private elementMatchesPattern;
    /**
     * Generate a unique identifier for an element
     */
    private generateElementId;
    /**
     * Generate a CSS selector for an element
     */
    private generateElementSelector;
    /**
     * Get all attributes of an element as a record
     */
    private getElementAttributes;
    /**
     * Calculate the depth of an element in the DOM tree
     */
    private getElementDepth;
    /**
     * Calculate average depth of all elements
     */
    private calculateAverageDepth;
    /**
     * Calculate distribution of tag names
     */
    private calculateTagDistribution;
    /**
     * Detect overlapping patterns that would conflict on the same element
     */
    detectPatternOverlaps(html: string, elementSelector?: string): Array<{
        elementSelector: string;
        conflictingPatterns: Array<{
            patternId: string;
            matchedText: string;
            startIndex: number;
            endIndex: number;
            priority: number;
        }>;
        overlapType: 'exact' | 'partial' | 'nested' | 'adjacent';
        recommendedResolution: 'highest-priority' | 'merge' | 'split' | 'manual-review';
        severity: 'low' | 'medium' | 'high' | 'critical';
    }>;
    /**
     * Analyze the type and severity of pattern overlaps
     */
    private analyzePatternOverlaps;
    /**
     * Resolve conflicts using specified strategy
     */
    resolvePatternConflicts(conflicts: Array<{
        elementSelector: string;
        conflictingPatterns: Array<{
            patternId: string;
            matchedText: string;
            startIndex: number;
            endIndex: number;
            priority: number;
        }>;
        overlapType: 'exact' | 'partial' | 'nested' | 'adjacent';
        recommendedResolution: 'highest-priority' | 'merge' | 'split' | 'manual-review';
        severity: 'low' | 'medium' | 'high' | 'critical';
    }>, strategy?: 'auto' | 'highest-priority' | 'merge' | 'split' | 'manual-review'): Array<{
        elementSelector: string;
        resolution: 'highest-priority' | 'merge' | 'split' | 'manual-review' | 'skipped';
        chosenPatterns: string[];
        reason: string;
        success: boolean;
    }>;
    /**
     * Resolve conflict by choosing highest priority pattern
     */
    private resolveByHighestPriority;
    /**
     * Resolve conflict by merging compatible patterns
     */
    private resolveByMerging;
    /**
     * Resolve conflict by splitting overlapping regions
     */
    private resolveBySplitting;
    /**
     * Get conflict resolution statistics
     */
    getConflictStats(): {
        totalConflicts: number;
        resolvedConflicts: number;
        unresolvedConflicts: number;
        resolutionStrategies: Map<string, number>;
        severityDistribution: Map<string, number>;
    };
    /**
     * Analyze HTML format for preservation
     */
    private analyzeHtmlFormat;
    /**
     * Preserve whitespace around elements during processing
     */
    private preserveElementWhitespace;
    /**
     * Restore preserved formatting after processing
     */
    private restoreFormatting;
    /**
     * Configure format preservation options
     */
    setFormatPreservation(options: Partial<FormatPreservationOptions>): void;
    /**
     * Get current format preservation settings
     */
    getFormatPreservation(): FormatPreservationOptions;
    /**
     * Get format analysis for the last processed HTML
     */
    getFormatAnalysis(): FormatAnalysis | undefined;
    /**
     * Set integration components
     */
    setIntegration(integration: Partial<HtmlRewriterIntegration>): void;
    /**
     * Process files discovered by the file discovery system
     */
    processDiscoveredFiles(patterns?: string[], options?: Partial<BatchOperationOptions>): Promise<BatchOperationResult$1>;
    /**
     * Process a batch of files with configurable options
     */
    processBatch(filePaths: string[], options?: Partial<BatchOperationOptions>): Promise<BatchOperationResult$1>;
    /**
     * Enhanced file rewriting with advanced options
     */
    rewriteFileAdvanced(filePath: string, options?: FileOperationOptions): Promise<HtmlRewriteResult>;
    /**
     * Integration with name generation system
     */
    generateAndApplyNames(htmlContent: string, extractedClasses: string[]): Promise<{
        html: string;
        nameMapping: Map<string, string>;
    }>;
    /**
     * Create advanced backup with metadata
     */
    private createAdvancedBackup;
    /**
     * Atomic write operation (write to temp file then rename)
     */
    private atomicWrite;
    /**
     * Validate rewrite result before writing
     */
    private validateRewriteResult;
    /**
     * Utility function to chunk array for batch processing
     */
    private chunkArray;
    /**
     * Get integration status
     */
    getIntegrationStatus(): {
        fileDiscovery: boolean;
        nameGeneration: boolean;
        cssGeneration: boolean;
        config: boolean;
    };
}
/**
 * Utility function to create HTML rewriter with default options
 */
declare function createHtmlRewriter(options?: Partial<HtmlRewriteOptions>): HtmlRewriter;
/**
 * Utility function to rewrite HTML string with simple patterns
 */
declare function rewriteHtmlString(html: string, patterns: HtmlPattern[], options?: Partial<HtmlRewriteOptions>): Promise<HtmlRewriteResult>;
/**
 * Utility function to rewrite HTML file with simple patterns
 */
declare function rewriteHtmlFile(filePath: string, patterns: HtmlPattern[], options?: Partial<HtmlRewriteOptions>): Promise<HtmlRewriteResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Supported JavaScript file types for pattern replacement
 */
type JavaScriptFileType = 'js' | 'jsx' | 'ts' | 'tsx' | 'mjs' | 'cjs';
/**
 * Context information for pattern replacement decisions
 */
interface JSReplacementContext {
    /** Current file path being processed */
    filePath: string;
    /** Detected file type */
    fileType: JavaScriptFileType;
    /** Whether the file contains JSX syntax */
    hasJSX: boolean;
    /** Whether the file uses TypeScript */
    hasTypeScript: boolean;
    /** Framework context (React, Vue, Angular, etc.) */
    framework?: string;
    /** Line number of the current pattern */
    line: number;
    /** Column number of the current pattern */
    column: number;
    /** Surrounding AST node context */
    nodeType: string;
    /** Parent node context for better decision making */
    parentNodeType?: string;
    /** JSX-specific context information */
    jsxContext?: {
        /** Whether this is within a JSX attribute */
        isJSXAttribute?: boolean;
        /** Name of the JSX attribute */
        attributeName?: string;
        /** Whether this is a className attribute specifically */
        isClassNameAttribute?: boolean;
        /** Whether this is JSX text content */
        isJSXText?: boolean;
    };
}
/**
 * Pattern replacement rule for JavaScript/JSX code
 */
interface JSPatternRule {
    /** Unique identifier for this rule */
    id: string;
    /** Human-readable description */
    description: string;
    /** Regular expression pattern to match */
    pattern: RegExp;
    /** Replacement string or function */
    replacement: string | ((match: string, context: JSReplacementContext) => string);
    /** Priority for conflict resolution (higher = more important) */
    priority: number;
    /** Whether this rule is enabled */
    enabled: boolean;
    /** File types this rule applies to */
    fileTypes?: JavaScriptFileType[];
    /** Whether this rule should only apply to JSX attributes */
    jsxOnly?: boolean;
    /** Whether this rule should only apply to template literals */
    templateLiteralsOnly?: boolean;
    /** Custom validation function */
    validator?: (context: JSReplacementContext) => boolean;
}
/**
 * Configuration for conflict resolution between overlapping patterns
 */
interface JSConflictResolutionConfig {
    /** Strategy to use when patterns conflict */
    strategy: 'priority' | 'merge' | 'split' | 'auto';
    /** Whether to preserve original spacing in conflicts */
    preserveSpacing: boolean;
    /** Custom conflict resolver function */
    customResolver?: (conflicts: PatternMatch[], context: JSReplacementContext) => PatternMatch[];
}
/**
 * Options for format preservation during replacement
 */
interface JSFormatPreservationOptions {
    /** Preserve original indentation style */
    preserveIndentation: boolean;
    /** Preserve original quote style (single/double/template) */
    preserveQuoteStyle: boolean;
    /** Preserve original semicolon usage */
    preserveSemicolons: boolean;
    /** Preserve original comment formatting */
    preserveComments: boolean;
    /** Custom formatting rules */
    customFormatting?: {
        /** Maximum line length before wrapping */
        maxLineLength?: number;
        /** Indentation type (spaces/tabs) */
        indentType?: 'spaces' | 'tabs';
        /** Number of spaces/tabs for indentation */
        indentSize?: number;
    };
}
/**
 * Performance optimization settings
 */
interface JSPerformanceOptions {
    /** Enable caching of parsed ASTs */
    enableCaching: boolean;
    /** Maximum number of files to cache */
    maxCacheSize: number;
    /** Enable parallel processing for multiple files */
    enableParallelProcessing: boolean;
    /** Maximum number of concurrent operations */
    maxConcurrency: number;
    /** Memory usage limits */
    memoryLimits?: {
        /** Maximum memory per file (MB) */
        maxMemoryPerFile: number;
        /** Maximum total memory usage (MB) */
        maxTotalMemory: number;
    };
}
/**
 * Comprehensive configuration for JavaScript pattern replacement
 */
interface JSRewriterConfig {
    /** Pattern replacement rules */
    rules: JSPatternRule[];
    /** Conflict resolution configuration */
    conflictResolution: JSConflictResolutionConfig;
    /** Format preservation options */
    formatPreservation: JSFormatPreservationOptions;
    /** Performance optimization settings */
    performance: JSPerformanceOptions;
    /** Babel parser options */
    parserOptions?: Partial<ParserOptions>;
    /** Whether to generate source maps */
    generateSourceMaps: boolean;
    /** Error handling strategy */
    errorHandling: {
        /** Continue processing on parse errors */
        continueOnError: boolean;
        /** Maximum number of errors before stopping */
        maxErrors: number;
        /** Custom error handler */
        onError?: (error: Error, context: {
            filePath: string;
            phase: string;
        }) => void;
    };
}
/**
 * Information about a matched pattern
 */
interface PatternMatch {
    /** The rule that created this match */
    rule: JSPatternRule;
    /** Original matched text */
    originalText: string;
    /** Replacement text */
    replacementText: string;
    /** Start position in the source */
    start: number;
    /** End position in the source */
    end: number;
    /** Line number */
    line: number;
    /** Column number */
    column: number;
    /** Replacement context */
    context: JSReplacementContext;
    /** AST node that contains this match */
    astNode: t.Node;
    /** Path to the AST node */
    nodePath: NodePath;
}
/**
 * Result of pattern replacement operation
 */
interface JSReplacementResult {
    /** Whether any replacements were made */
    modified: boolean;
    /** Final transformed code */
    code: string;
    /** Source map if requested */
    sourceMap?: any;
    /** Number of replacements made */
    replacementCount: number;
    /** Details of all replacements */
    replacements: PatternMatch[];
    /** Any errors encountered */
    errors: Array<{
        message: string;
        line?: number;
        column?: number;
        phase: string;
    }>;
    /** Performance metrics */
    performance: {
        /** Parse time in milliseconds */
        parseTime: number;
        /** Transform time in milliseconds */
        transformTime: number;
        /** Generate time in milliseconds */
        generateTime: number;
        /** Total time in milliseconds */
        totalTime: number;
        /** Peak memory usage in MB */
        peakMemory: number;
    };
}
/**
 * Options for batch file processing
 */
interface JSBatchProcessingOptions {
    /** Input directory or file patterns */
    input: string | string[];
    /** Output directory (if different from input) */
    outputDir?: string;
    /** File extension mapping for output files */
    extensionMapping?: Record<string, string>;
    /** Whether to create backups before modification */
    createBackups: boolean;
    /** Backup directory */
    backupDir?: string;
    /** Maximum number of files to process concurrently */
    maxConcurrency: number;
    /** Progress callback */
    onProgress?: (processed: number, total: number, currentFile: string) => void;
    /** File filter function */
    fileFilter?: (filePath: string) => boolean;
}
/**
 * Default configuration for JavaScript pattern replacement
 */
declare const DEFAULT_JS_REWRITER_CONFIG: JSRewriterConfig;
/**
 * Main JavaScript pattern replacement class
 */
declare class JSRewriter {
    private config;
    private astCache;
    private statistics;
    /**
     * Create a new JavaScript rewriter instance
     */
    constructor(config?: Partial<JSRewriterConfig>);
    /**
     * Get current configuration
     */
    getConfig(): Readonly<JSRewriterConfig>;
    /**
     * Update configuration
     */
    updateConfig(updates: Partial<JSRewriterConfig>): void;
    /**
     * Add a new pattern rule
     */
    addRule(rule: JSPatternRule): void;
    /**
     * Remove a pattern rule by ID
     */
    removeRule(ruleId: string): boolean;
    /**
     * Get all pattern rules
     */
    getRules(): readonly JSPatternRule[];
    /**
     * Get processing statistics
     */
    getStatistics(): {
        filesProcessed: number;
        totalReplacements: number;
        totalErrors: number;
        avgProcessingTime: number;
    };
    /**
     * Clear processing statistics
     */
    clearStatistics(): void;
    /**
     * Clear AST cache
     */
    clearCache(): void;
    /**
     * Detect JavaScript file type from file path or content
     */
    detectFileType(filePath: string, content?: string): JavaScriptFileType;
    /**
     * Process a single JavaScript file
     */
    processFile(filePath: string, outputPath?: string): Promise<JSReplacementResult>;
    /**
     * Process JavaScript code string
     */
    processCode(code: string, filePath?: string): Promise<JSReplacementResult>;
    /**
     * Process multiple files in batch
     */
    processBatch(_options: JSBatchProcessingOptions): Promise<{
        results: Array<{
            filePath: string;
            result: JSReplacementResult;
        }>;
        summary: {
            totalFiles: number;
            successfulFiles: number;
            failedFiles: number;
            totalReplacements: number;
            totalErrors: number;
            avgProcessingTime: number;
        };
    }>;
    /**
     * Parse JavaScript code into AST
     */
    private parseCode;
    /**
     * Get appropriate parser plugins for file type
     */
    private getParserPlugins;
    /**
     * Transform AST by applying pattern rules
     */
    private transformAST;
    /**
     * Apply resolved matches to the AST
     */
    private applyMatchesToAST;
    /**
     * Apply matches to a specific AST node
     */
    private applyMatchesToNode;
    /**
     * Apply matches to a string literal node
     */
    private applyStringLiteralMatches;
    /**
     * Apply matches to a template literal node
     */
    private applyTemplateLiteralMatches;
    /**
     * Apply matches to a JSX text node
     */
    private applyJSXTextMatches;
    /**
     * Detect conflicts between pattern matches
     */
    private detectConflicts;
    /**
     * Analyze conflict between two specific matches
     */
    private analyzeMatchConflict;
    /**
     * Resolve conflicts using the configured strategy
     */
    private resolveConflicts;
    /**
     * Resolve conflicts using priority strategy (highest priority rule wins)
     */
    private resolvePriorityStrategy;
    /**
     * Resolve conflicts using merge strategy (combine compatible rules)
     */
    private resolveMergeStrategy;
    /**
     * Resolve conflicts using split strategy (split overlapping patterns)
     */
    private resolveSplitStrategy;
    /**
     * Resolve conflicts using auto strategy (choose best approach per conflict)
     */
    private resolveAutoStrategy;
    /**
     * Group conflicting matches that affect the same text regions
     */
    private groupConflictingMatches;
    /**
     * Check if two matches overlap in their text positions
     */
    private matchesOverlap;
    /**
     * Detect framework from code content
     */
    private detectFramework;
    /**
     * Merge two configuration objects
     */
    private mergeConfig;
    /**
     * Set up error handling
     */
    private setupErrorHandling;
    /**
     * Update processing statistics
     */
    private updateStatistics;
    /**
     * Preserve original quote styles in generated code
     */
    private preserveOriginalQuoteStyles;
    /**
     * Escape special regex characters
     */
    private escapeRegex;
    /**
     * Create processing context for pattern matching
     */
    private createProcessingContext;
    /**
     * Get applicable rules for the given context
     */
    private getApplicableRules;
    /**
     * Collect potential matches from string literal nodes without applying transformations
     */
    private collectStringMatches;
    /**
     * Collect potential matches from template literal nodes without applying transformations
     */
    private collectTemplateMatches;
    /**
     * Collect potential matches from JSX attribute nodes without applying transformations
     */
    private collectJSXAttributeMatches;
    /**
     * Collect potential matches from JSX text nodes without applying transformations
     */
    private collectJSXTextMatches;
    /**
     * Collect JSX string value matches without applying transformations
     */
    private collectJSXStringValue;
    /**
     * Process JSX template literal values within attributes
     */
    private collectJSXTemplateValue;
    /**
     * Process JSX conditional expressions in attributes
     */
    private collectJSXConditionalValue;
    /**
     * Find pattern matches in text using the given rule
     */
    private findPatternMatches;
    /**
     * Validate replacement context to prevent unwanted transformations
     */
    private validateReplacementContext;
    /**
     * Check if a string literal is in a TypeScript type context using NodePath
     */
    private isInTypeScriptTypeContext;
    /**
     * Check if a node is contained within a type annotation
     */
    private isNodeInTypeAnnotation;
}
/**
 * Utility functions for common JavaScript pattern replacement tasks
 */
declare class JSRewriterUtils {
    /**
     * Create a rule for replacing Tailwind class names in className attributes
     */
    static createClassNameRule(id: string, pattern: RegExp, replacement: string | ((match: string, context: JSReplacementContext) => string), priority?: number): JSPatternRule;
    /**
     * Create a rule for replacing class names in template literals
     */
    static createTemplateLiteralRule(id: string, pattern: RegExp, replacement: string | ((match: string, context: JSReplacementContext) => string), priority?: number): JSPatternRule;
    /**
     * Create a rule for any string literal replacement
     */
    static createStringLiteralRule(id: string, pattern: RegExp, replacement: string | ((match: string, context: JSReplacementContext) => string), priority?: number): JSPatternRule;
    /**
     * Validate a pattern rule
     */
    static validateRule(rule: JSPatternRule): string[];
    /**
     * Merge multiple pattern rules with conflict resolution
     */
    static mergeRules(rules: JSPatternRule[], strategy?: 'priority' | 'merge'): JSPatternRule[];
}
/**
 * Factory for creating pre-configured JSRewriter instances
 */
declare class JSRewriterFactory {
    /**
     * Create a JSRewriter instance optimized for React/JSX files
     */
    static createReactRewriter(customConfig?: Partial<JSRewriterConfig>): JSRewriter;
    /**
     * Create a JSRewriter instance optimized for TypeScript files
     */
    static createTypeScriptRewriter(customConfig?: Partial<JSRewriterConfig>): JSRewriter;
    /**
     * Create a JSRewriter instance with performance optimizations for large codebases
     */
    static createHighPerformanceRewriter(customConfig?: Partial<JSRewriterConfig>): JSRewriter;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * CSS class pattern information
 */
interface ClassPattern {
    pattern: string;
    type: 'utility' | 'component' | 'responsive' | 'state' | 'arbitrary' | 'custom';
    framework: 'tailwind' | 'bootstrap' | 'custom' | 'unknown';
    frequency: number;
    files: string[];
    variants: string[];
    complexity: number;
    optimizable: boolean;
    optimizationSuggestions: string[];
    examples: Array<{
        file: string;
        line: number;
        context: string;
        usage: string;
    }>;
}
/**
 * Class analysis result
 */
interface ClassAnalysisResult {
    totalClasses: number;
    uniqueClasses: number;
    duplicateClasses: number;
    patterns: ClassPattern[];
    frameworkBreakdown: {
        tailwind: number;
        bootstrap: number;
        custom: number;
        unknown: number;
    };
    typeBreakdown: {
        utility: number;
        component: number;
        responsive: number;
        state: number;
        arbitrary: number;
        custom: number;
    };
    optimizationOpportunities: {
        duplicateRemoval: number;
        classShortening: number;
        patternConsolidation: number;
        unusedClasses: number;
    };
    complexityScore: number;
    recommendations: string[];
}
/**
 * Debug session information
 */
interface DebugSession {
    id: string;
    timestamp: Date;
    config: EnigmaConfig;
    files: string[];
    analysis: ClassAnalysisResult;
    optimizationSteps: Array<{
        step: string;
        description: string;
        before: any;
        after: any;
        impact: {
            sizeReduction: number;
            classesAffected: number;
            filesModified: number;
        };
    }>;
    performance: {
        analysisTime: number;
        optimizationTime: number;
        totalTime: number;
        memoryUsage: number;
    };
}
/**
 * Debug configuration
 */
interface DebugConfig {
    enabled: boolean;
    verbose: boolean;
    saveSession: boolean;
    outputPath: string;
    includeSourceMaps: boolean;
    trackPerformance: boolean;
    analyzePatterns: boolean;
    generateRecommendations: boolean;
    maxFileSize: number;
    excludePatterns: string[];
}
/**
 * Debug utilities for CSS class pattern analysis
 * Provides comprehensive debugging and analysis tools for developers
 */
declare class DebugUtils {
    private logger;
    private config;
    private currentSession?;
    private patternCache;
    constructor(config?: Partial<DebugConfig>);
    /**
     * Start a new debug session
     */
    startSession(files: string[], enigmaConfig: EnigmaConfig): Promise<string>;
    /**
     * End the current debug session
     */
    endSession(): Promise<DebugSession | null>;
    /**
     * Analyze CSS classes in files
     */
    analyzeClasses(files: string[]): Promise<ClassAnalysisResult>;
    /**
     * Add an optimization step to the current session
     */
    addOptimizationStep(step: string, description: string, before: any, after: any, impact: {
        sizeReduction: number;
        classesAffected: number;
        filesModified: number;
    }): void;
    /**
     * Get debug information for a specific class
     */
    getClassDebugInfo(className: string): ClassPattern | null;
    /**
     * Generate a debug report
     */
    generateDebugReport(): string;
    /**
     * Export debug data as JSON
     */
    exportDebugData(): any;
    /**
     * Update debug configuration
     */
    updateConfig(newConfig: Partial<DebugConfig>): void;
    /**
     * Extract classes from file content
     */
    private extractClassesFromFile;
    /**
     * Analyze a class pattern
     */
    private analyzeClassPattern;
    /**
     * Classify class type
     */
    private classifyType;
    /**
     * Classify framework
     */
    private classifyFramework;
    /**
     * Extract variants from class name
     */
    private extractVariants;
    /**
     * Calculate class complexity
     */
    private calculateClassComplexity;
    /**
     * Check if class is optimizable
     */
    private isOptimizable;
    /**
     * Generate optimization suggestions
     */
    private generateOptimizationSuggestions;
    /**
     * Calculate framework breakdown
     */
    private calculateFrameworkBreakdown;
    /**
     * Calculate type breakdown
     */
    private calculateTypeBreakdown;
    /**
     * Calculate optimization opportunities
     */
    private calculateOptimizationOpportunities;
    /**
     * Calculate overall complexity score
     */
    private calculateComplexityScore;
    /**
     * Generate recommendations
     */
    private generateRecommendations;
    /**
     * Check if class name is valid
     */
    private isValidClassName;
    /**
     * Generate unique session ID
     */
    private generateSessionId;
    /**
     * Save debug session to file
     */
    private saveSession;
}
/**
 * Create and configure debug utilities
 */
declare function createDebugUtils(config: EnigmaConfig): DebugUtils | null;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Path calculation options schema
 */
declare const PathCalculationOptionsSchema: z.ZodObject<{
    /** Use relative paths instead of absolute paths */
    useRelativePaths: z.ZodDefault<z.ZodBoolean>;
    /** Base path for resolving relative paths */
    basePath: z.ZodOptional<z.ZodString>;
    /** Whether to normalize paths for web use (forward slashes) */
    normalizeForWeb: z.ZodDefault<z.ZodBoolean>;
    /** Maximum allowed path depth to prevent excessive nesting */
    maxDepth: z.ZodDefault<z.ZodNumber>;
    /** Whether to resolve symbolic links */
    resolveSymlinks: z.ZodDefault<z.ZodBoolean>;
    /** Enable path traversal protection */
    enableSecurity: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    useRelativePaths: boolean;
    normalizeForWeb: boolean;
    maxDepth: number;
    resolveSymlinks: boolean;
    enableSecurity: boolean;
    basePath?: string | undefined;
}, {
    basePath?: string | undefined;
    useRelativePaths?: boolean | undefined;
    normalizeForWeb?: boolean | undefined;
    maxDepth?: number | undefined;
    resolveSymlinks?: boolean | undefined;
    enableSecurity?: boolean | undefined;
}>;
type PathCalculationOptions = z.infer<typeof PathCalculationOptionsSchema>;
/**
 * Path validation result
 */
interface PathValidationResult {
    isValid: boolean;
    normalizedPath: string;
    errors: string[];
    warnings: string[];
    security: {
        hasTraversal: boolean;
        isAbsolute: boolean;
        depth: number;
    };
}
/**
 * Relative path calculation result
 */
interface RelativePathResult {
    relativePath: string;
    isValid: boolean;
    normalizedPath: string;
    metadata: {
        fromPath: string;
        toPath: string;
        basePath?: string;
        platformSeparators: string;
        webPath: string;
        depth: number;
    };
}
/**
 * Custom error classes for path operations
 */
declare class PathUtilsError extends Error {
    code: string;
    cause?: Error;
    constructor(message: string, code: string, cause?: Error);
}
declare class PathSecurityError extends PathUtilsError {
    path: string;
    constructor(message: string, path: string, cause?: Error);
}
declare class PathValidationError extends PathUtilsError {
    path: string;
    constructor(message: string, path: string, cause?: Error);
}
/**
 * Enhanced path utilities class with caching and security features
 */
declare class PathUtils {
    private readonly options;
    private pathCache;
    private validationCache;
    private readonly maxCacheSize;
    constructor(options?: Partial<PathCalculationOptions>);
    /**
     * Calculate relative path from one file to another
     */
    calculateRelativePath(fromPath: string, toPath: string, options?: Partial<PathCalculationOptions>): RelativePathResult;
    /**
     * Validate a path for security and correctness
     */
    validatePath(inputPath: string, context?: string): PathValidationResult;
    /**
     * Normalize path for comparison and consistency
     */
    normalizePath(inputPath: string, forWeb?: boolean): string;
    /**
     * Normalize path for web use (forward slashes only)
     */
    private normalizeForWeb;
    /**
     * Normalize path using platform-specific separators
     */
    private normalizePlatformPath;
    /**
     * Calculate the depth of a path (number of directory levels)
     */
    private calculatePathDepth;
    /**
     * Perform security checks on calculated paths
     */
    private performSecurityCheck;
    /**
     * Cache management
     */
    private cacheResult;
    private cacheValidationResult;
    /**
     * Clear all caches
     */
    clearCache(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        paths: number;
        validations: number;
        maxSize: number;
    };
}
/**
 * Utility functions for common path operations
 */
/**
 * Create a PathUtils instance with default options
 */
declare function createPathUtils(options?: Partial<PathCalculationOptions>): PathUtils;
/**
 * Quick relative path calculation
 */
declare function calculateRelativePath(fromPath: string, toPath: string, options?: Partial<PathCalculationOptions>): string;
/**
 * Quick path validation
 */
declare function validatePath(inputPath: string, context?: string): PathValidationResult;
/**
 * Quick path normalization
 */
declare function normalizePath(inputPath: string, forWeb?: boolean): string;
/**
 * Check if a path is safe (no security issues)
 */
declare function isPathSafe(inputPath: string): boolean;
/**
 * Batch path operations for performance
 */
declare function calculateRelativePathsBatch(pairs: Array<{
    from: string;
    to: string;
}>, options?: Partial<PathCalculationOptions>): RelativePathResult[];

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Supported file types for CSS optimization
 */
declare const SUPPORTED_FILE_TYPES: {
    readonly HTML: string[];
    readonly JAVASCRIPT: string[];
    readonly CSS: string[];
    readonly TEMPLATE: string[];
};
/**
 * All supported file extensions
 */
declare const ALL_SUPPORTED_EXTENSIONS: string[];
/**
 * File discovery options
 */
interface FileDiscoveryOptions {
    /** Glob patterns to search for files */
    patterns: string | string[];
    /** Working directory for pattern resolution */
    cwd?: string;
    /** File types to include (default: HTML and JS) */
    includeTypes?: (keyof typeof SUPPORTED_FILE_TYPES)[];
    /** File extensions to explicitly include */
    includeExtensions?: string[];
    /** File extensions to explicitly exclude */
    excludeExtensions?: string[];
    /** Patterns to exclude from results */
    excludePatterns?: string[];
    /** Follow symbolic links (default: false) */
    followSymlinks?: boolean;
    /** Maximum number of files to return (default: no limit) */
    maxFiles?: number;
    /** Whether to return absolute paths (default: false) */
    absolutePaths?: boolean;
}
/**
 * File discovery result
 */
interface FileDiscoveryResult {
    /** Found file paths */
    files: string[];
    /** Total number of files found */
    count: number;
    /** Number of files by type */
    breakdown: Record<string, number>;
    /** Patterns that matched files */
    matchedPatterns: string[];
    /** Patterns that didn't match any files */
    emptyPatterns: string[];
    /** Time taken for discovery in milliseconds */
    duration: number;
}
/**
 * Custom error class for file discovery operations
 */
declare class FileDiscoveryError extends Error {
    code: string;
    patterns?: string | string[];
    cause?: Error;
    constructor(message: string, code: string, patterns?: string | string[], cause?: Error);
}
/**
 * Validates a glob pattern for common issues
 */
declare function validateGlobPattern(pattern: string): void;
/**
 * Validates file discovery options
 */
declare function validateOptions(options: FileDiscoveryOptions): void;
/**
 * Determines if a file should be included based on extension filtering
 */
declare function shouldIncludeFile(filePath: string, options: FileDiscoveryOptions): boolean;
/**
 * Gets the file type category for a file path
 */
declare function getFileType(filePath: string): string;
/**
 * Removes duplicate file paths and sorts them
 */
declare function deduplicateAndSort(files: string[]): string[];
/**
 * Discovers files using glob patterns (synchronous)
 */
declare function discoverFilesSync(options: FileDiscoveryOptions): FileDiscoveryResult;
/**
 * Discovers files using glob patterns (asynchronous)
 */
declare function discoverFiles(options: FileDiscoveryOptions): Promise<FileDiscoveryResult>;
/**
 * Convenience function to discover files from configuration
 */
declare function discoverFilesFromConfig(config: EnigmaConfig): FileDiscoveryResult;
/**
 * Convenience function to discover files from configuration (async)
 */
declare function discoverFilesFromConfigAsync(config: EnigmaConfig): Promise<FileDiscoveryResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * File integrity validation options schema
 */
declare const FileIntegrityOptionsSchema: z.ZodObject<{
    /** Hash algorithm to use for checksums (default: 'sha256') */
    algorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "sha512"]>>;
    /** Whether to create backups before file modifications (default: true) */
    createBackups: z.ZodDefault<z.ZodBoolean>;
    /** Directory for storing backup files (default: '.backups') */
    backupDirectory: z.ZodDefault<z.ZodString>;
    /** Maximum age of backup files in days before cleanup (default: 7) */
    backupRetentionDays: z.ZodDefault<z.ZodNumber>;
    /** Maximum file size to process in bytes (default: 100MB) */
    maxFileSize: z.ZodDefault<z.ZodNumber>;
    /** Timeout for file operations in milliseconds (default: 30000) */
    timeout: z.ZodDefault<z.ZodNumber>;
    /** Whether to verify checksums after rollback operations (default: true) */
    verifyAfterRollback: z.ZodDefault<z.ZodBoolean>;
    /** Batch size for multiple file operations (default: 10) */
    batchSize: z.ZodDefault<z.ZodNumber>;
    /** Whether to cache checksums for performance (default: true) */
    enableCaching: z.ZodDefault<z.ZodBoolean>;
    /** Cache size limit for stored checksums (default: 1000) */
    cacheSize: z.ZodDefault<z.ZodNumber>;
    /** Whether to enable compression for backup files (default: false) */
    enableCompression: z.ZodDefault<z.ZodBoolean>;
    /** Compression algorithm to use (default: 'gzip') */
    compressionAlgorithm: z.ZodDefault<z.ZodEnum<["gzip", "deflate", "brotli"]>>;
    /** Compression level (1-9 for gzip/deflate, 0-11 for brotli, default: 6) */
    compressionLevel: z.ZodDefault<z.ZodNumber>;
    /** Minimum file size in bytes to compress (default: 1KB) */
    compressionThreshold: z.ZodDefault<z.ZodNumber>;
    /** Whether to enable deduplication for backup files (default: false) */
    enableDeduplication: z.ZodDefault<z.ZodBoolean>;
    /** Directory for storing deduplicated content (default: '.dedup') */
    deduplicationDirectory: z.ZodDefault<z.ZodString>;
    /** Hash algorithm for content deduplication (default: 'sha256') */
    deduplicationAlgorithm: z.ZodDefault<z.ZodEnum<["md5", "sha1", "sha256", "sha512"]>>;
    /** Minimum file size in bytes to deduplicate (default: 1KB) */
    deduplicationThreshold: z.ZodDefault<z.ZodNumber>;
    /** Whether to use hard links for deduplication (platform dependent, default: true) */
    useHardLinks: z.ZodDefault<z.ZodBoolean>;
    /** Whether to enable incremental backup strategy (default: false) */
    enableIncrementalBackup: z.ZodDefault<z.ZodBoolean>;
    /** Backup strategy to use (default: 'auto') */
    backupStrategy: z.ZodDefault<z.ZodEnum<["full", "incremental", "auto"]>>;
    /** Change detection method for incremental backups (default: 'mtime') */
    changeDetectionMethod: z.ZodDefault<z.ZodEnum<["mtime", "checksum", "hybrid"]>>;
    /** Maximum incremental chain length before forcing full backup (default: 10) */
    maxIncrementalChain: z.ZodDefault<z.ZodNumber>;
    /** Time threshold for forcing full backup in hours (default: 24 = 1 day) */
    fullBackupInterval: z.ZodDefault<z.ZodNumber>;
    /** Incremental backup metadata directory (default: '.incremental') */
    incrementalDirectory: z.ZodDefault<z.ZodString>;
    /** Whether to enable differential backup strategy (default: false) */
    enableDifferentialBackup: z.ZodDefault<z.ZodBoolean>;
    /** Differential backup strategy selection (default: 'auto') */
    differentialStrategy: z.ZodDefault<z.ZodEnum<["auto", "manual", "threshold-based"]>>;
    /** Size threshold in MB for triggering new full backup in differential strategy (default: 1000) */
    differentialFullBackupThreshold: z.ZodDefault<z.ZodNumber>;
    /** Time threshold in hours for forcing full backup in differential strategy (default: 168 = 1 week) */
    differentialFullBackupInterval: z.ZodDefault<z.ZodNumber>;
    /** Differential backup metadata directory (default: '.differential') */
    differentialDirectory: z.ZodDefault<z.ZodString>;
    /** Maximum cumulative size multiplier before forcing full backup (default: 5x original) */
    differentialSizeMultiplier: z.ZodDefault<z.ZodNumber>;
    /** Enable batch processing for large file sets (default: true) */
    enableBatchProcessing: z.ZodDefault<z.ZodBoolean>;
    /** Minimum batch size (default: 10) */
    minBatchSize: z.ZodDefault<z.ZodNumber>;
    /** Maximum batch size (default: 1000) */
    maxBatchSize: z.ZodDefault<z.ZodNumber>;
    /** Enable dynamic batch sizing based on system metrics (default: true) */
    dynamicBatchSizing: z.ZodDefault<z.ZodBoolean>;
    /** Memory usage threshold for dynamic sizing (percentage, default: 80) */
    memoryThreshold: z.ZodDefault<z.ZodNumber>;
    /** CPU usage threshold for dynamic sizing (percentage, default: 70) */
    cpuThreshold: z.ZodDefault<z.ZodNumber>;
    /** Event loop lag threshold for dynamic sizing (milliseconds, default: 100) */
    eventLoopLagThreshold: z.ZodDefault<z.ZodNumber>;
    /** Batch processing strategy (default: 'adaptive') */
    batchProcessingStrategy: z.ZodDefault<z.ZodEnum<["sequential", "parallel", "adaptive"]>>;
    /** Enable progress tracking for long-running operations (default: true) */
    enableProgressTracking: z.ZodDefault<z.ZodBoolean>;
    /** Progress update interval in milliseconds (default: 1000) */
    progressUpdateInterval: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    enableProgressTracking: boolean;
    timeout: number;
    algorithm: "md5" | "sha1" | "sha256" | "sha512";
    maxFileSize: number;
    createBackups: boolean;
    backupDirectory: string;
    backupRetentionDays: number;
    verifyAfterRollback: boolean;
    batchSize: number;
    enableCaching: boolean;
    cacheSize: number;
    enableCompression: boolean;
    compressionAlgorithm: "gzip" | "deflate" | "brotli";
    compressionLevel: number;
    compressionThreshold: number;
    enableDeduplication: boolean;
    deduplicationDirectory: string;
    deduplicationAlgorithm: "md5" | "sha1" | "sha256" | "sha512";
    deduplicationThreshold: number;
    useHardLinks: boolean;
    enableIncrementalBackup: boolean;
    backupStrategy: "full" | "incremental" | "auto";
    changeDetectionMethod: "mtime" | "checksum" | "hybrid";
    maxIncrementalChain: number;
    fullBackupInterval: number;
    incrementalDirectory: string;
    enableDifferentialBackup: boolean;
    differentialStrategy: "auto" | "manual" | "threshold-based";
    differentialFullBackupThreshold: number;
    differentialFullBackupInterval: number;
    differentialDirectory: string;
    differentialSizeMultiplier: number;
    enableBatchProcessing: boolean;
    minBatchSize: number;
    maxBatchSize: number;
    dynamicBatchSizing: boolean;
    memoryThreshold: number;
    cpuThreshold: number;
    eventLoopLagThreshold: number;
    batchProcessingStrategy: "sequential" | "parallel" | "adaptive";
    progressUpdateInterval: number;
}, {
    enableProgressTracking?: boolean | undefined;
    timeout?: number | undefined;
    algorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
    maxFileSize?: number | undefined;
    createBackups?: boolean | undefined;
    backupDirectory?: string | undefined;
    backupRetentionDays?: number | undefined;
    verifyAfterRollback?: boolean | undefined;
    batchSize?: number | undefined;
    enableCaching?: boolean | undefined;
    cacheSize?: number | undefined;
    enableCompression?: boolean | undefined;
    compressionAlgorithm?: "gzip" | "deflate" | "brotli" | undefined;
    compressionLevel?: number | undefined;
    compressionThreshold?: number | undefined;
    enableDeduplication?: boolean | undefined;
    deduplicationDirectory?: string | undefined;
    deduplicationAlgorithm?: "md5" | "sha1" | "sha256" | "sha512" | undefined;
    deduplicationThreshold?: number | undefined;
    useHardLinks?: boolean | undefined;
    enableIncrementalBackup?: boolean | undefined;
    backupStrategy?: "full" | "incremental" | "auto" | undefined;
    changeDetectionMethod?: "mtime" | "checksum" | "hybrid" | undefined;
    maxIncrementalChain?: number | undefined;
    fullBackupInterval?: number | undefined;
    incrementalDirectory?: string | undefined;
    enableDifferentialBackup?: boolean | undefined;
    differentialStrategy?: "auto" | "manual" | "threshold-based" | undefined;
    differentialFullBackupThreshold?: number | undefined;
    differentialFullBackupInterval?: number | undefined;
    differentialDirectory?: string | undefined;
    differentialSizeMultiplier?: number | undefined;
    enableBatchProcessing?: boolean | undefined;
    minBatchSize?: number | undefined;
    maxBatchSize?: number | undefined;
    dynamicBatchSizing?: boolean | undefined;
    memoryThreshold?: number | undefined;
    cpuThreshold?: number | undefined;
    eventLoopLagThreshold?: number | undefined;
    batchProcessingStrategy?: "sequential" | "parallel" | "adaptive" | undefined;
    progressUpdateInterval?: number | undefined;
}>;
/**
 * Inferred TypeScript type from the Zod schema
 */
type FileIntegrityOptions = z.infer<typeof FileIntegrityOptionsSchema>;
/**
 * Checksum information structure
 */
interface ChecksumInfo {
    /** The calculated hash value */
    hash: string;
    /** Algorithm used for the hash */
    algorithm: string;
    /** File size in bytes */
    fileSize: number;
    /** File path */
    filePath: string;
    /** Timestamp when checksum was calculated */
    timestamp: Date;
    /** Processing time in milliseconds */
    processingTime: number;
}
/**
 * Validation result for individual files
 */
interface FileValidationResult {
    /** File path that was validated */
    filePath: string;
    /** Whether validation passed */
    isValid: boolean;
    /** Original checksum */
    originalChecksum?: ChecksumInfo;
    /** Current checksum */
    currentChecksum?: ChecksumInfo;
    /** Error message if validation failed */
    error?: string;
    /** Validation timestamp */
    validatedAt: Date;
    /** Processing time in milliseconds */
    processingTime: number;
}
/**
 * Backup operation result
 */
interface BackupResult {
    /** Original file path */
    originalPath: string;
    /** Backup file path */
    backupPath: string;
    /** Whether backup was successful */
    success: boolean;
    /** Backup timestamp */
    createdAt: Date;
    /** Error message if backup failed */
    error?: string;
    /** Backup file size */
    backupSize?: number;
    /** Whether compression was used */
    compressed?: boolean;
    /** Compression algorithm used */
    compressionAlgorithm?: 'gzip' | 'deflate' | 'brotli';
    /** Original file size (before compression) */
    originalSize?: number;
    /** Compression ratio (originalSize / backupSize) */
    compressionRatio?: number;
    /** Whether deduplication was used */
    deduplicated?: boolean;
    /** Content hash used for deduplication */
    contentHash?: string;
    /** Number of references to this content */
    referenceCount?: number;
    /** Deduplication storage path */
    deduplicationPath?: string;
}
/**
 * Rollback operation result
 */
interface RollbackResult {
    /** File path that was rolled back */
    filePath: string;
    /** Backup path used for rollback */
    backupPath: string;
    /** Whether rollback was successful */
    success: boolean;
    /** Whether integrity was verified after rollback */
    integrityVerified?: boolean;
    /** Error message if rollback failed */
    error?: string;
    /** Rollback timestamp */
    rolledBackAt: Date;
    /** Processing time in milliseconds */
    processingTime: number;
}
/**
 * Batch validation result
 */
interface BatchValidationResult {
    /** Total number of files processed */
    totalFiles: number;
    /** Number of files that passed validation */
    validFiles: number;
    /** Number of files that failed validation */
    invalidFiles: number;
    /** Individual file results */
    results: FileValidationResult[];
    /** Total processing time in milliseconds */
    totalProcessingTime: number;
    /** Batch operation timestamp */
    processedAt: Date;
}
/**
 * Validation metadata for reporting
 */
interface ValidationMetadata {
    /** Source of the validation operation */
    source: string;
    /** Operation type */
    operation: 'checksum' | 'validation' | 'backup' | 'rollback' | 'cleanup' | 'deduplication';
    /** Timestamp of the operation */
    timestamp: Date;
    /** Processing time in milliseconds */
    processingTime: number;
    /** Configuration used */
    options: FileIntegrityOptions;
    /** Any additional context */
    context?: Record<string, unknown>;
}
/**
 * Deduplication operation result
 */
interface DeduplicationResult {
    /** Whether deduplication was performed */
    deduplicated: boolean;
    /** Content hash */
    contentHash: string;
    /** Path to deduplicated storage */
    storagePath?: string;
    /** Whether this is a new or existing entry */
    isNewEntry: boolean;
    /** Current reference count */
    referenceCount: number;
    /** Space saved in bytes */
    spaceSaved: number;
    /** Error message if deduplication failed */
    error?: string;
    /** Processing time in milliseconds */
    processingTime: number;
}
/**
 * Incremental backup operation result
 */
interface IncrementalBackupResult {
    /** Backup operation type performed */
    backupType: 'full' | 'incremental' | 'skipped';
    /** Backup ID */
    backupId: string;
    /** Parent backup ID (for incremental) */
    parentId: string | null;
    /** Number of files backed up */
    filesBackedUp: number;
    /** Number of files changed since last backup */
    filesChanged: number;
    /** Number of files skipped (unchanged) */
    filesSkipped: number;
    /** Backup file path */
    backupPath: string;
    /** Total backup size */
    backupSize: number;
    /** Space saved compared to full backup */
    spaceSaved: number;
    /** Files included in this backup */
    backedUpFiles: string[];
    /** Change detection method used */
    changeDetectionMethod: 'mtime' | 'checksum' | 'hybrid';
    /** Processing time in milliseconds */
    processingTime: number;
    /** Whether backup was successful */
    success: boolean;
    /** Error message if backup failed */
    error?: string;
    /** Backup timestamp */
    createdAt: Date;
}
/**
 * Differential backup operation result
 */
interface DifferentialBackupResult {
    /** Backup operation type performed */
    backupType: 'full' | 'differential' | 'skipped';
    /** Backup ID */
    backupId: string;
    /** Base full backup ID (for differential) */
    baseFullBackupId?: string;
    /** Number of files in current differential backup */
    filesBackedUp: number;
    /** Total cumulative files changed since last full backup */
    cumulativeFilesChanged: number;
    /** Number of files skipped (unchanged since last backup) */
    filesSkipped: number;
    /** Current differential backup path */
    backupPath: string;
    /** Current differential backup size */
    currentBackupSize: number;
    /** Total cumulative size of all changes since last full backup */
    cumulativeSize: number;
    /** Size ratio compared to original full backup */
    cumulativeSizeRatio: number;
    /** Space efficiency compared to storing separate full backups */
    spaceSaved: number;
    /** Files included in this differential backup */
    backedUpFiles: string[];
    /** All files changed cumulatively since last full backup */
    cumulativeChangedFiles: string[];
    /** Change detection method used */
    changeDetectionMethod: 'mtime' | 'checksum' | 'hybrid';
    /** Whether a new full backup should be triggered next time */
    recommendFullBackup: boolean;
    /** Reason for recommending full backup */
    recommendationReason?: string;
    /** Processing time in milliseconds */
    processingTime: number;
    /** Whether backup was successful */
    success: boolean;
    /** Error message if backup failed */
    error?: string;
    /** Backup timestamp */
    createdAt: Date;
}
/**
 * System metrics for dynamic batch sizing
 */
interface SystemMetrics {
    /** CPU load average (1 minute) */
    loadAverage: number;
    /** Memory usage percentage */
    memoryUsage: number;
    /** Free memory in bytes */
    freeMemory: number;
    /** Total memory in bytes */
    totalMemory: number;
    /** Event loop lag in milliseconds */
    eventLoopLag: number;
    /** Timestamp when metrics were collected */
    timestamp: Date;
}
/**
 * Progress tracking information
 */
interface ProgressInfo {
    /** Current file being processed */
    currentFile: string;
    /** Number of files processed */
    processed: number;
    /** Total number of files */
    total: number;
    /** Progress percentage (0-100) */
    percentage: number;
    /** Estimated time of arrival */
    eta: Date | null;
    /** Files processed per second */
    rate: number;
    /** Elapsed time in milliseconds */
    elapsed: number;
    /** Current operation */
    operation: string;
    /** Additional context */
    context?: Record<string, unknown>;
}
/**
 * Batch operation result
 */
interface BatchOperationResult<T> {
    /** Whether the batch operation was successful */
    success: boolean;
    /** Individual results for each item in the batch */
    results: T[];
    /** Number of successful operations */
    successful: number;
    /** Number of failed operations */
    failed: number;
    /** Processing time for the entire batch */
    processingTime: number;
    /** Batch size used */
    batchSize: number;
    /** Any errors encountered */
    errors: Array<{
        item: string;
        error: string;
    }>;
    /** Progress information */
    progress: ProgressInfo;
}
/**
 * Large project optimization result
 */
interface LargeProjectResult {
    /** Whether the overall operation was successful */
    success: boolean;
    /** Total files processed */
    totalFiles: number;
    /** Total processing time */
    totalProcessingTime: number;
    /** Number of batches processed */
    batchesProcessed: number;
    /** Average batch size used */
    averageBatchSize: number;
    /** Memory usage statistics */
    memoryStats: {
        initial: number;
        peak: number;
        final: number;
        average: number;
    };
    /** Performance statistics */
    performanceStats: {
        filesPerSecond: number;
        averageFileProcessingTime: number;
        eventLoopLagAverage: number;
        batchSizeAdjustments: number;
    };
    /** Whether optimization was applied */
    optimizationApplied: boolean;
    /** Optimization details */
    optimizationDetails: string[];
}
/**
 * Custom error class for file integrity validation errors
 */
declare class IntegrityError extends Error {
    readonly code: string;
    readonly filePath?: string;
    readonly operation?: string;
    readonly cause?: Error;
    constructor(message: string, code?: string, filePath?: string, operation?: string, cause?: Error);
}
/**
 * Custom error class for checksum calculation errors
 */
declare class ChecksumError extends IntegrityError {
    constructor(message: string, filePath?: string, cause?: Error);
}
/**
 * Custom error class for validation errors
 */
declare class ValidationError extends IntegrityError {
    constructor(message: string, filePath?: string, cause?: Error);
}
/**
 * Custom error class for rollback operation errors
 */
declare class RollbackError extends IntegrityError {
    constructor(message: string, filePath?: string, cause?: Error);
}
/**
 * Main class for file integrity validation operations
 */
declare class FileIntegrityValidator {
    private readonly options;
    private readonly logger;
    private readonly checksumCache;
    private deduplicationIndex;
    private deduplicationIndexPath;
    private incrementalIndex;
    private incrementalIndexPath;
    private differentialIndex;
    private differentialIndexPath;
    private batchProcessingConfig;
    private progressEmitter;
    private currentBatchSize;
    private eventLoopLagStart;
    private memoryTracker;
    private performanceTracker;
    constructor(options?: Partial<FileIntegrityOptions>);
    /**
     * Calculate checksum for a file
     */
    calculateChecksum(filePath: string): Promise<ChecksumInfo>;
    /**
     * Calculate checksum synchronously (for smaller files)
     */
    calculateChecksumSync(filePath: string): Promise<ChecksumInfo>;
    /**
     * Add checksum to cache with size limit management
     */
    private addToCache;
    /**
     * Clear the checksum cache
     */
    clearCache(): void;
    /**
     * Clear all cached indexes (for testing purposes)
     */
    clearAllCaches(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        size: number;
        maxSize: number;
        hitRate?: number;
    };
    /**
     * Validate file integrity by comparing current checksum with expected
     */
    validateFile(filePath: string, expectedChecksum: string | ChecksumInfo): Promise<FileValidationResult>;
    /**
     * Validate multiple files in batch
     */
    validateBatch(files: Array<{
        path: string;
        expectedChecksum: string | ChecksumInfo;
    }>): Promise<BatchValidationResult>;
    /**
     * Compare checksums of two files
     */
    compareFiles(filePath1: string, filePath2: string): Promise<{
        match: boolean;
        checksum1: ChecksumInfo;
        checksum2: ChecksumInfo;
        processingTime: number;
    }>;
    /**
     * Verify file exists and is accessible
     */
    verifyFileAccess(filePath: string): Promise<{
        exists: boolean;
        readable: boolean;
        size?: number;
        error?: string;
    }>;
    /**
     * Generate validation metadata for reporting
     */
    generateMetadata(operation: 'checksum' | 'validation' | 'backup' | 'rollback' | 'cleanup', processingTime: number, context?: Record<string, unknown>): ValidationMetadata;
    /**
     * Create a compression stream based on the configured algorithm
     */
    private createCompressionStream;
    /**
     * Create a decompression stream based on file extension
     */
    private createDecompressionStream;
    /**
     * Determine if a file should be compressed based on size and configuration
     */
    private shouldCompressFile;
    /**
     * Get the compressed file extension based on algorithm
     */
    private getCompressedExtension;
    /**
     * Load the deduplication index from disk
     */
    private loadDeduplicationIndex;
    /**
     * Save the deduplication index to disk
     */
    private saveDeduplicationIndex;
    /**
     * Update deduplication statistics
     */
    private updateDeduplicationStats;
    /**
     * Calculate content hash for deduplication
     */
    private createContentHash;
    /**
     * Check if file should be deduplicated based on size and configuration
     */
    private shouldDeduplicateFile;
    /**
     * Perform deduplication for a file
     */
    deduplicateFile(filePath: string, targetPath?: string): Promise<DeduplicationResult>;
    /**
     * Get deduplication statistics
     */
    getDeduplicationStats(): Promise<{
        enabled: boolean;
        totalEntries: number;
        spaceSaved: number;
        duplicatesFound: number;
        averageReferenceCount: number;
        indexPath: string;
    }>;
    /**
     * Load the incremental backup index from disk
     */
    private loadIncrementalIndex;
    /**
     * Save the incremental backup index to disk
     */
    private saveIncrementalIndex;
    /**
     * Generate a unique backup ID
     */
    private generateBackupId;
    /**
     * Detect file changes since last backup
     */
    private detectFileChanges;
    /**
     * Determine backup strategy based on configuration and current state
     */
    private determineBackupStrategy;
    /**
     * Create an incremental backup
     */
    createIncrementalBackup(filePath: string): Promise<IncrementalBackupResult>;
    /**
     * Get incremental backup statistics
     */
    getIncrementalStats(): Promise<{
        enabled: boolean;
        totalBackups: number;
        totalIncrementals: number;
        chainLength: number;
        spaceSaved: number;
        lastBackupAt: Date;
        strategy: string;
        changeDetectionMethod: string;
        indexPath: string;
    }>;
    /**
     * Load differential backup index from storage
     */
    private loadDifferentialIndex;
    /**
     * Save differential backup index to storage
     */
    private saveDifferentialIndex;
    /**
     * Detect all file changes since last full backup (cumulative)
     */
    private detectCumulativeFileChanges;
    /**
     * Determine differential backup strategy
     */
    private determineDifferentialStrategy;
    /**
     * Create differential backup
     */
    createDifferentialBackup(filePath: string): Promise<DifferentialBackupResult>;
    /**
     * Get differential backup statistics
     */
    getDifferentialStats(): Promise<{
        enabled: boolean;
        totalDifferentials: number;
        currentChainLength: number;
        cumulativeSize: number;
        cumulativeSizeRatio: number;
        spaceSaved: number;
        lastBackupAt: Date;
        timeSinceFullBackup: number;
        strategy: string;
        changeDetectionMethod: string;
        indexPath: string;
        currentFullBackup: {
            id: string;
            createdAt: Date;
            size: number;
        } | null;
    }>;
    /**
     * Get current system metrics for dynamic batch sizing
     */
    private getCurrentSystemMetrics;
    /**
     * Get current memory usage in MB
     */
    private getCurrentMemoryUsage;
    /**
     * Update memory tracking statistics
     */
    private updateMemoryTracking;
    /**
     * Dynamically adjust batch size based on system metrics
     */
    private adjustBatchSize;
    /**
     * Create progress information for batch operations
     */
    private createProgressInfo;
    /**
     * Emit progress update if progress tracking is enabled
     */
    private emitProgress;
    /**
     * Process files in batches with dynamic optimization
     */
    processBatchWithOptimization<T>(files: string[], operation: string, processor: (filePath: string) => Promise<T>, options?: {
        progressCallback?: (progress: ProgressInfo) => void;
        errorHandler?: (error: Error, filePath: string) => boolean;
        enableProgressTracking?: boolean;
    }): Promise<BatchOperationResult<T>>;
    /**
     * Create a backup of a file before modification
     */
    createBackup(filePath: string): Promise<BackupResult>;
    /**
     * Create a compressed backup using streaming compression
     */
    private createCompressedBackup;
    /**
     * Check if a backup file is compressed based on its extension
     */
    private isCompressedBackup;
    /**
     * Restore a file from a compressed backup using streaming decompression
     */
    private restoreCompressedBackup;
    /**
     * Restore a file from backup
     */
    restoreFromBackup(filePath: string, backupPath: string): Promise<RollbackResult>;
    /**
     * Clean up old backup files based on retention policy
     */
    cleanupBackups(): Promise<{
        cleaned: number;
        errors: string[];
        totalSize: number;
    }>;
    /**
     * Process multiple files with optimized batching for large projects
     */
    processLargeProject(files: string[], operation: 'checksum' | 'validate' | 'backup', options?: {
        progressCallback?: (progress: ProgressInfo) => void;
        errorHandler?: (error: Error, filePath: string) => boolean;
        expectedChecksums?: Record<string, string | ChecksumInfo>;
    }): Promise<LargeProjectResult>;
    /**
     * Get comprehensive statistics for large project optimization
     */
    getLargeProjectStats(): Promise<{
        batchProcessing: {
            enabled: boolean;
            currentBatchSize: number;
            strategy: string;
            dynamicSizing: boolean;
            adjustments: number;
        };
        memoryTracking: {
            current: number;
            peak: number;
            samples: number;
            average: number;
        };
        performance: {
            filesProcessed: number;
            totalProcessingTime: number;
            averageFileProcessingTime: number;
            eventLoopLagSamples: number;
            averageEventLoopLag: number;
        };
        systemMetrics: SystemMetrics;
        progressTracking: {
            enabled: boolean;
            updateInterval: number;
        };
    }>;
    /**
     * Reset performance tracking statistics
     */
    resetPerformanceTracking(): void;
    /**
     * Add progress event listener for long-running operations
     */
    onProgress(callback: (progress: ProgressInfo) => void): void;
    /**
     * Remove progress event listener
     */
    offProgress(callback: (progress: ProgressInfo) => void): void;
    /**
     * Remove all progress event listeners
     */
    removeAllProgressListeners(): void;
}
/**
 * Convenience factory function for creating FileIntegrityValidator instances
 */
declare function createFileIntegrityValidator(options?: Partial<FileIntegrityOptions>): FileIntegrityValidator;
/**
 * Convenience function for quick checksum calculation
 */
declare function calculateFileChecksum(filePath: string, algorithm?: 'md5' | 'sha1' | 'sha256' | 'sha512'): Promise<ChecksumInfo>;
/**
 * Convenience function for validating file integrity against expected checksum
 */
declare function validateFileIntegrity(filePath: string, expectedChecksum: string, algorithm?: 'md5' | 'sha1' | 'sha256' | 'sha512'): Promise<boolean>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Comprehensive Error Handling Types for Tailwind Enigma Core
 * Provides TypeScript interfaces for advanced error handling, circuit breaker patterns,
 * and graceful recovery mechanisms.
 */

/**
 * Error severity levels for categorization and routing
 */
declare const ErrorSeverity: {
    readonly CRITICAL: "critical";
    readonly HIGH: "high";
    readonly MEDIUM: "medium";
    readonly LOW: "low";
};
type ErrorSeverity = (typeof ErrorSeverity)[keyof typeof ErrorSeverity];
/**
 * Error categories for different types of failures
 */
declare const ErrorCategory: {
    readonly OPERATIONAL: "operational";
    readonly PROGRAMMING: "programming";
    readonly EXTERNAL_SERVICE: "external";
    readonly CONFIGURATION: "configuration";
    readonly RESOURCE: "resource";
    readonly VALIDATION: "validation";
};
type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory];
/**
 * Circuit breaker states
 */
declare const CircuitBreakerState: {
    readonly CLOSED: "closed";
    readonly OPEN: "open";
    readonly HALF_OPEN: "half_open";
};
type CircuitBreakerState = (typeof CircuitBreakerState)[keyof typeof CircuitBreakerState];
/**
 * Recovery strategy types
 */
declare const RecoveryStrategy: {
    readonly RETRY: "retry";
    readonly FALLBACK: "fallback";
    readonly GRACEFUL_DEGRADATION: "degradation";
    readonly CIRCUIT_BREAKER: "circuit_breaker";
    readonly MANUAL_INTERVENTION: "manual";
};
type RecoveryStrategy = (typeof RecoveryStrategy)[keyof typeof RecoveryStrategy];
/**
 * Enhanced error context with comprehensive metadata
 */
interface EnhancedErrorContext extends ErrorContext {
    correlationId?: string;
    operationId?: string;
    component?: string;
    timestamp?: Date;
    duration?: number;
    timeout?: number;
    nodeVersion?: string;
    platform?: string;
    availableMemory?: number;
    cpuUsage?: {
        user: number;
        system: number;
    };
    retryCount?: number;
    maxRetries?: number;
    lastRetryAt?: Date;
    recoveryStrategy?: RecoveryStrategy;
    userId?: string;
    requestId?: string;
    userAgent?: string;
    tags?: Record<string, string>;
    metrics?: Record<string, number>;
}
/**
 * Error handler configuration options
 */
interface ErrorHandlerConfig {
    maxRetries: number;
    retryDelay: number;
    exponentialBackoff: boolean;
    circuitBreakerEnabled: boolean;
    enableAnalytics: boolean;
    logLevel: string;
    alertThresholds?: Record<ErrorSeverity, number>;
    circuitBreaker?: {
        failureThreshold?: number;
        recoveryTimeout?: number;
        successThreshold?: number;
        monitoringWindow?: number;
    };
    retry?: {
        maxAttempts?: number;
        baseDelay?: number;
        maxDelay?: number;
        backoffMultiplier?: number;
        jitter?: boolean;
    };
    timeouts?: {
        operation?: number;
        gracefulShutdown?: number;
        resourceCleanup?: number;
    };
    monitoring?: {
        enabled?: boolean;
        sampleRate?: number;
        batchSize?: number;
        flushInterval?: number;
    };
    recovery?: {
        enableAutoRecovery?: boolean;
        healthCheckInterval?: number;
        maxRecoveryAttempts?: number;
    };
}
/**
 * Circuit breaker statistics and metrics
 */
interface CircuitBreakerMetrics {
    state: CircuitBreakerState;
    failureCount: number;
    successCount: number;
    lastFailureTime: Date | null;
    lastSuccessTime: Date | null;
    totalRequests: number;
    totalFailures: number;
    totalSuccesses: number;
    uptime: number;
    responseTime: {
        average: number;
        min: number;
        max: number;
        p95: number;
        p99: number;
    };
}
/**
 * Error analytics and reporting data
 */
interface ErrorAnalytics {
    totalErrors: number;
    errorsByCategory: Record<ErrorCategory, number>;
    errorsBySeverity: Record<ErrorSeverity, number>;
    recoveryRate: number;
    lastErrorTime: Date | null;
    circuitBreakerMetrics: Record<string, CircuitBreakerMetrics>;
    systemHealth: HealthStatus;
    uptime: number;
    timestamp: Date;
}
/**
 * Function signature for circuit breaker fallback
 */
type CircuitBreakerFallback<T> = (error: Error) => Promise<T> | T;
/**
 * Error recovery strategy interface
 */
interface ErrorRecoveryStrategy {
    type: 'retry' | 'fallback' | 'circuit-breaker' | 'graceful-degradation';
    config?: {
        maxRetries?: number;
        retryDelay?: number;
        fallbackAction?: string;
        degradationLevel?: 'minimal' | 'partial' | 'full';
    };
    action?: () => Promise<void>;
}
/**
 * Health status enumeration
 */
declare const HealthStatus: {
    readonly HEALTHY: "healthy";
    readonly DEGRADED: "degraded";
    readonly UNHEALTHY: "unhealthy";
};
type HealthStatus = (typeof HealthStatus)[keyof typeof HealthStatus];
/**
 * Check if error is an Enigma error with severity
 */
declare function isEnigmaError(error: Error): error is Error & {
    severity?: ErrorSeverity;
};
/**
 * Categorize error based on error type and message
 */
declare function categorizeError(error: Error): ErrorCategory;
/**
 * Convert severity to numeric value for comparison
 */
declare function severityToNumber(severity: ErrorSeverity): number;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Centralized Error Handler for Tailwind Enigma Core
 * Coordinates error categorization, circuit breaker integration, and recovery strategies
 */

/**
 * Error handling statistics for monitoring
 */
interface ErrorStats {
    totalErrors: number;
    errorsByCategory: Record<ErrorCategory, number>;
    errorsBySeverity: Record<ErrorSeverity, number>;
    lastError?: {
        timestamp: Date;
        category: ErrorCategory;
        severity: ErrorSeverity;
        message: string;
    };
    recoveryAttempts: number;
    successfulRecoveries: number;
}
/**
 * Centralized Error Handler - Singleton pattern
 */
declare class ErrorHandler extends EventEmitter {
    private static instance;
    private readonly logger;
    private readonly circuitRegistry;
    private readonly config;
    private readonly errorStats;
    private constructor();
    /**
     * Get singleton instance
     */
    static getInstance(config?: Partial<ErrorHandlerConfig>): ErrorHandler;
    /**
     * Handle an error with full categorization and recovery
     */
    handleError(error: Error, context?: EnhancedErrorContext, recoveryStrategy?: ErrorRecoveryStrategy): Promise<boolean>;
    /**
     * Handle error with circuit breaker protection
     */
    private handleWithCircuitBreaker;
    /**
     * Attempt error recovery using the provided strategy
     */
    private attemptRecovery;
    /**
     * Execute a specific recovery strategy
     */
    private executeRecoveryStrategy;
    /**
     * Execute retry recovery strategy
     */
    private executeRetryStrategy;
    /**
     * Execute fallback recovery strategy
     */
    private executeFallbackStrategy;
    /**
     * Execute graceful degradation strategy
     */
    private executeGracefulDegradationStrategy;
    /**
     * Determine error severity based on error type and category
     */
    private determineSeverity;
    /**
     * Determine if circuit breaker should be used for this error
     */
    private shouldUseCircuitBreaker;
    /**
     * Check if error is fatal and should terminate the process
     */
    private isFatalError;
    /**
     * Log error with appropriate level and context
     */
    private logError;
    /**
     * Update error statistics
     */
    private updateStats;
    /**
     * Check if error count exceeds alert thresholds
     */
    private checkAlertThresholds;
    /**
     * Setup global error handlers
     */
    private setupGlobalHandlers;
    /**
     * Get current error statistics
     */
    getStats(): ErrorStats;
    /**
     * Get error analytics data
     */
    getAnalytics(): ErrorAnalytics;
    /**
     * Calculate overall system health
     */
    private calculateSystemHealth;
    /**
     * Reset error statistics
     */
    resetStats(): void;
    /**
     * Utility function to sleep for specified milliseconds
     */
    private sleep;
    /**
     * Cleanup resources when error handler is destroyed
     */
    destroy(): void;
}
/**
 * Convenience function to get the global error handler instance
 */
declare function getErrorHandler(config?: Partial<ErrorHandlerConfig>): ErrorHandler;
/**
 * Convenience function to handle an error through the global error handler
 */
declare function handleError(error: Error, context?: EnhancedErrorContext, recoveryStrategy?: ErrorRecoveryStrategy): Promise<boolean>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Circuit Breaker Implementation for Tailwind Enigma Core
 * Provides resilient error handling with automatic failure detection and recovery
 */

/**
 * Circuit breaker error thrown when circuit is open
 */
declare class CircuitBreakerOpenError extends Error {
    readonly circuitName: string;
    readonly lastFailure?: Error | undefined;
    constructor(circuitName: string, lastFailure?: Error | undefined);
}
/**
 * Circuit breaker configuration with sensible defaults
 */
interface CircuitBreakerConfig {
    failureThreshold: number;
    recoveryTimeout: number;
    successThreshold: number;
    monitoringWindow: number;
    enabled: boolean;
}
/**
 * Comprehensive Circuit Breaker implementation
 */
declare class CircuitBreaker extends EventEmitter {
    private readonly name;
    private readonly configOverrides;
    private state;
    private failureCount;
    private successCount;
    private lastFailureTime;
    private lastSuccessTime;
    private totalRequests;
    private totalFailures;
    private totalSuccesses;
    private readonly responseTimeTracker;
    private readonly failureWindow;
    private recoveryTimer;
    constructor(name: string, configOverrides?: Partial<CircuitBreakerConfig>);
    private readonly config;
    /**
     * Execute a function with circuit breaker protection
     */
    call<T>(action: () => Promise<T>, fallback?: CircuitBreakerFallback<T>, context?: EnhancedErrorContext): Promise<T>;
    /**
     * Handle successful operation
     */
    private onSuccess;
    /**
     * Handle failed operation
     */
    private onFailure;
    /**
     * Determine if circuit should be opened based on failure threshold
     */
    private shouldOpenCircuit;
    /**
     * Clean up old failures from monitoring window
     */
    private cleanupFailureWindow;
    /**
     * Move circuit breaker to new state
     */
    private moveToState;
    /**
     * Schedule automatic recovery attempt
     */
    private scheduleRecoveryAttempt;
    /**
     * Clear recovery timer
     */
    private clearRecoveryTimer;
    /**
     * Get last recorded error (for debugging)
     */
    private getLastError;
    /**
     * Get current circuit breaker metrics
     */
    getMetrics(): CircuitBreakerMetrics;
    /**
     * Reset circuit breaker to initial state
     */
    reset(): void;
    /**
     * Force circuit to specific state (for testing)
     */
    forceState(state: CircuitBreakerState): void;
    /**
     * Get current state
     */
    getState(): CircuitBreakerState;
    /**
     * Check if circuit is healthy
     */
    isHealthy(): boolean;
    /**
     * Cleanup resources when circuit breaker is destroyed
     */
    destroy(): void;
}
/**
 * Circuit breaker registry for managing multiple circuit breakers
 */
declare class CircuitBreakerRegistry {
    private static instance;
    private readonly circuits;
    private readonly logger;
    static getInstance(): CircuitBreakerRegistry;
    /**
     * Get or create a circuit breaker
     */
    getCircuit(name: string, config?: Partial<CircuitBreakerConfig>): CircuitBreaker;
    /**
     * Get all circuit breakers
     */
    getAllCircuits(): Record<string, CircuitBreaker>;
    /**
     * Get metrics for all circuits
     */
    getAllMetrics(): Record<string, CircuitBreakerMetrics>;
    /**
     * Reset all circuit breakers
     */
    resetAll(): void;
    /**
     * Destroy all circuit breakers
     */
    destroyAll(): void;
    /**
     * Check overall health of all circuits
     */
    getOverallHealth(): {
        healthy: number;
        degraded: number;
        unhealthy: number;
        total: number;
    };
}
/**
 * Utility function to wrap any async function with circuit breaker protection
 */
declare function withCircuitBreaker<T extends (...args: any[]) => Promise<any>>(name: string, fn: T, config?: Partial<CircuitBreakerConfig>, fallback?: CircuitBreakerFallback<ReturnType<T>>): T;

/**
 * Initialize error handling with default configuration
 * Call this early in your application lifecycle
 *
 * @param config - Optional configuration overrides
 * @returns Configured ErrorHandler instance
 */
declare function initializeErrorHandling(config?: Partial<ErrorHandlerConfig>): ErrorHandler;
/**
 * Get system health status across all components
 *
 * @returns Overall system health information
 */
declare function getSystemHealth(): {
    overall: HealthStatus;
    errorHandler: ErrorAnalytics;
    circuitBreakers: {
        healthy: number;
        degraded: number;
        unhealthy: number;
        total: number;
    };
    uptime: number;
    timestamp: Date;
};
/**
 * Gracefully shutdown error handling components
 * Call this during application shutdown
 */
declare function shutdownErrorHandling(): Promise<void>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

interface CriticalCssResult {
    /** CSS to be inlined in the document head */
    inline: string;
    /** CSS files to be preloaded */
    preload: string[];
    /** CSS files to be loaded asynchronously */
    async: string[];
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Performance metrics for CSS bundles
 */
interface BundlePerformanceMetrics {
    /** Bundle identifier */
    bundleId: string;
    /** Original size in bytes */
    originalSize: number;
    /** Optimized size in bytes */
    optimizedSize: number;
    /** Compressed size in bytes (gzip) */
    compressedSize: number;
    /** Brotli compressed size in bytes */
    brotliSize?: number;
    /** Number of chunks created */
    chunkCount: number;
    /** Average chunk size */
    averageChunkSize: number;
    /** Largest chunk size */
    maxChunkSize: number;
    /** Smallest chunk size */
    minChunkSize: number;
    /** Critical CSS size */
    criticalCssSize: number;
    /** Estimated load time (milliseconds) */
    estimatedLoadTime: number;
    /** Compression ratio (optimized/original) */
    compressionRatio: number;
    /** Time spent on optimization */
    optimizationTime: number;
    /** Number of CSS rules */
    ruleCount: number;
    /** Number of selectors */
    selectorCount: number;
    /** Number of unused rules removed */
    unusedRulesRemoved: number;
    /** Cache efficiency score (0-100) */
    cacheEfficiency: number;
}
/**
 * Global performance summary across all bundles
 */
interface GlobalPerformanceMetrics {
    /** Total original size */
    totalOriginalSize: number;
    /** Total optimized size */
    totalOptimizedSize: number;
    /** Total compressed size */
    totalCompressedSize: number;
    /** Total number of bundles */
    bundleCount: number;
    /** Total number of chunks */
    totalChunkCount: number;
    /** Overall compression ratio */
    overallCompressionRatio: number;
    /** Total critical CSS size */
    totalCriticalCssSize: number;
    /** Average estimated load time */
    averageLoadTime: number;
    /** Total optimization time */
    totalOptimizationTime: number;
    /** Performance score (0-100) */
    performanceScore: number;
    /** Bundle metrics */
    bundles: BundlePerformanceMetrics[];
}
/**
 * Performance budget violation
 */
interface BudgetViolation {
    /** Type of budget violated */
    type: 'bundle_size' | 'critical_css' | 'chunk_count' | 'load_time' | 'total_size';
    /** Actual value */
    actual: number;
    /** Budget limit */
    limit: number;
    /** Severity level */
    severity: 'warning' | 'error';
    /** Description of violation */
    message: string;
    /** Recommendations to fix */
    recommendations: string[];
}
/**
 * Optimization recommendation
 */
interface OptimizationRecommendation {
    /** Recommendation category */
    category: 'chunking' | 'compression' | 'critical_css' | 'caching' | 'delivery';
    /** Priority level */
    priority: 'low' | 'medium' | 'high';
    /** Title of recommendation */
    title: string;
    /** Detailed description */
    description: string;
    /** Estimated impact */
    impact: string;
    /** Implementation complexity */
    complexity: 'simple' | 'moderate' | 'complex';
    /** Implementation steps */
    steps: string[];
}
/**
 * Complete performance report
 */
interface CssPerformanceReport {
    /** Report metadata */
    metadata: {
        timestamp: string;
        version: string;
        environment: string;
        configHash: string;
    };
    /** Global performance metrics */
    metrics: GlobalPerformanceMetrics;
    /** Performance budget analysis */
    budgetAnalysis: {
        passed: boolean;
        violations: BudgetViolation[];
        score: number;
    };
    /** Optimization recommendations */
    recommendations: OptimizationRecommendation[];
    /** Configuration summary */
    configuration: {
        strategy: string;
        chunking: any;
        optimization: any;
        compression: any;
    };
    /** Asset manifest */
    assets: AssetHash[];
    /** Detailed chunk analysis */
    chunkAnalysis: ChunkAnalysisResult[];
}
/**
 * Chunk analysis result
 */
interface ChunkAnalysisResult {
    /** Chunk identifier */
    chunkId: string;
    /** Chunk size in bytes */
    size: number;
    /** Compressed size */
    compressedSize: number;
    /** Load priority */
    priority: 'critical' | 'high' | 'medium' | 'low';
    /** Dependencies */
    dependencies: string[];
    /** Usage frequency score */
    usageScore: number;
    /** Cache hit ratio estimate */
    cacheHitRatio: number;
    /** Optimization opportunities */
    optimizationOpportunities: string[];
}
/**
 * CSS Report Generator for performance analysis and optimization recommendations
 */
declare class CssReportGenerator {
    private config;
    private performanceBudget?;
    constructor(config: CssOutputConfig, performanceBudget?: PerformanceBudget);
    /**
     * Generate comprehensive performance report
     */
    generateReport(results: {
        bundles: any[];
        chunks: CssChunk[];
        assets: AssetHash[];
        chunkingStats: any;
        criticalCss?: CriticalCssResult[];
        optimizationTime: number;
    }): Promise<CssPerformanceReport>;
    /**
     * Calculate performance metrics for individual bundles
     */
    private calculateBundleMetrics;
    /**
     * Calculate global performance metrics
     */
    private calculateGlobalMetrics;
    /**
     * Analyze compliance with performance budgets
     */
    private analyzeBudgetCompliance;
    /**
     * Generate optimization recommendations
     */
    private generateRecommendations;
    /**
     * Analyze individual chunks for optimization opportunities
     */
    private analyzeChunks;
    /**
     * Estimate load time based on size and chunk count
     */
    private estimateLoadTime;
    /**
     * Calculate cache efficiency score
     */
    private calculateCacheEfficiency;
    /**
     * Calculate performance score (0-100)
     */
    private calculatePerformanceScore;
    /**
     * Generate configuration hash for cache invalidation
     */
    private generateConfigHash;
    /**
     * Helper methods for chunk analysis
     */
    private determineChunkPriority;
    private estimateCacheHitRatio;
    private identifyOptimizationOpportunities;
    private calculateSizeVariation;
    private calculateUsageConsistency;
    private estimateContentStability;
    /**
     * Export report to various formats
     */
    exportReport(report: CssPerformanceReport, format: 'json' | 'html' | 'markdown'): Promise<string>;
    /**
     * Generate HTML report
     */
    private generateHtmlReport;
    /**
     * Generate Markdown report
     */
    private generateMarkdownReport;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * @fileoverview TypeScript interfaces and types for atomic file operations
 * @module types/atomicOps
 */

/** Configuration options for atomic file operations */
interface AtomicFileOptions {
    /** Whether to enable fsync for durability (default: true) */
    enableFsync?: boolean;
    /** Temporary file directory (default: same as target file) */
    tempDirectory?: string;
    /** Temporary file prefix (default: '.tmp-') */
    tempPrefix?: string;
    /** Temporary file suffix (default: '.tmp') */
    tempSuffix?: string;
    /** Timeout for operations in milliseconds (default: 30000) */
    operationTimeout?: number;
    /** Whether to preserve file permissions (default: true) */
    preservePermissions?: boolean;
    /** Whether to preserve file ownership (default: true) */
    preserveOwnership?: boolean;
    /** Buffer size for read/write operations (default: 64KB) */
    bufferSize?: number;
    /** Whether to enable write-ahead logging (default: false) */
    enableWAL?: boolean;
    /** WAL directory path (default: '.wal') */
    walDirectory?: string;
    /** Maximum number of retry attempts (default: 3) */
    maxRetries?: number;
    /** Maximum number of retry attempts (alias for maxRetries) */
    maxRetryAttempts?: number;
    /** Retry delay in milliseconds (default: 100) */
    retryDelay?: number;
}
/** Result of an atomic file operation */
interface AtomicOperationResult {
    /** Whether the operation was successful */
    success: boolean;
    /** Operation type performed */
    operation: 'read' | 'write' | 'delete' | 'create';
    /** Target file path */
    filePath: string;
    /** Temporary file path used (if any) */
    tempFilePath?: string;
    /** Operation duration in milliseconds */
    duration: number;
    /** Number of bytes processed */
    bytesProcessed: number;
    /** File stats after operation */
    fileStats?: Stats;
    /** Error information if operation failed */
    error?: {
        code: string;
        message: string;
        stack?: string;
    };
    /** Rollback operation information (if applicable) */
    rollbackOperation?: RollbackOperation;
    /** File content (for read operations) */
    fileContent?: string | Buffer;
    /** Operation metadata */
    metadata: AtomicOperationResultMetadata;
}
/** File creation options */
interface FileCreationOptions extends AtomicFileOptions {
    /** File encoding (default: 'utf8') */
    encoding?: BufferEncoding;
    /** File mode/permissions (default: 0o644) */
    mode?: number;
    /** Whether to overwrite existing files (default: false) */
    overwrite?: boolean;
    /** Initial file content */
    initialContent?: string | Buffer;
}
/** File read options with enhanced features */
interface FileReadOptions {
    /** Text encoding for reading files (default: 'utf8', use 'buffer' for binary) */
    encoding?: BufferEncoding | 'buffer';
    /** Whether to verify file checksum (default: false) */
    verifyChecksum?: boolean;
    /** Expected checksum for verification */
    expectedChecksum?: string;
    /** Checksum algorithm to use (default: 'sha256') */
    checksumAlgorithm?: 'md5' | 'sha1' | 'sha256' | 'sha512';
    /** Buffer size for streaming large files (default: 64KB) */
    bufferSize?: number;
    /** Whether to enable content caching (default: false) */
    enableCaching?: boolean;
    /** Cache timeout in milliseconds (default: 5000) */
    cacheTimeout?: number;
    /** Maximum file size to read (default: 100MB) */
    maxFileSize?: number;
    /** Whether to abort on first error in batch operations (default: true) */
    abortOnFirstError?: boolean;
    /** Read timeout in milliseconds (default: 30000) */
    readTimeout?: number;
    /** Schema validation function */
    validateSchema?: (data: any) => boolean;
}
/** Options for file write operations */
interface FileWriteOptions {
    /** Text encoding for string content */
    encoding?: BufferEncoding;
    /** File mode/permissions */
    mode?: number;
    /** Whether to append to existing file */
    append?: boolean;
    /** Whether to create backup of existing file */
    createBackup?: boolean;
    /** Whether to verify content after writing */
    verifyAfterWrite?: boolean;
    /** Checksum algorithm for verification */
    checksumAlgorithm?: 'md5' | 'sha1' | 'sha256';
    /** Buffer size for streaming operations */
    bufferSize?: number;
    /** Enable compression for large files */
    enableCompression?: boolean;
    /** Compression level (0-9) */
    compressionLevel?: number;
    /** Whether to sync after write */
    syncAfterWrite?: boolean;
    /** Directory for backup files */
    backupDirectory?: string;
    /** Maximum number of backup files to keep */
    maxBackups?: number;
    /** Operation timeout in milliseconds */
    writeTimeout?: number;
    /** Enable progress reporting */
    enableProgress?: boolean;
    /** Stop on first error in batch operations */
    abortOnFirstError?: boolean;
    /** Maximum file size allowed */
    maxFileSize?: number;
}
/** Atomic read options */
interface AtomicReadOptions extends AtomicFileOptions {
    /** File encoding (default: 'utf8') */
    encoding?: BufferEncoding;
    /** Whether to fallback to temp file if main file doesn't exist */
    fallbackToTemp?: boolean;
}
/** Atomic write options */
interface AtomicWriteOptions extends AtomicFileOptions {
    /** File encoding (default: 'utf8') */
    encoding?: BufferEncoding;
    /** File mode/permissions (inherit from existing file if not specified) */
    mode?: number;
    /** Whether to append to file (default: false - overwrite) */
    append?: boolean;
}
/** Temporary file information */
interface TempFileInfo {
    /** Temporary file path */
    path: string;
    /** Target file path */
    targetPath: string;
    /** Creation timestamp */
    createdAt: number;
    /** Process ID that created the temp file */
    pid: number;
    /** Thread ID (if applicable) */
    threadId?: number;
    /** Unique operation ID */
    operationId: string;
    /** Cleanup timeout in milliseconds */
    cleanupTimeout: number;
}
/** Rollback operation for atomic file operations */
interface RollbackOperation {
    /** Type of rollback operation */
    type: 'file_create' | 'file_overwrite' | 'file_delete' | 'directory_create' | 'permission_change';
    /** Path to the file/directory involved */
    filePath: string;
    /** Optional backup file path */
    backupPath?: string;
    /** Original file size (for metrics) */
    fileSize?: number;
    /** Original permissions (for restoration) */
    originalPermissions?: number;
    /** Operation timestamp */
    timestamp: number;
    /** Unique operation identifier */
    operationId?: string;
    /** Operation index for checkpoint tracking */
    operationIndex?: number;
    /** Individual rollback steps */
    steps?: RollbackStep[];
    /** Whether the operation is completed */
    completed?: boolean;
    /** Operation start time */
    startTime?: number;
    /** Operation name/description */
    operation?: string;
}
/** Individual rollback step */
interface RollbackStep {
    /** Step number */
    stepNumber: number;
    /** Step description */
    description: string;
    /** Step type */
    type: 'backup' | 'write' | 'rename' | 'delete' | 'permissions';
    /** File path affected by this step */
    filePath: string;
    /** Timestamp when step was performed */
    timestamp: number;
    /** Whether step was successful */
    success: boolean;
    /** Rollback action for this step */
    rollbackAction?: () => Promise<void>;
}
/** Performance metrics for atomic operations */
interface AtomicOperationMetrics {
    /** Total operations performed */
    totalOperations: number;
    /** Successful operations */
    successfulOperations: number;
    /** Failed operations */
    failedOperations: number;
    /** Average operation duration */
    averageDuration: number;
    /** Total bytes processed */
    totalBytesProcessed: number;
    /** Operations per second */
    operationsPerSecond: number;
    /** Total fsync calls */
    totalFsyncCalls: number;
    /** Total retry attempts */
    totalRetryAttempts: number;
    /** Error statistics */
    errorStats: {
        [errorCode: string]: number;
    };
    /** Performance by operation type */
    operationTypes: {
        read: number;
        write: number;
        delete: number;
        create: number;
    };
}
/** WAL (Write-Ahead Log) entry */
interface WALEntry {
    /** Unique entry ID */
    id: string;
    /** Operation ID this entry belongs to */
    operationId: string;
    /** Entry type */
    type: 'begin' | 'step' | 'commit' | 'rollback';
    /** Timestamp */
    timestamp: number;
    /** File path involved */
    filePath: string;
    /** Entry data */
    data: {
        operation: string;
        stepNumber?: number;
        description: string;
        metadata?: Record<string, any>;
    };
    /** Checksum for integrity */
    checksum: string;
}
/** Error types for atomic operations */
declare const AtomicOperationError: {
    readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
    readonly PERMISSION_DENIED: "PERMISSION_DENIED";
    readonly TEMP_FILE_CREATION_FAILED: "TEMP_FILE_CREATION_FAILED";
    readonly WRITE_FAILED: "WRITE_FAILED";
    readonly FSYNC_FAILED: "FSYNC_FAILED";
    readonly RENAME_FAILED: "RENAME_FAILED";
    readonly CLEANUP_FAILED: "CLEANUP_FAILED";
    readonly TIMEOUT: "TIMEOUT";
    readonly ROLLBACK_FAILED: "ROLLBACK_FAILED";
    readonly WAL_CORRUPTION: "WAL_CORRUPTION";
    readonly INVALID_OPERATION: "INVALID_OPERATION";
    readonly DISK_FULL: "DISK_FULL";
    readonly LOCK_FAILED: "LOCK_FAILED";
};
type AtomicOperationError = (typeof AtomicOperationError)[keyof typeof AtomicOperationError];
/** Metadata about an atomic operation */
interface AtomicOperationResultMetadata {
    /** Operation start timestamp */
    startTime: number;
    /** Operation end timestamp */
    endTime: number;
    /** Whether fsync was used */
    fsyncUsed: boolean;
    /** Number of retry attempts */
    retryAttempts: number;
    /** Whether write-ahead logging was used */
    walUsed: boolean;
    /** Whether backup was created */
    backupCreated: boolean;
    /** Whether content verification was performed */
    checksumVerified: boolean;
    /** Whether content verification passed */
    verificationPassed?: boolean;
    /** Backup file path if created */
    backupPath?: string;
    /** Content checksum if verified */
    checksum?: string;
    /** Whether content was loaded from cache */
    fromCache?: boolean;
}

/**
 * Utility interface for plugin developers
 */
interface PluginUtils {
    /**
     * Create a logger scoped to the plugin
     */
    createLogger: (name: string) => ReturnType<typeof createLogger>;
    /**
     * Path utilities for safe file operations
     */
    path: {
        normalize: typeof normalizePath;
    };
    /**
     * Validation helpers
     */
    validation: {
        isValidClassName: (className: string) => boolean;
        isTailwindClass: (className: string) => boolean;
    };
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * PostCSS Plugin System Types
 * Defines the API contracts for the plugin system integration
 */

/**
 * Core plugin configuration interface
 */
interface PluginConfig {
    /** Plugin name identifier */
    name: string;
    /** Plugin version */
    version?: string;
    /** Plugin options */
    options?: Record<string, unknown>;
    /** Whether plugin is enabled */
    enabled?: boolean;
    /** Plugin execution order priority (lower = earlier) */
    priority?: number;
    /** Plugin timeout in milliseconds */
    timeout?: number;
    /** Plugin metadata */
    metadata?: Record<string, unknown>;
}
/**
 * Plugin result metadata
 */
interface PluginResult {
    /** Plugin that generated this result */
    pluginName: string;
    /** Processing time in milliseconds */
    processingTime: number;
    /** Number of transformations applied */
    transformations: number;
    /** Memory usage in bytes */
    memoryUsage?: number;
    /** Warnings generated during processing */
    warnings: string[];
    /** Dependencies discovered during processing */
    dependencies: string[];
    /** Whether processing was successful */
    success: boolean;
}
/**
 * Plugin context passed to plugins during execution
 */
interface PluginContext {
    /** Current CSS processing result */
    result: Result;
    /** Plugin configuration */
    config: PluginConfig;
    /** Frequency analysis data from pattern analysis */
    frequencyData?: FrequencyAnalysisResult;
    /** Pattern classification data */
    patternData?: FrequencyAnalysisResult;
    /** Project configuration */
    projectConfig: Record<string, unknown>;
    /** Performance metrics collector */
    metrics: PluginMetrics;
    /** Logger instance */
    logger: Logger;
    /** Input data */
    css: string;
    /** Input file path */
    filename?: string;
    /** Plugin utilities */
    utils: PluginUtils;
}
/**
 * Plugin metrics for performance monitoring
 */
interface PluginMetrics {
    /** Start timing measurement */
    startTimer(label: string): void;
    /** End timing measurement */
    endTimer(label: string): number;
    /** Record memory usage */
    recordMemory(usage: number): void;
    /** Add warning */
    addWarning(message: string): void;
    /** Add dependency */
    addDependency(file: string): void;
    /** Get current metrics */
    getMetrics(): PluginResult;
}
/**
 * Enhanced Enigma plugin interface
 */
interface EnigmaPlugin {
    /** Plugin metadata */
    readonly meta: {
        name: string;
        version: string;
        description: string;
        author?: string;
        tags?: string[];
        repository?: string;
    };
    /** Plugin configuration schema (Zod) - optional for enhanced plugins */
    readonly configSchema?: z.ZodSchema;
    /** Initialize plugin with configuration */
    initialize?(config: PluginConfig | EnigmaPluginContext): Promise<void> | void;
    /** Create PostCSS plugin instance - for PostCSS plugins */
    createPlugin?(_context: PluginContext): Plugin;
    /** Process CSS content - for enhanced plugins */
    processCss?(css: string, _context: EnigmaPluginContext): Promise<string>;
    /** Validate plugin configuration - for enhanced plugins */
    validate?(_context: EnigmaPluginContext): Promise<boolean>;
    /** Get plugin health status - for enhanced plugins */
    getHealth?(): Record<string, unknown>;
    /** Cleanup plugin resources */
    cleanup?(): Promise<void> | void;
    /** Plugin dependencies (other plugin names) */
    dependencies?: string[];
    /** Plugin conflicts (incompatible plugin names) */
    conflicts?: string[];
}
/**
 * Plugin manager interface
 */
interface PluginManager {
    /** Register a plugin */
    register(plugin: EnigmaPlugin): void;
    /** Unregister a plugin */
    unregister(pluginName: string): void;
    /** Get registered plugin */
    getPlugin(pluginName: string): EnigmaPlugin | undefined;
    /** Get all registered plugins */
    getAllPlugins(): EnigmaPlugin[];
    /** Check if plugin is registered */
    hasPlugin(pluginName: string): boolean;
    /** Validate plugin dependencies */
    validateDependencies(pluginNames: string[]): ValidationResult;
    /** Get execution order for plugins */
    getExecutionOrder(pluginNames: string[]): string[];
    /** Initialize all plugins */
    initializePlugins(configs: PluginConfig[]): Promise<void>;
    /** Cleanup all plugins */
    cleanup(): Promise<void>;
    /** Execute a plugin with given parameters */
    executePlugin<T = PluginResult>(pluginName: string, ...args: any[]): Promise<T | null>;
    /** Get plugin health status */
    getPluginHealth(pluginName: string): any;
    /** Get all plugin health statuses */
    getAllPluginHealth(): any[];
    /** Enable a plugin */
    enablePlugin(pluginName: string): void;
    /** Disable a plugin */
    disablePlugin(pluginName: string, reason?: string): void;
    /** Discover plugins from various sources */
    discoverPlugins(options: PluginDiscoveryOptions): Promise<EnigmaPlugin[]>;
    /** Get resource usage statistics */
    getResourceStats(): Record<string, any>;
}
/**
 * Plugin validation result
 */
interface ValidationResult {
    /** Whether validation passed */
    valid: boolean;
    /** Validation errors */
    errors: string[];
    /** Validation warnings */
    warnings: string[];
    /** Missing dependencies */
    missingDependencies: string[];
    /** Circular dependencies detected */
    circularDependencies: string[][];
    /** Plugin conflicts */
    conflicts: Array<{
        plugin1: string;
        plugin2: string;
        reason: string;
    }>;
}
/**
 * PostCSS processor configuration
 */
interface ProcessorConfig {
    /** Plugins to apply */
    plugins: PluginConfig[];
    /** Input source map */
    sourceMap?: boolean | 'inline' | string;
    /** Output source map */
    outputSourceMap?: boolean | 'inline' | string;
    /** Input file path for source maps */
    from?: string;
    /** Output file path for source maps */
    to?: string;
    /** CSS parser to use */
    parser?: string | object;
    /** CSS stringifier to use */
    stringifier?: string | object;
    /** CSS syntax to use */
    syntax?: string | object;
}
/**
 * CSS processing result
 */
interface ProcessingResult {
    /** Processed CSS content */
    css: string;
    /** Source map if generated */
    map?: string;
    /** Plugin results */
    pluginResults: PluginResult[];
    /** Processing warnings */
    warnings: Array<{
        plugin: string;
        text: string;
        line?: number;
        column?: number;
    }>;
    /** Dependencies discovered */
    dependencies: string[];
    /** Total processing time */
    totalTime: number;
    /** Peak memory usage */
    peakMemory?: number;
}
/**
 * Plugin discovery options
 */
interface PluginDiscoveryOptions {
    /** Directories to search for plugins */
    searchPaths: string[];
    /** NPM package prefixes to discover */
    npmPrefixes: string[];
    /** Local plugin files to load */
    localPlugins: string[];
    /** Whether to include built-in plugins */
    includeBuiltins: boolean;
}

/**
 * Enhanced plugin context for the new plugin system
 */
interface EnigmaPluginContext {
    /** Current project path */
    projectPath: string;
    /** Current file being processed */
    filePath?: string;
    /** Plugin execution options */
    options: Record<string, unknown>;
    /** Plugin utilities */
    utils: PluginUtils;
    /** Additional context data */
    [key: string]: unknown;
}
/**
 * Base class for Enigma plugins
 */
declare abstract class BaseEnigmaPlugin implements EnigmaPlugin {
    /** Plugin metadata - must be implemented by subclasses */
    abstract readonly meta: {
        name: string;
        version: string;
        description: string;
        author?: string;
        tags?: string[];
        repository?: string;
    };
    protected config: PluginConfig;
    constructor(config?: PluginConfig);
    /**
     * Initialize the plugin - override in subclasses
     */
    initialize(_context: EnigmaPluginContext): Promise<void>;
    /**
     * Process CSS content - must be implemented by subclasses
     */
    processCss(css: string, _context: EnigmaPluginContext): Promise<string>;
    /**
     * Validate plugin configuration - override in subclasses
     */
    validate(_context: EnigmaPluginContext): Promise<boolean>;
    /**
     * Get plugin health status - override in subclasses
     */
    getHealth(): Record<string, unknown>;
    /**
     * Cleanup plugin resources - override in subclasses
     */
    cleanup(): Promise<void>;
}
/**
 * Base class for PostCSS-based Enigma plugins
 */
declare abstract class BasePostCSSEnigmaPlugin extends BaseEnigmaPlugin {
    /**
     * Create PostCSS plugin instance - must be implemented by subclasses
     */
    abstract createPostCSSPlugin(): any;
    /**
     * Process CSS using PostCSS - default implementation using createPostCSSPlugin
     */
    processCss(css: string, _context: EnigmaPluginContext): Promise<string>;
}

/**
 * Framework Detection System for Tailwind Enigma Core
 *
 * Provides comprehensive framework detection capabilities including:
 * - React, Next.js, Vue, Angular, Vite detection
 * - Package.json and dependency analysis
 * - Configuration file parsing
 * - Multi-framework project support
 * - Confidence scoring and priority ranking
 */

declare const FrameworkDetectorOptionsSchema: z.ZodObject<{
    /** Root directory to analyze */
    rootPath: z.ZodDefault<z.ZodString>;
    /** Enable package.json analysis */
    enablePackageAnalysis: z.ZodDefault<z.ZodBoolean>;
    /** Enable configuration file analysis */
    enableConfigAnalysis: z.ZodDefault<z.ZodBoolean>;
    /** Enable source code pattern analysis */
    enableCodeAnalysis: z.ZodDefault<z.ZodBoolean>;
    /** Cache detection results */
    enableCaching: z.ZodDefault<z.ZodBoolean>;
    /** Maximum files to analyze for code patterns */
    maxCodeFiles: z.ZodDefault<z.ZodNumber>;
    /** Confidence threshold for framework detection */
    confidenceThreshold: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    enableCaching: boolean;
    rootPath: string;
    enablePackageAnalysis: boolean;
    enableConfigAnalysis: boolean;
    enableCodeAnalysis: boolean;
    maxCodeFiles: number;
    confidenceThreshold: number;
}, {
    enableCaching?: boolean | undefined;
    rootPath?: string | undefined;
    enablePackageAnalysis?: boolean | undefined;
    enableConfigAnalysis?: boolean | undefined;
    enableCodeAnalysis?: boolean | undefined;
    maxCodeFiles?: number | undefined;
    confidenceThreshold?: number | undefined;
}>;
type FrameworkDetectorOptions = z.infer<typeof FrameworkDetectorOptionsSchema>;
type FrameworkType = 'react' | 'nextjs' | 'vue' | 'angular' | 'vite' | 'svelte' | 'solid' | 'preact' | 'unknown';
interface FrameworkInfo {
    /** Framework identifier */
    type: FrameworkType;
    /** Framework display name */
    name: string;
    /** Detected version (if available) */
    version?: string;
    /** Confidence score (0-1) */
    confidence: number;
    /** Detection sources that identified this framework */
    sources: DetectionSource[];
    /** Framework-specific metadata */
    metadata: {
        /** Main entry points */
        entryPoints?: string[];
        /** Configuration files found */
        configFiles?: string[];
        /** Key dependencies */
        dependencies?: string[];
        /** Build system information */
        buildSystem?: string;
        /** TypeScript support detected */
        hasTypeScript?: boolean;
        /** Additional framework-specific data */
        [key: string]: any;
    };
}
interface DetectionSource {
    /** Source type */
    type: 'package' | 'config' | 'code' | 'filesystem';
    /** Source description */
    description: string;
    /** Confidence contribution (0-1) */
    confidence: number;
    /** Source file or location */
    location?: string;
    /** Evidence found */
    evidence?: string[];
}
interface DetectionContext {
    /** Project root path */
    rootPath: string;
    /** Package.json content (if available) */
    packageJson?: any;
    /** Found configuration files */
    configFiles?: Map<string, any>;
    /** Source file patterns */
    sourcePatterns?: string[];
    /** File system structure */
    fileStructure?: {
        directories: string[];
        files: string[];
    };
}
interface DetectionResult {
    /** Detected frameworks (sorted by confidence) */
    frameworks: FrameworkInfo[];
    /** Primary framework (highest confidence) */
    primary?: FrameworkInfo;
    /** Detection context used */
    context: DetectionContext;
    /** Overall detection confidence */
    overallConfidence: number;
    /** Detection errors or warnings */
    issues: string[];
    /** Performance metrics */
    performance: {
        detectionTime: number;
        filesAnalyzed: number;
        cacheMisses: number;
    };
}
interface IFrameworkDetector {
    /** Framework type this detector handles */
    readonly frameworkType: FrameworkType;
    /** Detector name */
    readonly name: string;
    /** Detect framework from context */
    detect(context: DetectionContext): Promise<FrameworkInfo | null>;
    /** Check if detector can handle this context */
    canDetect(context: DetectionContext): boolean;
}
/**
 * Main Framework Detection Engine
 */
declare class FrameworkDetector {
    private options;
    private detectors;
    private cache;
    constructor(options?: Partial<FrameworkDetectorOptions>);
    /**
     * Detect frameworks in the given directory
     */
    detect(rootPath?: string): Promise<DetectionResult>;
    /**
     * Register a framework detector
     */
    registerDetector(detector: IFrameworkDetector): void;
    /**
     * Get all registered detectors
     */
    getDetectors(): IFrameworkDetector[];
    /**
     * Clear detection cache
     */
    clearCache(): void;
    /**
     * Build detection context from project directory
     */
    private buildDetectionContext;
    /**
     * Run a single detector with error handling
     */
    private runDetector;
    /**
     * Analyze configuration files in the project
     */
    private analyzeConfigFiles;
    /**
     * Analyze source code patterns
     */
    private analyzeSourcePatterns;
    /**
     * Analyze file structure
     */
    private analyzeFileStructure;
    /**
     * Find files by extension (limited search for performance)
     */
    private findFilesByExtension;
    /**
     * Register default framework detectors
     */
    private registerDefaultDetectors;
    /**
     * Ensure default detectors are loaded
     */
    private ensureDetectorsLoaded;
}
/**
 * Create a framework detector with default options
 */
declare function createFrameworkDetector(options?: Partial<FrameworkDetectorOptions>): FrameworkDetector;
/**
 * Quick framework detection for a directory
 */
declare function detectFramework(rootPath: string, options?: Partial<FrameworkDetectorOptions>): Promise<DetectionResult>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Build Tool Plugin Interface
 * Base interface for integrating Tailwind Enigma with build tools
 */

/**
 * Build tool lifecycle phases
 */
type BuildPhase = 'beforeBuild' | 'buildStart' | 'compilation' | 'transform' | 'generateBundle' | 'emit' | 'afterBuild' | 'development' | 'production';
/**
 * Build tool types supported by the integration system
 */
type BuildToolType = 'webpack' | 'vite' | 'esbuild' | 'rollup' | 'nextjs' | 'parcel' | 'custom';
/**
 * Build context information passed to plugin hooks
 */
interface BuildToolContext {
    /** Build tool type */
    buildTool: BuildToolType;
    /** Current build phase */
    phase: BuildPhase;
    /** Whether this is a development build */
    isDevelopment: boolean;
    /** Whether this is a production build */
    isProduction: boolean;
    /** Project root directory */
    projectRoot: string;
    /** Detected framework information */
    framework?: FrameworkInfo;
    /** Build tool configuration */
    buildConfig?: Record<string, any>;
    /** Source files being processed */
    sourceFiles: string[];
    /** Output directory */
    outputDir?: string;
    /** Assets map (filename -> content) */
    assets: Map<string, string>;
    /** CSS optimization results */
    optimizationResults?: OptimizationResult;
    /** Performance metrics */
    metrics: BuildMetrics;
}
/**
 * CSS optimization results from Enigma processing
 */
interface OptimizationResult {
    /** Original CSS size */
    originalSize: number;
    /** Optimized CSS size */
    optimizedSize: number;
    /** Size reduction percentage */
    reductionPercentage: number;
    /** Number of classes processed */
    classesProcessed: number;
    /** Number of classes removed */
    classesRemoved: number;
    /** Processing time in milliseconds */
    processingTime: number;
    /** Generated CSS content */
    css: string;
    /** Source map if generated */
    sourceMap?: string;
}
/**
 * Build performance metrics
 */
interface BuildMetrics {
    /** Build start time */
    startTime: number;
    /** Build end time */
    endTime?: number;
    /** Processing times by phase */
    phaseTimings: Partial<Record<BuildPhase, number>>;
    /** Memory usage peaks */
    memoryPeaks: Partial<Record<BuildPhase, number>>;
    /** Asset sizes */
    assetSizes: Record<string, number>;
    /** File counts */
    fileCounts: {
        total: number;
        processed: number;
        skipped: number;
    };
}
/**
 * HMR (Hot Module Replacement) update information
 */
interface HMRUpdate {
    /** Updated file path */
    filePath: string;
    /** Update type */
    type: 'css' | 'js' | 'asset';
    /** New content */
    content: string;
    /** Source map if available */
    sourceMap?: string;
    /** Timestamp of update */
    timestamp: number;
}
/**
 * Build tool plugin configuration schema
 */
interface BuildToolPluginConfig extends PluginConfig {
    /** Build tool specific options */
    buildTool: {
        /** Build tool type */
        type: BuildToolType;
        /** Auto-detect build tool configuration */
        autoDetect?: boolean;
        /** Custom configuration file path */
        configPath?: string;
        /** Development mode settings */
        development?: {
            /** Enable HMR support */
            hmr?: boolean;
            /** HMR update delay in milliseconds */
            hmrDelay?: number;
            /** Enable live reload */
            liveReload?: boolean;
        };
        /** Production mode settings */
        production?: {
            /** Enable source maps */
            sourceMaps?: boolean;
            /** Minify output */
            minify?: boolean;
            /** Extract CSS to separate files */
            extractCSS?: boolean;
        };
        /** Integration hooks configuration */
        hooks?: {
            /** Enable specific lifecycle hooks */
            enabledPhases?: BuildPhase[];
            /** Hook execution order priority */
            priority?: number;
        };
    };
}
/**
 * Build tool plugin lifecycle hooks
 */
interface BuildToolHooks {
    /** Called before build starts */
    beforeBuild?(context: BuildToolContext): Promise<void> | void;
    /** Called when build starts */
    buildStart?(context: BuildToolContext): Promise<void> | void;
    /** Called during compilation phase */
    compilation?(context: BuildToolContext): Promise<void> | void;
    /** Called during file transformation */
    transform?(context: BuildToolContext, code: string, filePath: string): Promise<string> | string;
    /** Called when generating bundle */
    generateBundle?(context: BuildToolContext): Promise<void> | void;
    /** Called during asset emission */
    emit?(context: BuildToolContext): Promise<void> | void;
    /** Called after build completes */
    afterBuild?(context: BuildToolContext): Promise<void> | void;
    /** Called during development mode */
    development?(context: BuildToolContext): Promise<void> | void;
    /** Called during production mode */
    production?(context: BuildToolContext): Promise<void> | void;
    /** Called on HMR update */
    onHMRUpdate?(update: HMRUpdate, context: BuildToolContext): Promise<void> | void;
    /** Called on file change */
    onFileChange?(filePath: string, context: BuildToolContext): Promise<void> | void;
}
/**
 * Build tool integration result
 */
interface BuildToolResult {
    /** Whether integration was successful */
    success: boolean;
    /** Error message if failed */
    error?: string;
    /** Generated assets */
    assets: Record<string, string>;
    /** Optimization results */
    optimization?: OptimizationResult;
    /** Build metrics */
    metrics: BuildMetrics;
    /** Warnings generated */
    warnings: string[];
}
/**
 * Extended Enigma plugin interface for build tool integration
 */
interface BuildToolPlugin extends EnigmaPlugin {
    /** Plugin type identifier */
    readonly pluginType: 'build-tool';
    /** Plugin name */
    readonly name: string;
    /** Supported build tools */
    readonly supportedBuildTools: readonly BuildToolType[];
    /** Build tool configuration schema */
    readonly buildToolConfigSchema: z.ZodSchema<any>;
    /** Build tool lifecycle hooks */
    readonly hooks: BuildToolHooks;
    /** Initialize with build tool context */
    initializeBuildTool(context: BuildToolContext, config: BuildToolPluginConfig): Promise<void> | void;
    /** Process files during build */
    processBuild(context: BuildToolContext): Promise<BuildToolResult>;
    /** Handle HMR updates */
    handleHMR?(update: HMRUpdate, context: BuildToolContext): Promise<void> | void;
    /** Get build tool configuration */
    getBuildToolConfig?(buildTool: BuildToolType): Record<string, any> | undefined;
}
/**
 * Build tool integration error
 */
declare class BuildToolIntegrationError extends Error {
    readonly buildTool: BuildToolType;
    readonly phase: BuildPhase;
    readonly cause?: Error | undefined;
    constructor(message: string, buildTool: BuildToolType, phase: BuildPhase, cause?: Error | undefined);
}
/**
 * Utility function to check if a plugin is a build tool plugin
 */
declare function isBuildToolPlugin(plugin: any): plugin is BuildToolPlugin;
/**
 * Create build tool context
 */
declare function createBuildToolContext(buildTool: BuildToolType, phase: BuildPhase, options?: Partial<BuildToolContext>): BuildToolContext;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Detected build tool configuration
 */
interface DetectedBuildConfig {
    /** Build tool type */
    buildTool: BuildToolType;
    /** Configuration file path */
    configPath?: string;
    /** Parsed configuration object */
    config: Record<string, any>;
    /** Confidence score (0-1) */
    confidence: number;
    /** Detection source */
    source: 'config-file' | 'package-json' | 'file-structure' | 'framework-detection';
    /** Framework information */
    framework?: FrameworkInfo;
}
/**
 * Auto-configuration result
 */
interface AutoConfigResult {
    /** Successfully detected configurations */
    detected: DetectedBuildConfig[];
    /** Recommended configuration */
    recommended?: DetectedBuildConfig;
    /** Generated plugin configurations */
    pluginConfigs: BuildToolPluginConfig[];
    /** Warning messages */
    warnings: string[];
    /** Errors encountered */
    errors: string[];
}
/**
 * Configuration detector class
 */
declare class ConfigDetector {
    private frameworkDetector;
    private patterns;
    constructor();
    /**
     * Auto-detect build tool configurations in a project
     */
    detectConfiguration(projectRoot: string): Promise<AutoConfigResult>;
    /**
     * Initialize detection patterns for different build tools
     */
    private initializePatterns;
    /**
     * Detect build tool configurations
     */
    private detectBuildTool;
    /**
     * Webpack detection
     */
    private detectWebpack;
    /**
     * Vite detection
     */
    private detectVite;
    /**
     * Next.js detection
     */
    private detectNextjs;
    /**
     * ESBuild detection
     */
    private detectESBuild;
    /**
     * Rollup detection
     */
    private detectRollup;
    /**
     * Parcel detection
     */
    private detectParcel;
    /**
     * Remove duplicate configurations
     */
    private deduplicateConfigs;
    /**
     * Generate plugin configurations based on detected build tools
     */
    private generatePluginConfigs;
    /**
     * Get build tool priority for execution order
     */
    private getBuildToolPriority;
    /**
     * Get enabled phases for a build tool
     */
    private getEnabledPhases;
    /**
     * Customize plugin configuration for specific frameworks
     */
    private customizeForFramework;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * HMR Handler - Hot Module Replacement for CSS Updates
 * Manages live reloading and hot updates for Tailwind CSS changes during development
 */

/**
 * HMR update types
 */
type HMRUpdateType = 'css' | 'js' | 'asset' | 'full-reload';
/**
 * HMR configuration options
 */
interface HMRConfig {
    /** Enable HMR */
    enabled: boolean;
    /** Update delay in milliseconds */
    delay: number;
    /** Port for HMR server */
    port?: number;
    /** Enable live reload as fallback */
    liveReload: boolean;
    /** Include source maps in updates */
    sourceMaps: boolean;
    /** File extensions to watch */
    watchExtensions: string[];
    /** Directories to watch */
    watchDirectories: string[];
    /** Files/patterns to ignore */
    ignore: string[];
}
/**
 * HMR update payload
 */
interface HMRUpdatePayload {
    /** Update type */
    type: HMRUpdateType;
    /** File path that changed */
    filePath: string;
    /** New CSS content */
    css?: string;
    /** Source map */
    sourceMap?: string;
    /** Optimization results */
    optimization?: OptimizationResult;
    /** Timestamp */
    timestamp: number;
    /** Build tool that triggered the update */
    buildTool: BuildToolType;
}
/**
 * HMR client connection interface
 */
interface HMRClient {
    /** Client ID */
    id: string;
    /** Send update to client */
    send(payload: HMRUpdatePayload): void;
    /** Close client connection */
    close(): void;
    /** Check if client is connected */
    isConnected(): boolean;
}
/**
 * HMR server interface for different build tools
 */
interface HMRServer {
    /** Start HMR server */
    start(port?: number): Promise<void>;
    /** Stop HMR server */
    stop(): Promise<void>;
    /** Send update to all clients */
    broadcast(payload: HMRUpdatePayload): void;
    /** Get connected clients */
    getClients(): HMRClient[];
    /** Check if server is running */
    isRunning(): boolean;
}
/**
 * Main HMR handler class
 */
declare class HMRHandler extends EventEmitter {
    private config;
    private updateQueue;
    private isProcessing;
    private lastUpdate;
    private servers;
    private fileWatchers;
    constructor(config?: Partial<HMRConfig>);
    /**
     * Initialize HMR for a build tool
     */
    initialize(buildTool: BuildToolType, server: HMRServer): Promise<void>;
    /**
     * Handle CSS update
     */
    handleCSSUpdate(filePath: string, css: string, context: BuildToolContext, optimization?: OptimizationResult): Promise<void>;
    /**
     * Handle asset update
     */
    handleAssetUpdate(filePath: string, content: string, context: BuildToolContext): Promise<void>;
    /**
     * Trigger full page reload
     */
    triggerReload(context: BuildToolContext, reason?: string): Promise<void>;
    /**
     * Queue an HMR update
     */
    private queueUpdate;
    /**
     * Process the update queue
     */
    private processQueue;
    /**
     * Process a single update
     */
    private processUpdate;
    /**
     * Start file watching for automatic updates
     */
    startWatching(projectRoot: string): Promise<void>;
    /**
     * Stop file watching
     */
    stopWatching(): Promise<void>;
    /**
     * Shutdown HMR handler
     */
    shutdown(): Promise<void>;
    /**
     * Get HMR statistics
     */
    getStats(): {
        enabled: boolean;
        queueLength: number;
        isProcessing: boolean;
        lastUpdate: number;
        connectedServers: BuildToolType[];
        totalClients: number;
    };
    /**
     * Update HMR configuration
     */
    updateConfig(newConfig: Partial<HMRConfig>): void;
}
/**
 * Create HMR handler instance
 */
declare function createHMRHandler(config?: Partial<HMRConfig>): HMRHandler;
/**
 * Default HMR configuration
 */
declare const defaultHMRConfig: HMRConfig;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Integration Manager - Central orchestrator for build tool integrations
 * Manages plugin lifecycle, auto-detection, and coordination between different build tools
 */

/**
 * Integration manager configuration
 */
interface IntegrationManagerConfig {
    /** Auto-detect build tools */
    autoDetect: boolean;
    /** Project root directory */
    projectRoot: string;
    /** Enable HMR for development */
    hmr: boolean;
    /** Plugin priorities */
    priorities: Record<BuildToolType, number>;
    /** Enabled build tools */
    enabledTools: BuildToolType[];
    /** Plugin configurations */
    pluginConfigs: Record<string, BuildToolPluginConfig>;
}
/**
 * Integration status
 */
interface IntegrationStatus {
    /** Whether integration is active */
    active: boolean;
    /** Detected build tools */
    detectedTools: BuildToolType[];
    /** Active plugins */
    activePlugins: string[];
    /** Current build context */
    context?: BuildToolContext;
    /** Last update timestamp */
    lastUpdate: number;
    /** Error count */
    errors: number;
    /** Warning count */
    warnings: number;
}
/**
 * Integration event types
 */
interface IntegrationEvents {
    initialized: {
        tools: BuildToolType[];
    };
    'plugin-loaded': {
        name: string;
        buildTool: BuildToolType;
    };
    'plugin-error': {
        name: string;
        error: Error;
    };
    'build-started': {
        context: BuildToolContext;
    };
    'build-completed': {
        result: BuildToolResult;
    };
    'hmr-update': {
        filePath: string;
        buildTool: BuildToolType;
    };
    'config-detected': {
        result: AutoConfigResult;
    };
}
/**
 * Integration manager class
 */
declare class IntegrationManager extends EventEmitter {
    private config;
    private configDetector;
    private hmrHandler;
    private plugins;
    private activeContexts;
    private status;
    constructor(config?: Partial<IntegrationManagerConfig>);
    /**
     * Initialize the integration manager
     */
    initialize(): Promise<void>;
    /**
     * Auto-detect build tools and generate configurations
     */
    detectAndConfigure(): Promise<void>;
    /**
     * Load and register plugins
     */
    loadPlugins(): Promise<void>;
    /**
     * Load a single plugin
     */
    loadPlugin(name: string, config: BuildToolPluginConfig): Promise<void>;
    /**
     * Create a plugin instance based on build tool type
     */
    private createPlugin;
    /**
     * Start build process with all active plugins
     */
    startBuild(buildTool: BuildToolType, options?: Partial<BuildToolContext>): Promise<BuildToolResult>;
    /**
     * Handle file changes for HMR
     */
    handleFileChange(filePath: string): Promise<void>;
    /**
     * Get plugin priority for sorting
     */
    private getPluginPriority;
    /**
     * Register a custom plugin
     */
    registerPlugin(name: string, plugin: BuildToolPlugin, config: BuildToolPluginConfig): void;
    /**
     * Unregister a plugin
     */
    unregisterPlugin(name: string): void;
    /**
     * Get current status
     */
    getStatus(): IntegrationStatus;
    /**
     * Get active plugins
     */
    getActivePlugins(): Map<string, BuildToolPlugin>;
    /**
     * Update configuration
     */
    updateConfig(newConfig: Partial<IntegrationManagerConfig>): void;
    /**
     * Shutdown the integration manager
     */
    shutdown(): Promise<void>;
}
/**
 * Create integration manager instance
 */
declare function createIntegrationManager(config?: Partial<IntegrationManagerConfig>): IntegrationManager;
/**
 * Default integration manager configuration
 */
declare const defaultIntegrationConfig: IntegrationManagerConfig;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Performance Configuration and Type Definitions
 * Centralizes all configuration options for performance optimizations
 */

/**
 * Cache strategy options
 */
type CacheStrategy = 'lru' | 'lfu' | 'ttl' | 'arc';
/**
 * Worker task types for type-safe worker communication
 */
interface WorkerTask<T = unknown> {
    id: string;
    type: string;
    data: T;
    timeout?: number;
    priority?: 'low' | 'normal' | 'high' | 'critical';
    metadata?: Record<string, unknown>;
}
/**
 * Worker configuration options
 */
interface WorkerConfig {
    enabled: boolean;
    poolSize: number;
    taskTimeout: number;
    maxQueueSize: number;
    enableFallback: boolean;
    workerScript?: string;
    envVars?: Record<string, string>;
}
/**
 * Caching configuration options
 */
interface CacheConfig {
    enabled: boolean;
    maxSize: number;
    strategy: CacheStrategy;
    ttl?: number;
    persistence: boolean;
    persistencePath?: string;
    compressionEnabled: boolean;
    memoryPressureThreshold: number;
    cleanupInterval?: number;
}
/**
 * Memory optimization configuration
 */
interface MemoryConfig {
    maxSemiSpaceSize: number;
    maxOldSpaceSize: number;
    enableGCOptimization: boolean;
    memoryBudget: number;
    enableObjectPooling: boolean;
    gcThreshold: number;
}
/**
 * Performance profiling configuration
 */
interface ProfilingConfig {
    enabled: boolean;
    samplingRate: number;
    enableFlameGraphs: boolean;
    enableMemoryProfiling: boolean;
    enableCPUProfiling: boolean;
    outputDirectory: string;
    autoExport: boolean;
    enableOpenTelemetry: boolean;
    sampleInterval: number;
    enableGC: boolean;
    enableEventLoop: boolean;
    enableMemoryDetails: boolean;
    maxSamples: number;
    autoAnalysis: boolean;
    outputDir: string;
    clinicJsPath: string;
    zeroXPath: string;
    enableClinicJs: boolean;
    enable0x: boolean;
}
/**
 * Stream processing configuration
 */
interface StreamConfig {
    enabled: boolean;
    highWaterMark: number;
    enableBackpressure: boolean;
    maxConcurrentStreams: number;
    chunkSize: number;
}
/**
 * Batch processing configuration
 */
interface BatchConfig {
    enabled: boolean;
    defaultBatchSize: number;
    maxBatchSize: number;
    processingDelay: number;
    enablePrioritization: boolean;
    maxConcurrentBatches: number;
    maxConcurrency: number;
    batchSize: number;
    priorityLevels: string[];
    retryAttempts: number;
    queueTimeout: number;
    enableDependencies: boolean;
    retryDelay: number;
    resourceLimits: {
        maxMemoryUsage: number;
        maxCpuUsage: number;
    };
}
/**
 * Complete performance configuration
 */
interface PerformanceConfig {
    workers: WorkerConfig;
    cache: CacheConfig;
    memory: MemoryConfig;
    profiling: ProfilingConfig;
    streams: StreamConfig;
    batching: BatchConfig;
    enableAnalytics: boolean;
    logLevel: 'debug' | 'info' | 'warn' | 'error';
    environmentProfile?: 'development' | 'production' | 'testing';
}
/**
 * Performance metrics interface
 */
interface PerformanceMetrics {
    operationDuration: number;
    totalExecutionTime: number;
    averageOperationTime: number;
    heapUsed: number;
    heapTotal: number;
    external: number;
    rss: number;
    activeWorkers: number;
    queuedTasks: number;
    completedTasks: number;
    failedTasks: number;
    cacheHits: number;
    cacheMisses: number;
    cacheSize: number;
    cacheHitRate: number;
    cpuUsage: number;
    memoryUsage: number;
    eventLoopLag: number;
    throughput: number;
    latency: number;
    errorRate: number;
    timestamp: number;
}
/**
 * Resource usage information
 */
interface SystemResources {
    totalMemory: number;
    freeMemory: number;
    cpuCount: number;
    platform: string;
    nodeVersion: string;
    v8Version: string;
    uptime: number;
}
/**
 * Performance event types for EventEmitter
 */
interface PerformanceEvents extends EventEmitter {
    on(event: 'metrics', listener: (metrics: PerformanceMetrics) => void): this;
    on(event: 'warning', listener: (warning: {
        type: string;
        message: string;
        data?: unknown;
    }) => void): this;
    on(event: 'error', listener: (error: Error) => void): this;
    on(event: 'workerStarted', listener: (workerId: string) => void): this;
    on(event: 'workerStopped', listener: (workerId: string) => void): this;
    on(event: 'cacheEviction', listener: (key: string, reason: string) => void): this;
    on(event: 'memoryPressure', listener: (usage: number) => void): this;
    on(event: 'performanceBudgetExceeded', listener: (operation: string, duration: number) => void): this;
}
/**
 * Default performance configuration with sensible defaults
 */
declare const DEFAULT_PERFORMANCE_CONFIG: PerformanceConfig;
/**
 * Environment-specific configuration profiles
 */
declare const ENVIRONMENT_PROFILES: {
    readonly development: {
        readonly profiling: {
            readonly enabled: true;
            readonly enableFlameGraphs: true;
            readonly enableMemoryProfiling: true;
        };
        readonly logLevel: "debug";
        readonly workers: {
            readonly poolSize: 2;
        };
    };
    readonly testing: {
        readonly workers: {
            readonly enabled: false;
        };
        readonly cache: {
            readonly enabled: false;
        };
        readonly profiling: {
            readonly enabled: false;
        };
        readonly logLevel: "warn";
    };
    readonly production: {
        readonly profiling: {
            readonly enabled: false;
        };
        readonly memory: {
            readonly enableGCOptimization: true;
            readonly maxSemiSpaceSize: 128;
        };
        readonly logLevel: "error";
    };
};
/**
 * Validates performance configuration
 */
declare function validatePerformanceConfig(config: Partial<PerformanceConfig>): string[];
/**
 * Merges configuration with environment-specific overrides
 */
declare function createEnvironmentConfig(baseConfig?: Partial<PerformanceConfig>, environment?: keyof typeof ENVIRONMENT_PROFILES): PerformanceConfig;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Worker pool statistics
 */
interface WorkerPoolStats {
    totalWorkers: number;
    activeWorkers: number;
    busyWorkers: number;
    queuedTasks: number;
    completedTasks: number;
    failedTasks: number;
    averageTaskTime: number;
    throughput: number;
    errorRate: number;
}
/**
 * High-performance worker thread pool manager
 */
declare class WorkerManager extends EventEmitter {
    private workers;
    private taskQueue;
    private runningTasks;
    private workerScripts;
    private stats;
    private config;
    private isShuttingDown;
    private metricsInterval?;
    constructor(config?: Partial<WorkerConfig>);
    /**
     * Initialize the worker pool
     */
    initialize(): Promise<void>;
    /**
     * Register a worker script for specific task types
     */
    registerWorkerScript(taskType: string, scriptPath: string): void;
    /**
     * Execute a task using worker threads
     */
    executeTask<T = unknown, R = unknown>(task: WorkerTask<T>): Promise<R>;
    /**
     * Execute multiple tasks in parallel with optional concurrency limit
     */
    executeTasks<T = unknown, R = unknown>(tasks: WorkerTask<T>[], concurrency?: number): Promise<R[]>;
    /**
     * Get current worker pool statistics
     */
    getStats(): WorkerPoolStats;
    /**
     * Gracefully shutdown the worker pool
     */
    shutdown(): Promise<void>;
    /**
     * Create and initialize a new worker
     */
    private createWorker;
    /**
     * Process the task queue
     */
    private processQueue;
    /**
     * Assign a task to a worker
     */
    private assignTaskToWorker;
    /**
     * Handle worker message responses
     */
    private handleWorkerMessage;
    /**
     * Handle task completion
     */
    private handleTaskComplete;
    /**
     * Handle worker errors
     */
    private handleWorkerError;
    /**
     * Handle worker exit
     */
    private handleWorkerExit;
    /**
     * Handle task timeout
     */
    private handleTaskTimeout;
    /**
     * Restart a worker
     */
    private restartWorker;
    /**
     * Start metrics collection
     */
    private startMetricsCollection;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Intelligent Caching System for Tailwind Enigma Core
 *
 * Provides multi-tier caching with different strategies:
 * - LRU (Least Recently Used)
 * - LFU (Least Frequently Used)
 * - TTL (Time To Live)
 * - ARC (Adaptive Replacement Cache)
 *
 * Features:
 * - Memory-aware cache sizing
 * - Cache analytics and monitoring
 * - Optional persistence layer
 * - Configurable eviction policies
 * - Performance metrics collection
 */

/**
 * Cache statistics for monitoring
 */
interface CacheStats {
    hits: number;
    misses: number;
    evictions: number;
    totalSize: number;
    entryCount: number;
    hitRate: number;
    averageAccessTime: number;
    memoryUsage: number;
}
/**
 * Intelligent cache manager with multiple strategies and analytics
 */
declare class CacheManager<T = unknown> extends EventEmitter {
    private readonly config;
    private readonly cache;
    private readonly stats;
    private readonly arcLists?;
    private persistenceTimer?;
    private cleanupTimer?;
    private compressionEnabled;
    constructor(config?: Partial<CacheConfig>);
    /**
     * Get value from cache
     */
    get(key: string): Promise<T | undefined>;
    /**
     * Set value in cache
     */
    set(key: string, value: T, options?: {
        ttl?: number;
        priority?: number;
    }): Promise<boolean>;
    /**
     * Delete value from cache
     */
    delete(key: string): Promise<boolean>;
    /**
     * Clear all cache entries
     */
    clear(): Promise<void>;
    /**
     * Check if key exists in cache
     */
    has(key: string): boolean;
    /**
     * Get cache statistics
     */
    getStats(): CacheStats & {
        config: CacheConfig;
    };
    /**
     * Get cache keys
     */
    keys(): string[];
    /**
     * Get cache size
     */
    size(): number;
    /**
     * Cleanup expired entries
     */
    private cleanup;
    /**
     * Ensure there's enough space for new entry
     */
    private ensureSpace;
    /**
     * Select candidate for eviction based on strategy
     */
    private selectEvictionCandidate;
    /**
     * LRU eviction candidate selection
     */
    private selectLRUCandidate;
    /**
     * LFU eviction candidate selection
     */
    private selectLFUCandidate;
    /**
     * TTL eviction candidate selection
     */
    private selectTTLCandidate;
    /**
     * ARC eviction candidate selection
     */
    private selectARCCandidate;
    /**
     * Evict entry from cache
     */
    private evict;
    /**
     * ARC strategy: handle cache hit
     */
    private arcOnHit;
    /**
     * ARC strategy: handle cache insertion
     */
    private arcOnInsert;
    /**
     * ARC strategy: handle deletion
     */
    private arcOnDelete;
    /**
     * Update access metadata for entry
     */
    private updateAccessMetadata;
    /**
     * Check if entry is expired
     */
    private isExpired;
    /**
     * Calculate size of value for memory management
     */
    private calculateSize;
    /**
     * Update cache statistics
     */
    private updateStats;
    /**
     * Record cache hit
     */
    private recordHit;
    /**
     * Record cache miss
     */
    private recordMiss;
    /**
     * Update average access time
     */
    private updateAverageAccessTime;
    /**
     * Update hit rate
     */
    private updateHitRate;
    /**
     * Reset statistics
     */
    private resetStats;
    /**
     * Start periodic cleanup of expired entries
     */
    private startPeriodicCleanup;
    /**
     * Start persistence operations
     */
    private startPersistence;
    /**
     * Load entry from persistent storage
     */
    private loadFromPersistence;
    /**
     * Persist single entry
     */
    private persistEntry;
    /**
     * Persist all entries
     */
    private persistAll;
    /**
     * Remove entry from persistent storage
     */
    private removeFromPersistence;
    /**
     * Clear persistent storage
     */
    private clearPersistence;
    /**
     * Cleanup resources
     */
    destroy(): Promise<void>;
}
/**
 * Factory function to create cache manager with validation
 */
declare function createCacheManager<T = unknown>(config?: Partial<CacheConfig>): CacheManager<T>;
/**
 * Get or create global cache manager instance
 */
declare function getGlobalCacheManager<T = unknown>(config?: Partial<CacheConfig>): CacheManager<T>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Regex performance metrics
 */
interface RegexPerformanceMetrics {
    pattern: string;
    totalExecutions: number;
    totalExecutionTime: number;
    averageExecutionTime: number;
    minExecutionTime: number;
    maxExecutionTime: number;
    compilationTime: number;
    usageFrequency: number;
    isHotPath: boolean;
    lastUsed: number;
}
/**
 * Regex optimization suggestions
 */
interface RegexOptimizationSuggestion {
    pattern: string;
    issue: 'catastrophic_backtracking' | 'inefficient_quantifier' | 'unnecessary_capture' | 'anchor_optimization' | 'character_class_optimization';
    severity: 'low' | 'medium' | 'high' | 'critical';
    description: string;
    suggestion: string;
    optimizedPattern?: string;
    estimatedImprovement?: string;
}
/**
 * Regex analysis result
 */
interface RegexAnalysis {
    isValid: boolean;
    complexity: 'low' | 'medium' | 'high' | 'dangerous';
    estimatedPerformance: 'excellent' | 'good' | 'fair' | 'poor' | 'terrible';
    potentialIssues: RegexOptimizationSuggestion[];
    recommendations: string[];
    safetyScore: number;
}
/**
 * Regex optimizer configuration
 */
interface RegexOptimizerConfig {
    enabled: boolean;
    cacheSize: number;
    hotPathThreshold: number;
    performanceMonitoring: boolean;
    optimizationSuggestions: boolean;
    lazyCompilation: boolean;
    maxCacheAge: number;
    precompileCommonPatterns: boolean;
}
/**
 * Common regex patterns for CSS processing
 */
declare const COMMON_CSS_PATTERNS: {
    readonly TAILWIND_CLASS: RegExp;
    readonly CSS_CLASS_SIMPLE: RegExp;
    readonly CSS_CLASS_ATTRIBUTE: RegExp;
    readonly HTML_TAG: RegExp;
    readonly CSS_VARIABLE: RegExp;
    readonly CSS_FUNCTION: RegExp;
    readonly WHITESPACE_NORMALIZE: RegExp;
    readonly CSS_COMMENT: RegExp;
    readonly CSS_IMPORT: RegExp;
    readonly CSS_SELECTOR: RegExp;
};
/**
 * High-performance regex optimization engine
 */
declare class RegexOptimizer extends EventEmitter {
    private readonly config;
    private readonly cache;
    private readonly performanceMetrics;
    private readonly lazyPatterns;
    private hotPaths;
    private compilationCount;
    private totalCompilationTime;
    constructor(config?: Partial<RegexOptimizerConfig>);
    /**
     * Get or compile regex pattern with caching and optimization
     */
    compile(pattern: string, flags?: string, source?: string): Promise<RegExp>;
    /**
     * Execute regex with performance monitoring
     */
    exec(pattern: string | RegExp, input: string, flags?: string): Promise<RegExpExecArray | null>;
    /**
     * Test regex with performance monitoring
     */
    test(pattern: string | RegExp, input: string, flags?: string): Promise<boolean>;
    /**
     * Match string with regex and performance monitoring
     */
    match(input: string, pattern: string | RegExp, flags?: string): Promise<RegExpMatchArray | null>;
    /**
     * Replace with regex and performance monitoring
     */
    replace(input: string, pattern: string | RegExp, replacement: string | ((match: string, ...args: any[]) => string), flags?: string): Promise<string>;
    /**
     * Analyze regex pattern for potential issues
     */
    analyzePattern(pattern: string, flags?: string): RegexAnalysis;
    /**
     * Get performance statistics
     */
    getPerformanceStats(): {
        totalPatterns: number;
        hotPaths: string[];
        topPerformers: RegexPerformanceMetrics[];
        bottomPerformers: RegexPerformanceMetrics[];
        averageCompilationTime: number;
        cacheHitRate: number;
        totalCompilations: number;
    };
    /**
     * Get optimization suggestions for all patterns
     */
    getOptimizationSuggestions(): RegexOptimizationSuggestion[];
    /**
     * Clear cache and reset statistics
     */
    reset(): Promise<void>;
    /**
     * Cache compiled regex
     */
    private cacheCompiledRegex;
    /**
     * Update execution performance metrics
     */
    private updateExecutionMetrics;
    /**
     * Update compilation statistics
     */
    private updateCompilationStats;
    /**
     * Update performance metrics for cache hits/misses
     */
    private updatePerformanceMetrics;
    /**
     * Check for optimization opportunities
     */
    private checkOptimizationOpportunities;
    /**
     * Precompile common CSS processing patterns
     */
    private precompileCommonPatterns;
    /**
     * Set up cache event handlers
     */
    private setupCacheEventHandlers;
    /**
     * Cleanup resources
     */
    destroy(): Promise<void>;
}
/**
 * Get or create global regex optimizer
 */
declare function getGlobalRegexOptimizer(config?: Partial<RegexOptimizerConfig>): RegexOptimizer;

/**
 * Quick compile function for common use cases
 */
declare function compileRegex(pattern: string, flags?: string): Promise<RegExp>;
/**
 * Quick match function with optimization
 */
declare function matchOptimized(input: string, pattern: string | RegExp, flags?: string): Promise<RegExpMatchArray | null>;
/**
 * Quick replace function with optimization
 */
declare function replaceOptimized(input: string, pattern: string | RegExp, replacement: string, flags?: string): Promise<string>;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Stream processing statistics
 */
interface StreamStats {
    bytesProcessed: number;
    itemsProcessed: number;
    startTime: number;
    endTime?: number;
    throughput: number;
    itemThroughput: number;
    backpressureEvents: number;
    errorCount: number;
}
/**
 * Stream processing options
 */
interface StreamProcessingOptions {
    chunkSize?: number;
    highWaterMark?: number;
    enableBackpressure?: boolean;
    maxConcurrentStreams?: number;
    enableProgress?: boolean;
    progressInterval?: number;
    encoding?: BufferEncoding;
    objectMode?: boolean;
}
/**
 * Progress information for stream processing
 */
interface StreamProgress {
    totalBytes?: number;
    processedBytes: number;
    totalItems?: number;
    processedItems: number;
    percentComplete: number;
    estimatedTimeRemaining: number;
    currentThroughput: number;
    averageThroughput: number;
}
/**
 * Stream processing result
 */
interface StreamResult<T = unknown> {
    success: boolean;
    data?: T;
    stats: StreamStats;
    error?: Error;
    progress?: StreamProgress;
}
/**
 * High-performance stream optimizer for large file processing
 */
declare class StreamOptimizer extends EventEmitter {
    private config;
    private activeStreams;
    private transformCache;
    constructor(config?: Partial<StreamConfig>);
    /**
     * Process a file using streaming with custom transform functions
     */
    processFile<T = string>(filePath: string, transforms: Array<(chunk: Buffer | string) => Promise<T> | T>, options?: StreamProcessingOptions): Promise<StreamResult<T[]>>;
    /**
     * Process large text data in chunks using streaming
     */
    processTextStream(text: string, processor: (chunk: string) => Promise<string> | string, options?: StreamProcessingOptions): Promise<StreamResult<string>>;
    /**
     * Create a batch stream processor for handling multiple files
     */
    processBatchStream<T>(filePaths: string[], processor: (filePath: string, content: Buffer) => Promise<T> | T, options?: StreamProcessingOptions): Promise<StreamResult<T[]>>;
    /**
     * Get statistics for all active streams
     */
    getActiveStreamStats(): Map<string, StreamStats>;
    /**
     * Get overall stream processing metrics
     */
    getOverallMetrics(): PerformanceMetrics;
    /**
     * Create a transform stream chain from multiple transform functions
     */
    private createTransformChain;
    /**
     * Setup backpressure monitoring for streams
     */
    private setupBackpressureMonitoring;
    /**
     * Process a single file with memory and concurrency limiting
     */
    private processFileWithLimiter;
    /**
     * Calculate estimated time to completion
     */
    private calculateETA;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Batch Processing Coordinator for Tailwind Enigma Core
 *
 * Orchestrates multiple optimization tasks with intelligent batching,
 * resource management, and performance optimization strategies.
 */

/**
 * Batch job definition
 */
interface BatchJob<T = unknown> {
    id: string;
    type: string;
    input: T;
    priority: 'low' | 'medium' | 'high' | 'critical';
    estimatedDuration?: number;
    dependencies?: string[];
    retryCount?: number;
    maxRetries?: number;
    timeout?: number;
    metadata?: Record<string, unknown>;
}
/**
 * Batch execution result
 */
interface BatchResult<R = unknown> {
    jobId: string;
    success: boolean;
    result?: R;
    error?: Error;
    duration: number;
    retryCount: number;
    metadata?: Record<string, unknown>;
}
/**
 * Batch processing statistics
 */
interface BatchStats {
    totalJobs: number;
    completedJobs: number;
    failedJobs: number;
    averageDuration: number;
    totalDuration: number;
    throughput: number;
    successRate: number;
    errorRate: number;
    currentConcurrency: number;
    maxConcurrency: number;
    queueLength: number;
    resourceUtilization: {
        cpu: number;
        memory: number;
        activeWorkers: number;
    };
}
/**
 * Batch execution options
 */
interface BatchExecutionOptions {
    maxConcurrency?: number;
    batchSize?: number;
    timeout?: number;
    retryStrategy?: 'none' | 'linear' | 'exponential';
    priorityQueue?: boolean;
    enableDependencies?: boolean;
    resourceLimits?: {
        maxMemory?: number;
        maxCpu?: number;
    };
    groupingStrategy?: 'type' | 'priority' | 'size' | 'mixed';
}
/**
 * Job processor function type
 */
type JobProcessor<T = unknown, R = unknown> = (input: T, job: BatchJob<T>) => Promise<R> | R;
/**
 * Batch processing coordinator that efficiently manages multiple optimization tasks
 */
declare class BatchCoordinator extends EventEmitter {
    private config;
    private jobQueue;
    private priorityQueues;
    private processingJobs;
    private completedJobs;
    private processors;
    private dependencyGraph;
    private stats;
    private isProcessing;
    private resourceMonitor?;
    constructor(config?: Partial<BatchConfig>);
    /**
     * Register a job processor for a specific job type
     */
    registerProcessor<T, R>(jobType: string, processor: JobProcessor<T, R>): void;
    /**
     * Add a single job to the batch queue
     */
    addJob<T>(job: BatchJob<T>): string;
    /**
     * Add multiple jobs to the batch queue
     */
    addBatch<T>(jobs: Array<Omit<BatchJob<T>, 'id'>>): string[];
    /**
     * Execute all jobs in the queue with optimal batching and concurrency
     */
    executeBatch(options?: BatchExecutionOptions): Promise<BatchResult[]>;
    /**
     * Get current batch processing statistics
     */
    getStats(): BatchStats;
    /**
     * Get job status and result
     */
    getJobResult(jobId: string): BatchResult | null;
    /**
     * Cancel a pending job
     */
    cancelJob(jobId: string): boolean;
    /**
     * Clear all pending jobs
     */
    clearQueue(): void;
    /**
     * Shutdown the batch coordinator gracefully
     */
    shutdown(timeout?: number): Promise<void>;
    /**
     * Start the main processing loop
     */
    private startProcessing;
    /**
     * Process a single job with error handling and retries
     */
    private processJob;
    /**
     * Execute job with timeout handling
     */
    private executeJobWithTimeout;
    /**
     * Handle job completion result
     */
    private handleJobResult;
    /**
     * Group jobs by the specified strategy
     */
    private groupJobs;
    /**
     * Group jobs by type
     */
    private groupByType;
    /**
     * Group jobs by priority
     */
    private groupByPriority;
    /**
     * Group jobs by estimated size/duration
     */
    private groupBySize;
    /**
     * Mixed grouping strategy (balanced approach)
     */
    private groupMixed;
    /**
     * Process a group of jobs with concurrency control
     */
    private processJobGroup;
    /**
     * Get next jobs to process based on priorities and dependencies
     */
    private getNextJobs;
    /**
     * Add job to priority queue
     */
    private addToPriorityQueue;
    /**
     * Remove job from all priority queues
     */
    private removeFromPriorityQueues;
    /**
     * Build dependency graph for a job
     */
    private buildDependencyGraph;
    /**
     * Check if job dependencies are satisfied
     */
    private areDependenciesSatisfied;
    /**
     * Release jobs that were waiting for a dependency
     */
    private releaseDependentJobs;
    /**
     * Setup resource monitoring
     */
    private setupResourceMonitoring;
    /**
     * Update resource utilization metrics
     */
    private updateResourceUtilization;
    /**
     * Update runtime statistics
     */
    private updateRuntimeStats;
    /**
     * Update final batch statistics
     */
    private updateFinalStats;
    /**
     * Cleanup resources
     */
    private cleanup;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Memory usage snapshot
 */
interface MemorySnapshot {
    timestamp: number;
    heapUsed: number;
    heapTotal: number;
    external: number;
    rss: number;
    arrayBuffers: number;
    totalHeapSize: number;
    totalHeapSizeExecutable: number;
    totalPhysicalSize: number;
    totalAvailableSize: number;
    usedHeapSize: number;
    heapSizeLimit: number;
    mallocedMemory: number;
    peakMallocedMemory: number;
    doesZapGarbage: number;
    numberOfNativeContexts: number;
    numberOfDetachedContexts: number;
}
/**
 * Memory leak detection result
 */
interface MemoryLeakInfo {
    type: 'gradual_increase' | 'sudden_spike' | 'memory_not_released' | 'gc_ineffective';
    severity: 'low' | 'medium' | 'high' | 'critical';
    description: string;
    memoryIncrease: number;
    timeframe: number;
    recommendations: string[];
    stackTrace?: string;
    objectTypes?: Map<string, number>;
}
/**
 * Object pool for memory optimization
 */
interface ObjectPool<T> {
    name: string;
    maxSize: number;
    currentSize: number;
    available: T[];
    inUse: Set<T>;
    factory: () => T;
    reset: (obj: T) => void;
    totalCreated: number;
    totalReused: number;
    reuseRate: number;
}
/**
 * Memory profiling session
 */
interface ProfilingSession$1 {
    id: string;
    startTime: number;
    endTime?: number;
    snapshots: MemorySnapshot[];
    leaks: MemoryLeakInfo[];
    gcStats: GCStats[];
    objectPoolStats: Map<string, ObjectPool<any>>;
    recommendations: string[];
}
/**
 * Garbage collection statistics
 */
interface GCStats {
    timestamp: number;
    type: 'minor' | 'major' | 'incremental';
    duration: number;
    memoryBefore: number;
    memoryAfter: number;
    memoryFreed: number;
    pauseTime: number;
}
/**
 * Memory optimization recommendations
 */
interface MemoryRecommendation {
    type: 'gc_tuning' | 'object_pooling' | 'memory_leak' | 'buffer_optimization' | 'v8_flags';
    priority: 'low' | 'medium' | 'high' | 'critical';
    description: string;
    action: string;
    estimatedImprovement: string;
    implementation?: string;
}
/**
 * Advanced memory profiler and optimizer
 */
declare class MemoryProfiler extends EventEmitter {
    private readonly config;
    private readonly sessions;
    private readonly objectPools;
    private activeSession;
    private snapshots;
    private gcObserver;
    private memoryMonitorInterval;
    private leakDetectionInterval;
    private lastGCStats;
    private memoryBaseline;
    private memoryAlerts;
    constructor(config?: Partial<MemoryConfig>);
    /**
     * Start a new profiling session
     */
    startProfiling(sessionId?: string): string;
    /**
     * Stop profiling session and generate report
     */
    stopProfiling(sessionId?: string): ProfilingSession$1 | null;
    /**
     * Take memory snapshot
     */
    takeMemorySnapshot(): MemorySnapshot;
    /**
     * Force garbage collection (if --expose-gc flag is set)
     */
    forceGC(): boolean;
    /**
     * Create object pool for memory optimization
     */
    createObjectPool<T>(name: string, factory: () => T, reset: (obj: T) => void, maxSize?: number): ObjectPool<T>;
    /**
     * Get object from pool
     */
    getFromPool<T>(poolName: string): T | null;
    /**
     * Return object to pool
     */
    returnToPool<T>(poolName: string, obj: T): boolean;
    /**
     * Detect memory leaks using various heuristics
     */
    detectMemoryLeaks(): MemoryLeakInfo[];
    /**
     * Get current memory status
     */
    getMemoryStatus(): {
        current: MemorySnapshot;
        usage: number;
        pressure: 'low' | 'medium' | 'high' | 'critical';
        recommendations: MemoryRecommendation[];
        pools: Map<string, ObjectPool<any>>;
        leaks: MemoryLeakInfo[];
    };
    /**
     * Generate heap snapshot for detailed analysis
     */
    generateHeapSnapshot(): string;
    /**
     * Optimize memory settings for current workload
     */
    optimizeMemorySettings(): {
        currentSettings: MemoryConfig;
        recommendedSettings: Partial<MemoryConfig>;
        rationale: string[];
    };
    /**
     * Initialize garbage collection observer
     */
    private initializeGCObserver;
    /**
     * Start continuous memory monitoring
     */
    private startMemoryMonitoring;
    /**
     * Set up process monitoring for memory events
     */
    private setupProcessMonitoring;
    /**
     * Check for memory pressure and emit warnings
     */
    private checkMemoryPressure;
    /**
     * Detect gradual memory increase (potential leak)
     */
    private detectGradualIncrease;
    /**
     * Detect sudden memory spikes
     */
    private detectSuddenSpike;
    /**
     * Detect ineffective garbage collection
     */
    private detectGCIneffectiveness;
    /**
     * Calculate memory trend from snapshots
     */
    private calculateMemoryTrend;
    /**
     * Generate memory optimization recommendations
     */
    private getMemoryRecommendations;
    /**
     * Generate comprehensive recommendations for a session
     */
    private generateRecommendations;
    /**
     * Format bytes for human-readable output
     */
    private formatBytes;
    /**
     * Cleanup and stop monitoring
     */
    destroy(): Promise<void>;
}
/**
 * Get or create global memory profiler
 */
declare function getGlobalMemoryProfiler(config?: Partial<MemoryConfig>): MemoryProfiler;
/**
 * Quick memory status check
 */
declare function getQuickMemoryStatus(): {
    current: MemorySnapshot;
    usage: number;
    pressure: "low" | "medium" | "high" | "critical";
    recommendations: MemoryRecommendation[];
    pools: Map<string, ObjectPool<any>>;
    leaks: MemoryLeakInfo[];
};
/**
 * Force garbage collection if available
 */
declare function forceGarbageCollection(): boolean;

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Performance measurement entry
 */
interface PerformanceMeasurement {
    name: string;
    duration: number;
    startTime: number;
    endTime: number;
    entryType: string;
    detail?: unknown;
    metadata?: Record<string, unknown>;
}
/**
 * Resource usage snapshot
 */
interface ResourceSnapshot {
    timestamp: number;
    cpu: {
        user: number;
        system: number;
        percent: number;
    };
    memory: {
        heapUsed: number;
        heapTotal: number;
        external: number;
        rss: number;
        arrayBuffers: number;
        heapUtilization: number;
    };
    io: {
        readBytes: number;
        writeBytes: number;
        readOperations: number;
        writeOperations: number;
    };
    eventLoop: {
        lag: number;
        utilization: number;
    };
    gc: {
        collections: number;
        duration: number;
        type?: string;
    }[];
}
/**
 * Performance analysis result
 */
interface PerformanceAnalysis {
    summary: {
        totalDuration: number;
        operationCount: number;
        averageOperationTime: number;
        peakMemoryUsage: number;
        peakCpuUsage: number;
        gcPressure: number;
        eventLoopLag: number;
    };
    bottlenecks: {
        operation: string;
        duration: number;
        frequency: number;
        impact: 'low' | 'medium' | 'high' | 'critical';
        recommendations: string[];
    }[];
    trends: {
        memoryTrend: 'stable' | 'increasing' | 'decreasing' | 'fluctuating';
        cpuTrend: 'stable' | 'increasing' | 'decreasing' | 'fluctuating';
        performanceTrend: 'improving' | 'degrading' | 'stable';
    };
    recommendations: string[];
}
/**
 * Profiling session configuration
 */
interface ProfilingSession {
    id: string;
    name: string;
    startTime: number;
    endTime?: number;
    measurements: PerformanceMeasurement[];
    snapshots: ResourceSnapshot[];
    options: {
        sampleInterval: number;
        enableGC: boolean;
        enableEventLoop: boolean;
        enableMemoryDetails: boolean;
        maxSamples: number;
    };
}
/**
 * External profiler tools
 */
type ProfilerTool = 'clinic-doctor' | 'clinic-flame' | 'clinic-bubbleprof' | '0x' | 'node-inspect';
/**
 * Comprehensive performance profiler and monitoring system
 */
declare class PerformanceProfiler extends EventEmitter {
    private config;
    private isMonitoring;
    private currentSession?;
    private monitoringInterval?;
    private performanceObserver?;
    private gcObserver?;
    private sessions;
    private baselineMetrics?;
    private externalProfiler?;
    constructor(config?: Partial<ProfilingConfig>);
    /**
     * Start a new profiling session
     */
    startSession(name: string, options?: Partial<ProfilingSession['options']>): string;
    /**
     * Stop the current profiling session
     */
    stopSession(): PerformanceAnalysis | null;
    /**
     * Mark the start of a performance measurement
     */
    markStart(name: string, detail?: unknown): void;
    /**
     * Mark the end of a performance measurement
     */
    markEnd(name: string, detail?: unknown): PerformanceMeasurement | null;
    /**
     * Time a function execution
     */
    timeFunction<T>(name: string, fn: () => Promise<T> | T, detail?: unknown): Promise<{
        result: T;
        measurement: PerformanceMeasurement | null;
    }>;
    /**
     * Start external profiler (clinic.js or 0x)
     */
    startExternalProfiler(tool: ProfilerTool, scriptPath: string, args?: string[]): Promise<void>;
    /**
     * Stop external profiler
     */
    stopExternalProfiler(): void;
    /**
     * Analyze a profiling session
     */
    analyzeSession(sessionId: string): PerformanceAnalysis | null;
    /**
     * Get session data
     */
    getSession(sessionId: string): ProfilingSession | null;
    /**
     * Get all sessions
     */
    getAllSessions(): ProfilingSession[];
    /**
     * Clear old sessions (keep last N sessions)
     */
    clearOldSessions(keepCount?: number): void;
    /**
     * Export session data
     */
    exportSession(sessionId: string, format?: 'json' | 'csv'): string | null;
    /**
     * Start monitoring system resources
     */
    private startMonitoring;
    /**
     * Stop monitoring system resources
     */
    private stopMonitoring;
    /**
     * Capture a resource usage snapshot
     */
    private captureResourceSnapshot;
    /**
     * Setup performance observer
     */
    private setupPerformanceObserver;
    /**
     * Setup output directory
     */
    private setupOutputDirectory;
    /**
     * Capture baseline metrics
     */
    private captureBaseline;
    /**
     * Get GC information
     */
    private getGCInfo;
    /**
     * Measure event loop lag
     */
    private measureEventLoopLag;
    /**
     * Classify performance impact
     */
    private classifyImpact;
    /**
     * Generate operation-specific recommendations
     */
    private generateRecommendations;
    /**
     * Analyze performance trends
     */
    private analyzeTrends;
    /**
     * Calculate trend direction for a series of values
     */
    private calculateTrend;
    /**
     * Generate overall recommendations
     */
    private generateOverallRecommendations;
    /**
     * Save analysis report to file
     */
    private saveAnalysisReport;
}

/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Performance Optimization Module for Tailwind Enigma Core
 *
 * This module provides comprehensive performance optimizations for large codebases:
 * - Worker thread pool management for CPU-intensive tasks
 * - Intelligent caching with multiple strategies (LRU, LFU, TTL, ARC)
 * - Regex pattern optimization and compilation caching
 * - Memory optimization and profiling with leak detection
 * - Stream processing for large files without memory bloat
 * - Batch processing coordination with priority queues
 * - Performance monitoring and analytics
 *
 * @example Basic Usage
 * ```typescript
 * import { WorkerManager, CacheManager, RegexOptimizer } from './performance';
 *
 * // Initialize components
 * const workerManager = new WorkerManager();
 * const cache = new CacheManager({ strategy: 'lru', maxSize: 100 * 1024 * 1024 });
 * const regexOptimizer = new RegexOptimizer();
 *
 * await workerManager.initialize();
 *
 * // Use optimized regex compilation
 * const regex = regexOptimizer.compile('\\b(?:sm:|md:|lg:)?[a-zA-Z][a-zA-Z0-9-]*', 'g');
 *
 * // Cache results
 * await cache.set('processed_css', results);
 * ```
 */

declare const PERFORMANCE_CONSTANTS: {
    readonly DEFAULT_WORKER_POOL_SIZE: 4;
    readonly DEFAULT_CACHE_SIZE: number;
    readonly DEFAULT_BATCH_SIZE: 1000;
    readonly MIN_MEMORY_FOR_WORKERS: number;
    readonly PERFORMANCE_BUDGET_MS: 100;
    readonly MEMORY_PRESSURE_THRESHOLD: 0.8;
    readonly CACHE_STRATEGIES: readonly ["lru", "lfu", "ttl", "arc"];
    readonly REGEX_COMPILATION_THRESHOLD_MS: 10;
    readonly MEMORY_LEAK_THRESHOLD_MB: 50;
    readonly GC_INEFFECTIVE_THRESHOLD_MB: 5;
    readonly MAX_WORKER_POOL_SIZE: 16;
    readonly MIN_WORKER_POOL_SIZE: 1;
    readonly WORKER_TASK_TIMEOUT_MS: 30000;
    readonly DEFAULT_HIGH_WATER_MARK: number;
    readonly MAX_CONCURRENT_STREAMS: 10;
    readonly MIN_BATCH_SIZE: 1;
    readonly MAX_BATCH_SIZE: 10000;
    readonly BATCH_PROCESSING_DELAY_MS: 100;
};
/**
 * Utility functions for performance monitoring and optimization
 */
/**
 * Measure performance of a function execution
 */
declare function measurePerformance<T>(fn: () => T | Promise<T>, label?: string): Promise<{
    result: T;
    duration: number;
    memoryUsed: number;
}>;
/**
 * Create a performance timer for tracking operation durations
 */
declare function createPerformanceTimer(label?: string): {
    stop: () => {
        duration: number;
        memoryUsed: number;
    };
    elapsed: () => number;
};
/**
 * Format bytes for human-readable output
 */
declare function formatBytes(bytes: number): string;
/**
 * Format duration for human-readable output
 */
declare function formatDuration(milliseconds: number): string;
/**
 * Get current system resource information
 */
declare function getSystemResources(): SystemResources;
/**
 * Check if current system has sufficient resources for performance optimizations
 */
declare function checkSystemRequirements(): {
    sufficient: boolean;
    recommendations: string[];
    warnings: string[];
};
/**
 * Create optimized performance configuration based on system resources
 */
declare function createOptimizedConfig(): PerformanceConfig;

/**
 * Configuration options for the reporter
 * @typedef {Object} ReporterConfig
 * @property {"console" | "json" | "markdown" | "html" | "all"} format - Output format for reports
 * @property {"minimal" | "summary" | "detailed" | "verbose"} verbosity - Verbosity level for output
 * @property {boolean} colors - Enable colored output
 * @property {boolean} showPerformance - Show performance metrics
 * @property {boolean} showPatterns - Show pattern statistics
 * @property {boolean} showSizeAnalysis - Show size analysis
 * @property {number} maxTableItems - Maximum number of items to show in tables
 * @property {boolean} includeRecommendations - Include recommendations in output
 * @property {Object} tableStyle - Table styling options
 * @property {string[]} tableStyle.head - Head styling
 * @property {string[]} tableStyle.border - Border styling
 * @property {boolean} tableStyle.compact - Compact mode
 */
/**
 * Size metrics for optimization analysis
 * @typedef {Object} SizeMetrics
 * @property {number} originalSize - Original size in bytes
 * @property {number} optimizedSize - Optimized size in bytes
 * @property {number} compressedSize - Compressed size in bytes
 * @property {number} sizeReduction - Size reduction in bytes
 * @property {number} compressionRatio - Compression ratio (0-1)
 * @property {number} percentageReduction - Percentage reduction
 */
/**
 * Pattern optimization statistics
 * @typedef {Object} PatternStats
 * @property {string} patternId - Pattern identifier
 * @property {string} patternName - Pattern name or description
 * @property {number} frequency - Number of occurrences
 * @property {number} sizeSavings - Size savings from this pattern
 * @property {number} efficiency - Optimization efficiency (0-1)
 * @property {"atomic" | "utility" | "component" | "layout"} type - Pattern type
 * @property {number} coOccurrenceStrength - Co-occurrence strength with other patterns
 */
/**
 * Performance metrics for optimization process
 * @typedef {Object} PerformanceMetrics
 * @property {number} executionTime - Total execution time in milliseconds
 * @property {number} memoryUsage - Memory usage in bytes
 * @property {number} throughput - Processing speed (bytes per second)
 * @property {number} filesProcessed - Number of files processed
 * @property {number} avgProcessingTime - Average processing time per file
 * @property {number} peakMemoryUsage - Peak memory usage
 */
/**
 * Comprehensive optimization report data
 * @typedef {Object} OptimizationReport
 * @property {Object} metadata - Report metadata
 * @property {string} metadata.timestamp - Report timestamp
 * @property {string} metadata.version - Report version
 * @property {string} metadata.environment - Environment
 * @property {SizeMetrics} sizeMetrics - Size analysis
 * @property {PatternStats[]} patternStats - Pattern statistics
 * @property {PerformanceMetrics} performanceMetrics - Performance metrics
 * @property {string[]} recommendations - Optimization recommendations
 * @property {string[]} warnings - Warnings and issues
 */
/**
 * Main reporter class for generating optimization statistics and reports
 */
declare class Reporter {
    constructor(config?: {});
    config: any;
    reports: any[];
    startTime: number;
    /**
     * Merge user config with defaults
     */
    mergeConfig(userConfig: any): any;
    /**
     * Generate a comprehensive optimization report
     */
    generateReport(data: any): {
        metadata: {
            timestamp: string;
            version: string;
            environment: string;
        };
        sizeMetrics: {
            originalSize: any;
            optimizedSize: any;
            compressedSize: number;
            sizeReduction: number;
            percentageReduction: number;
            compressionRatio: number;
        };
        patternStats: any;
        performanceMetrics: {
            executionTime: any;
            memoryUsage: any;
            throughput: number;
            filesProcessed: any;
            avgProcessingTime: number;
            peakMemoryUsage: any;
        };
        recommendations: string[];
        warnings: string[];
    };
    /**
     * Display report in the configured format
     */
    displayReport(report: any): string | {
        console: string;
        json: string;
        markdown: string;
        html: string;
    };
    /**
     * Display console report with tables and colors
     */
    displayConsoleReport(report: any): string;
    /**
     * Display JSON report
     */
    displayJsonReport(report: any): string;
    /**
     * Display Markdown report
     */
    displayMarkdownReport(report: any): string;
    /**
     * Display HTML report
     */
    displayHtmlReport(report: any): string;
    /**
     * Get all generated reports
     */
    getReports(): any[];
    /**
     * Clear all stored reports
     */
    clearReports(): void;
    /**
     * Get reporter statistics
     */
    getStats(): {
        reportsGenerated: number;
        uptime: number;
        config: any;
    };
    /**
     * Calculate size reduction metrics
     */
    calculateSizeReductions(beforeSize: any, afterSize: any, compressedSize?: null): {
        originalSize: any;
        optimizedSize: any;
        compressedSize: number;
        sizeReduction: number;
        percentageReduction: number;
        compressionRatio: number;
    };
    /**
     * Calculate compression metrics
     */
    calculateCompressionMetrics(originalSize: any, compressedSize: any): {
        compressionRatio: number;
        compressionSavings: number;
        compressionPercentage: number;
        estimatedGzipSize: number;
        estimatedBrotliSize: number;
    };
    /**
     * Calculate optimization savings
     */
    calculateOptimizationSavings(data: any): {
        totalSavings: number;
        averageSavings: number;
        maxSavings: number;
        minSavings: number;
        filesOptimized?: undefined;
    } | {
        totalSavings: any;
        averageSavings: number;
        maxSavings: number;
        minSavings: number;
        filesOptimized: any;
    };
    /**
     * Calculate size metrics from data
     */
    calculateSizeMetrics(data: any): {
        originalSize: any;
        optimizedSize: any;
        compressedSize: number;
        sizeReduction: number;
        percentageReduction: number;
        compressionRatio: number;
    };
    /**
     * Generate pattern statistics
     */
    generatePatternStats(data: any): any;
    /**
     * Calculate pattern efficiency
     */
    calculatePatternEfficiency(pattern: any): number;
    /**
     * Generate pattern breakdown by type
     */
    generatePatternBreakdown(patterns: any): {
        atomic: {
            count: number;
            totalSavings: number;
        };
        utility: {
            count: number;
            totalSavings: number;
        };
        component: {
            count: number;
            totalSavings: number;
        };
        layout: {
            count: number;
            totalSavings: number;
        };
    };
    /**
     * Format bytes to human readable string
     */
    formatBytes(bytes: any): string;
    /**
     * Format percentage with proper precision
     */
    formatPercentage(value: any): string;
    /**
     * Format duration in milliseconds
     */
    formatDuration(ms: any): string;
    /**
     * Generate summary table for size metrics
     */
    generateSummaryTable(sizeMetrics: any): string;
    /**
     * Generate detailed table for comprehensive statistics
     */
    generateDetailedTable(report: any): string;
    /**
     * Generate pattern table for pattern-specific data
     */
    generatePatternTable(patternStats: any): string;
    /**
     * Generate performance table for execution time and memory usage
     */
    generatePerformanceTable(performanceMetrics: any): string;
    /**
     * Generate benchmark table for performance comparisons
     */
    generateBenchmarkTable(benchmarks: any): string;
    /**
     * Generate throughput table for processing speed metrics
     */
    generateThroughputTable(throughputData: any): string;
    /**
     * Calculate performance metrics from data
     */
    calculatePerformanceMetrics(data: any): {
        executionTime: any;
        memoryUsage: any;
        throughput: number;
        filesProcessed: any;
        avgProcessingTime: number;
        peakMemoryUsage: any;
    };
    /**
     * Generate optimization recommendations
     */
    generateRecommendations(data: any): string[];
    /**
     * Generate warnings for potential issues
     */
    generateWarnings(data: any): string[];
}

/**
 * Main Tailwind Enigma Plugin
 */
declare const tailwindEnigmaPlugin: any;

/**
 * @tw-enigma/core - Core CSS Optimization Engine
 *
 * Main entry point for the Tailwind Enigma core optimization engine.
 * Provides CSS extraction, processing, and optimization functionality.
 */
/**
 * Copyright (c) 2025 Rowan Cardow
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

declare const version = "0.1.0";
declare const coreVersion = "0.1.0";

declare function optimizeCSS(input: string, _data?: any, _options?: any): OptimizationResult$1;

export { ALL_SUPPORTED_EXTENSIONS, ALPHABET_CONFIGS, type AggregatedClassData, type ApplyDirective, ApplyDirectiveError, type AtomicFileOptions, AtomicOperationError, type AtomicOperationMetrics, type AtomicOperationResult, type AtomicOperationResultMetadata, type AtomicReadOptions, type AtomicWriteOptions, type AutoConfigResult, type BackupConfig, BackupError, type BackupMetadata, type BackupOptions, type BackupVerification, type BaseConversionResult, BaseEnigmaPlugin, BasePostCSSEnigmaPlugin, type BatchConfig, BatchCoordinator, type BatchOperationOptions, type BatchOperationResult$1 as BatchOperationResult, type BuildMetrics, type BuildPhase, type BuildToolContext, type BuildToolHooks, BuildToolIntegrationError, type BuildToolPlugin, type BuildToolPluginConfig, type BuildToolResult, type BuildToolType, COMMON_CSS_PATTERNS, COMMON_TAILWIND_PATTERNS, CSS_IDENTIFIER_PATTERNS, CSS_PATTERN_THRESHOLDS, CSS_PROPERTY_GROUPS, CSS_RESERVED_KEYWORDS, CURRENT_CONFIG_VERSION, CURRENT_SCHEMA_VERSION, type CacheAnalytics, type CacheConfig, CacheError, CacheManager, type CacheStrategy, type CachedOptimizationResult, ChecksumError, CircuitBreaker, CircuitBreakerOpenError, CircuitBreakerRegistry, CircuitBreakerState, type ClassAnalysisResult, type ClassData, type ClassPattern, CliError, type CoOccurrencePattern, CollisionError, CommonFilters, ConfigBackup, ConfigBackup as ConfigBackupClass, type ConfigChangeResult, ConfigDefaults, ConfigDetector, ConfigError, ConfigMigration, ConfigSafeUpdater, type ConfigSource, type ConfigVersion, ConfigVersionSchema, ConfigWatcher, type ConfigWatcherEvents, type ConfigWatcherOptions, ConflictResolutionError, CssGenerationError, type CssGenerationOptions, CssGenerationOptionsSchema, type CssGenerationResult, type CssGenerationStatistics, CssInjectionError, type CssInjectionOptions, CssInjectionOptionsSchema, type CssInjectionRequest, type CssInjectionResult, CssInjector, type CssOutputConfig, type CssPerformanceReport, CssProcessingError, CssReportGenerator, type CssRule, CssRuleSchema, type CustomMergeFunction, DEFAULT_CSS_GENERATION_OPTIONS, DEFAULT_JS_REWRITER_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_RETENTION_POLICY, DataAggregationError, type DebugConfig, type DebugSession, DebugUtils, DependencyError, type DetectedBuildConfig, type DocumentStructure, DuplicateInjectionError, ENVIRONMENT_DEFAULTS, ENVIRONMENT_PROFILES, EnhancedCSSGenerator, type EnigmaConfig, EnigmaConfigSchema, EnigmaError, type EnigmaPlugin, type EnigmaPluginContext, type Environment, ErrorCategory, type ErrorContext, ErrorHandler, ErrorSeverity, FallbackPriority, type FileCreationOptions, FileDiscoveryError, type FileDiscoveryOptions, type FileDiscoveryResult, type FileIntegrityOptions, FileIntegrityOptionsSchema, FileIntegrityValidator, type FileOperationOptions, type FileOutputOptions, FileReadError, type FileReadOptions, type FileWriteOptions, type FilterFunction, type FormatAnalysis, type FormatPreservationOptions, type FrameworkAnalysis, FrameworkDetector, type FrequencyAnalysisResult, type FrequencyBucket, FrequencyCalculationError, GLOBAL_CONFIG_PATHS, ValidationError$1 as GeneralValidationError, type GeneratedName, type HMRClient, type HMRConfig, HMRHandler, type HMRServer, type HMRUpdate, type HMRUpdatePayload, type HMRUpdateType, HealthStatus, type HtmlClassExtractionResult, type HtmlExtractionOptions, HtmlExtractor, HtmlParsingError, type HtmlPattern, HtmlRewriteError, type HtmlRewriteOptions, type HtmlRewriteResult, HtmlRewriter, type HtmlRewriterIntegration, HtmlStructureError, HtmlValidationError, type IntegrationEvents, IntegrationManager, type IntegrationManagerConfig, type IntegrationStatus, IntegrityError, InvalidCssError, InvalidNameError, type InvalidationReason, type JSBatchProcessingOptions, type JSConflictResolutionConfig, type JSFormatPreservationOptions, type JSPatternRule, type JSPerformanceOptions, type JSReplacementContext, type JSReplacementResult, JSRewriter, type JSRewriterConfig, JSRewriterFactory, JSRewriterUtils, type JavaScriptFileType, JsExtractionOptionsSchema, JsExtractor, JsParsingError, type JsonExportFormat, type LogEntry, LogLevel, LogLevelNames, Logger, type MemoryConfig, MemoryProfiler, type MergeStrategy, type MigrationOptions, type MigrationResult, type MigrationScript, type NameCollisionCache, NameCollisionManager, NameGenerationError, type NameGenerationOptions, NameGenerationOptionsSchema, type NameGenerationResult, OptimizationCache, type OptimizationCacheConfig, OptimizationCacheIntegration, type OptimizationCacheKey, type OptimizationResult$1 as OptimizationResult, PERFORMANCE_CONSTANTS, PROJECT_CONFIG_PATHS, PathCalculationError, type PathCalculationOptions, PathCalculationOptionsSchema, PathSecurityError, PathUtils, PathUtilsError, PathValidationError, type PathValidationResult, PatternAnalysisError, type PatternAnalysisInput, type PatternAnalysisOptions, PatternAnalysisOptionsSchema, type PatternClassification, PatternClassificationError, type PatternCondition, type PatternFrequencyMap, type PatternGroup, type PatternMatch, type PatternMatchResult, type PatternReplacement, type PatternSet, PatternTypeSchema, PatternValidationError, type PerformanceBudget, type PerformanceConfig, type PerformanceEvents, type PerformanceMetrics$1 as PerformanceMetrics, PerformanceProfiler, type PluginConfig, type PluginContext, type PluginDiscoveryOptions, type PluginManager, type PluginMetrics, type PluginResult, type PluginUtils, type PrettyNameCache, PrettyNameExhaustionError, type PrettyNameResult, type PrettyNameStatistics, type ProcessingResult, type ProcessorConfig, type ProfilingConfig, RegexOptimizer, type RelativePathResult, Reporter, type RestoreResult, type RetentionPolicy, type RewriteCache, RollbackError, type RollbackOperation, type RollbackStep, SUPPORTED_FILE_TYPES, SYSTEM_DEFAULTS, type SafeUpdateOptions, type SafeUpdateResult, type SortFunction, type SourceAttribution, type StreamConfig, StreamOptimizer, type SystemResources, TAILWIND_DIRECTIVE_PATTERNS, type TailwindPatternType, type TempFileInfo, TimeoutError, type UpdateTransaction, FileDiscoveryError$1 as UtilsFileDiscoveryError, HtmlParsingError$1 as UtilsHtmlParsingError, JsParsingError$1 as UtilsJsParsingError, ValidationError, type ValidationResult$2 as ValidationResult, type WALEntry, type WorkerConfig, WorkerManager, type WorkerTask, aggregateExtractionResults, analyzeFrequencyDistribution, analyzePatternRelationships, analyzePatterns, backupConfig, batchGenerateAvailableNames, calculateAestheticScore, calculateCoOccurrenceStrength, calculateComplexity, calculateCompressionStats, calculateFileChecksum, calculateFrequencyStatistics, calculateGenerationStatistics, calculateOptimalLength, calculateRelativePath, calculateRelativePathsBatch, categorizeError, checkSystemRequirements, classifyPattern, cleanupAggregatedData, compileRegex, coreVersion, createBuildToolContext, createCacheManager, createConfigBackup, createConfigDefaults, createConfigMigration, createConfigSafeUpdater, createConfigWatcher, createCssInjector, createDebugUtils, createEnvironmentConfig, createFileIntegrityValidator, createFrameworkDetector, createFrequencyBuckets, createHMRHandler, createHtmlExtractor, createHtmlRewriter, createIntegrationManager, createJsExtractor, createLogger, createNameCollisionCache, createOptimizationCache, createOptimizationCacheIntegration, createOptimizedConfig, createPathUtils, createPerformanceBudget, createPerformanceTimer, createPrettyNameCache, createProductionConfigManager, createSampleConfig, CURRENT_CONFIG_VERSION as currentConfigVersion, CURRENT_SCHEMA_VERSION as currentSchemaVersion, deduplicateAndSort, defaultHMRConfig, defaultIntegrationConfig, logger as defaultLogger, DEFAULT_RETENTION_POLICY as defaultRetentionPolicy, detectFramework, discoverFiles, discoverFilesFromConfig, discoverFilesFromConfigAsync, discoverFilesSync, ENVIRONMENT_DEFAULTS as environmentDefaults, exportNameGenerationResult, exportToJson, extractClassesFromFile, extractClassesFromHtml, extractClassesFromJs, extractClassesFromJsFile, extractSourceClasses, filterFrequencyMap, forceGarbageCollection, formatBytes, formatCssDeclaration, formatCssOutput, formatCssRule, formatCssSelector, formatDuration, fromBase26, fromBase36, generateApplyDirective, generateCoOccurrenceAnalysis, generateConfigDocs, generateCssComments, generateCssRules, generateFrameworkAnalysis, generateFrequencyMap, generateNextAvailableName, generateOptimizedCss, generateOptimizedNames, generatePatternGroups, generatePermutationsWithoutRepetition, generatePrettyName, generateSequentialName, generateSequentialNames, generateSimpleNames, getConfig, getConfigSync, getEnvironmentDefaults, getErrorHandler, getFileType, getGlobalCacheManager, getGlobalMemoryProfiler, getGlobalRegexOptimizer, getOptimizationCache, getOptimizationCacheIntegration, getQuickDefaults, getQuickMemoryStatus, getSafeDefaults, getSystemHealth, getSystemResources, GLOBAL_CONFIG_PATHS as globalConfigPaths, handleError, hasNameCollision, initializeErrorHandling, integrateCssGeneration, isBuildToolPlugin, isEnigmaError, isHtmlResult, isJsxResult, isPathSafe, isReservedName, isValidCssIdentifier, isValidCssPropertyValue, isValidCssSelector, loadConfig, loadConfigSync, logger, matchOptimized, measurePerformance, migrateConfig, needsConfigMigration, normalizePath, optimizeApplyDirective, optimizeByFrequency, optimizeCSS, PROJECT_CONFIG_PATHS as projectConfigPaths, quickFrequencyAnalysis, replaceOptimized, restoreConfig, rewriteHtmlFile, rewriteHtmlString, sanitizeCssSelector, severityToNumber, shouldIncludeFile, shutdownErrorHandling, sortByFrequency, sortCssRules, sortCssRulesAdvanced, sortFrequencyMap, SYSTEM_DEFAULTS as systemDefaults, tailwindEnigmaPlugin, toBase26, toBase36, toCustomBase, validateApplyDirective, validateBaseConversions, validateConfig, validateCssGenerationOptions, validateCssRule, validateFileIntegrity, validateGenerationSetup, validateGlobPattern, validateInjectionRequest, validateNameGenerationOptions, validateOptions, validatePath, validatePerformanceConfig, validateProductionConfig, validateTailwindClass, version, watchConfigFile, withCircuitBreaker };
