/**
 * CSS Materialization
 *
 * Converts condition trees into CSS selectors and at-rules.
 * This is the final stage that produces actual CSS output.
 */
import { ConditionNode } from './conditions';
/**
 * Parsed media condition for structured analysis and combination
 */
export interface ParsedMediaCondition {
    /** Subtype for structured analysis */
    subtype: 'dimension' | 'feature' | 'type';
    /** Whether this is a negated condition */
    negated: boolean;
    /** The condition part for CSS output (e.g., "(width < 600px)", "print") */
    condition: string;
    /** For dimension queries: dimension name */
    dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
    /** For dimension queries: lower bound value */
    lowerBound?: {
        value: string;
        valueNumeric: number | null;
        inclusive: boolean;
    };
    /** For dimension queries: upper bound value */
    upperBound?: {
        value: string;
        valueNumeric: number | null;
        inclusive: boolean;
    };
    /** For feature queries: feature name */
    feature?: string;
    /** For feature queries: feature value */
    featureValue?: string;
    /** For type queries: media type */
    mediaType?: 'print' | 'screen' | 'all' | 'speech';
}
/**
 * Parsed container condition for structured analysis and combination
 */
export interface ParsedContainerCondition {
    /** Container name (undefined = unnamed/nearest container) */
    name?: string;
    /** The condition part (e.g., "(width < 600px)" or "style(--variant: danger)") */
    condition: string;
    /** Whether this is a negated condition */
    negated: boolean;
    /** Subtype for structured analysis */
    subtype: 'dimension' | 'style' | 'raw';
    /** For style queries: property name (without --) */
    property?: string;
    /** For style queries: property value (undefined = existence check) */
    propertyValue?: string;
}
/**
 * Parsed supports condition for structured analysis and combination
 */
export interface ParsedSupportsCondition {
    /** Subtype: 'feature' for property support, 'selector' for selector() support */
    subtype: 'feature' | 'selector';
    /** The condition string (e.g., "display: grid" or ":has(*)") */
    condition: string;
    /** Whether this is a negated condition */
    negated: boolean;
}
/**
 * Parsed modifier condition for structured analysis
 */
export interface ParsedModifierCondition {
    /** Attribute name (e.g., 'data-hovered', 'data-size') */
    attribute: string;
    /** Value if present (e.g., 'large', 'danger') */
    value?: string;
    /** Operator for value matching (default '=') */
    operator?: '=' | '^=' | '$=' | '*=';
    /** Whether this is negated (:not(...)) */
    negated: boolean;
}
/**
 * Parsed pseudo-class condition for structured analysis
 */
export interface ParsedPseudoCondition {
    /** The pseudo-class (e.g., ':hover', ':focus-visible', ':has(> Icon)') */
    pseudo: string;
    /** Whether this is negated (:not(...)) */
    negated: boolean;
}
/**
 * Parsed root condition for structured analysis
 */
export interface ParsedRootCondition {
    /** The selector part (e.g., '[data-theme="dark"]') */
    selector: string;
    /** Whether this is negated (:root:not(...)) */
    negated: boolean;
}
/**
 * A single selector variant (one term in a DNF expression)
 */
export interface SelectorVariant {
    /** Structured modifier conditions */
    modifierConditions: ParsedModifierCondition[];
    /** Structured pseudo conditions */
    pseudoConditions: ParsedPseudoCondition[];
    /** Structured own conditions (for sub-element states) */
    ownConditions: (ParsedModifierCondition | ParsedPseudoCondition)[];
    /** Parsed media conditions for structured combination */
    mediaConditions: ParsedMediaCondition[];
    /** Parsed container conditions for structured combination */
    containerConditions: ParsedContainerCondition[];
    /** Parsed supports conditions for @supports at-rules */
    supportsConditions: ParsedSupportsCondition[];
    /** Structured root conditions */
    rootConditions: ParsedRootCondition[];
    /** Whether to wrap in @starting-style */
    startingStyle: boolean;
}
/**
 * CSS output components extracted from a condition
 * Supports multiple variants for OR conditions (DNF form)
 */
export interface CSSComponents {
    /** Selector variants - OR means multiple variants, AND means single variant with combined selectors */
    variants: SelectorVariant[];
    /** Whether condition is impossible (should skip) */
    isImpossible: boolean;
}
/**
 * Final CSS rule output
 */
export interface CSSRule {
    /** Single selector or array of selector fragments (for OR conditions) */
    selector: string | string[];
    declarations: string;
    atRules?: string[];
    rootPrefix?: string;
}
/**
 * Convert a condition tree to CSS components
 */
export declare function conditionToCSS(node: ConditionNode): CSSComponents;
/**
 * Clear the condition cache (for testing)
 */
export declare function clearConditionCache(): void;
/**
 * Convert parsed modifier to CSS selector string (for final output)
 */
export declare function modifierToCSS(mod: ParsedModifierCondition): string;
/**
 * Convert parsed pseudo to CSS selector string (for final output)
 */
export declare function pseudoToCSS(pseudo: ParsedPseudoCondition): string;
/**
 * Convert parsed root conditions to CSS selector prefix (for final output)
 */
export declare function rootConditionsToCSS(roots: ParsedRootCondition[]): string | undefined;
/**
 * Build at-rules array from a variant
 */
export declare function buildAtRulesFromVariant(variant: SelectorVariant): string[];
