/** * CSS rule conflict detection and resolution * Analyzes CSS rules against theme variables to detect overrides */ import type { Theme } from '../../types'; import type { CSSRuleOverride } from '../extraction/rules'; /** * Represents a conflict between a CSS rule and a theme variable */ export interface CSSRuleConflict { /** Variant name where conflict occurs */ variantName: string; /** Theme property affected (e.g., 'radius', 'shadows') */ themeProperty: keyof Theme; /** Theme key affected (e.g., 'lg', 'md') */ themeKey: string; /** Value from CSS variable */ variableValue: string; /** Value from CSS rule */ ruleValue: string; /** CSS selector that triggers the rule */ ruleSelector: string; /** Whether we can safely resolve this conflict */ canResolve: boolean; /** Confidence level for resolution */ confidence: 'high' | 'medium' | 'low'; /** Original CSS rule override */ cssRule: CSSRuleOverride; } /** * Detects conflicts between CSS rules and theme variables * * Analyzes CSS rules extracted from variant selectors and compares them * against the theme structure to identify conflicts/overrides. * * @param cssRules - Array of CSS rule overrides from variants * @param variants - Theme variants object * @returns Array of detected conflicts */ export declare function detectConflicts(cssRules: Array, variants: Record): Array; /** * Applies a CSS rule override to a theme object * * Mutates the theme object to replace variable value with rule value. * Only call this for high-confidence, resolvable conflicts. * * @param theme - Theme object to modify * @param conflict - Conflict to apply */ export declare function applyOverride(theme: Theme, conflict: CSSRuleConflict): void; /** * Filters conflicts to only those that can be safely resolved * @param conflicts - Array of all conflicts * @returns Array of high-confidence, resolvable conflicts */ export declare function filterResolvableConflicts(conflicts: Array): Array; /** * Groups conflicts by variant name * @param conflicts - Array of conflicts * @returns Map of variant name to conflicts */ export declare function groupConflictsByVariant(conflicts: Array): Map>;