export interface InjectResult {
    className: string;
    dispose: () => void;
}
export interface GlobalInjectResult {
    dispose: () => void;
}
export type DisposeFunction = () => void;
export interface StyleInjectorConfig {
    nonce?: string;
    maxRulesPerSheet?: number;
    unusedStylesThreshold?: number;
    bulkCleanupDelay?: number;
    idleCleanup?: boolean;
    forceTextInjection?: boolean;
    /** Enable development mode features: performance metrics and debug information storage */
    devMode?: boolean;
    /**
     * Ratio of unused styles to delete per bulk cleanup run (0..1).
     * Defaults to 0.5 (oldest half) to reduce risk of removing styles
     * that may be restored shortly after being marked unused.
     */
    bulkCleanupBatchRatio?: number;
    /**
     * Minimum age (in ms) a style must remain unused before eligible for deletion.
     * Helps avoid races during rapid mount/unmount cycles. Default: 10000ms.
     */
    unusedStylesMinAgeMs?: number;
    /**
     * Global predefined states for advanced state mapping.
     * These are state aliases that can be used in any component.
     * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
     */
    states?: Record<string, string>;
}
export interface RuleInfo {
    className: string;
    ruleIndex: number;
    sheetIndex: number;
    /** Dev-only: full CSS texts inserted for this class; omitted in production */
    cssText?: string[];
    /** Inclusive end index of the contiguous block of inserted rules for this className */
    endRuleIndex?: number;
    /** NEW: exact indices of all inserted rules for this className */
    indices?: number[];
}
export interface SheetInfo {
    sheet: HTMLStyleElement;
    ruleCount: number;
    holes: number[];
}
export interface CleanupStats {
    timestamp: number;
    classesDeleted: number;
    cssSize: number;
    rulesDeleted: number;
}
export interface CacheMetrics {
    hits: number;
    misses: number;
    bulkCleanups: number;
    totalInsertions: number;
    totalUnused: number;
    stylesCleanedUp: number;
    cleanupHistory: CleanupStats[];
    startTime: number;
    unusedHits?: number;
}
export interface RootRegistry {
    sheets: SheetInfo[];
    refCounts: Map<string, number>;
    rules: Map<string, RuleInfo>;
    /** Cache key to className mapping to avoid dual storage of RuleInfo objects */
    cacheKeyToClassName: Map<string, string>;
    /** Deduplication set of fully materialized CSS rules inserted into sheets */
    ruleTextSet: Set<string>;
    /** Scheduled bulk cleanup timeout */
    bulkCleanupTimeout: ReturnType<typeof requestIdleCallback> | ReturnType<typeof setTimeout> | null;
    /** Scheduled cleanup check timeout */
    cleanupCheckTimeout: ReturnType<typeof setTimeout> | null;
    /** Performance metrics (optional) */
    metrics?: CacheMetrics;
    /** Counter for generating sequential class names like t0, t1, t2... */
    classCounter: number;
    /** Keyframes cache by content hash -> entry */
    keyframesCache: Map<string, KeyframesCacheEntry>;
    /** Keyframes name to content hash mapping for collision detection */
    keyframesNameToContent: Map<string, string>;
    /** Counter for generating keyframes names like k0, k1, k2... */
    keyframesCounter: number;
    /** Map of injected @property names to their normalized declarations for tracking */
    injectedProperties: Map<string, string>;
    /** Global rules tracking for index adjustment */
    globalRules: Map<string, RuleInfo>;
}
export type StyleRule = import('../pipeline').StyleResult;
export interface KeyframesInfo {
    name: string;
    sheetIndex: number;
    ruleIndex: number;
    /** Dev-only: full CSS text of the @keyframes rule; omitted in production */
    cssText?: string;
}
export type KeyframeStep = string | Record<string, string | number>;
export type KeyframesSteps = Record<string, KeyframeStep>;
export interface KeyframesResult {
    toString(): string;
    dispose: () => void;
}
export interface KeyframesCacheEntry {
    name: string;
    refCount: number;
    info: KeyframesInfo;
}
/**
 * Definition for a CSS @property at-rule.
 * Used to define custom property syntax, inheritance, and initial value.
 */
export interface PropertyDefinition {
    /** CSS syntax string (e.g., '<color>', '<angle>', '<number>') */
    syntax?: string;
    /** Whether the property inherits (default: true) */
    inherits?: boolean;
    /** Initial value for the property */
    initialValue?: string | number;
}
export interface RawCSSInfo {
    /** Unique identifier for this raw CSS block */
    id: string;
    /** The raw CSS text */
    css: string;
    /** Start offset in the style element's textContent */
    startOffset: number;
    /** End offset in the style element's textContent */
    endOffset: number;
}
export interface RawCSSResult {
    dispose: () => void;
}
