import { CacheMetrics, KeyframesInfo, KeyframesSteps, RootRegistry, RuleInfo, SheetInfo, StyleInjectorConfig, StyleRule } from './types';
export declare class SheetManager {
    private rootRegistries;
    private config;
    constructor(config: StyleInjectorConfig);
    /**
     * Get or create registry for a root (Document or ShadowRoot)
     */
    getRegistry(root: Document | ShadowRoot): RootRegistry;
    /**
     * Create a new stylesheet for the registry
     */
    createSheet(registry: RootRegistry, root: Document | ShadowRoot): SheetInfo;
    /**
     * Create a style element and append to document
     */
    private createStyleElement;
    /**
     * Insert CSS rules as a single block
     */
    insertRule(registry: RootRegistry, flattenedRules: StyleRule[], className: string, root: Document | ShadowRoot): RuleInfo | null;
    /**
     * Insert global CSS rules
     */
    insertGlobalRule(registry: RootRegistry, flattenedRules: StyleRule[], globalKey: string, root: Document | ShadowRoot): RuleInfo | null;
    /**
     * Delete a global CSS rule by key
     */
    deleteGlobalRule(registry: RootRegistry, globalKey: string): void;
    /**
     * Adjust rule indices after deletion to account for shifting
     */
    private adjustIndicesAfterDeletion;
    /**
     * Delete a CSS rule from the sheet
     */
    deleteRule(registry: RootRegistry, ruleInfo: RuleInfo): void;
    /**
     * Find a sheet with available space or return null
     */
    private findAvailableSheet;
    /**
     * Find an available rule index in the sheet
     */
    findAvailableRuleIndex(sheet: SheetInfo): number;
    /**
     * Schedule bulk cleanup of all unused styles (non-stacking)
     */
    private scheduleBulkCleanup;
    /**
     * Force cleanup of unused styles
     */
    forceCleanup(registry: RootRegistry): void;
    /**
     * Perform bulk cleanup of all unused styles
     */
    private performBulkCleanup;
    /**
     * Get total number of rules across all sheets
     */
    getTotalRuleCount(registry: RootRegistry): number;
    /**
     * Get CSS text from all sheets (for SSR)
     */
    getCssText(registry: RootRegistry): string;
    /**
     * Get cache performance metrics
     */
    getMetrics(registry: RootRegistry): CacheMetrics | null;
    /**
     * Reset cache performance metrics
     */
    resetMetrics(registry: RootRegistry): void;
    /**
     * Convert keyframes steps to CSS string
     */
    private stepsToCSS;
    /**
     * Insert keyframes rule
     */
    insertKeyframes(registry: RootRegistry, steps: KeyframesSteps, name: string, root: Document | ShadowRoot): KeyframesInfo | null;
    /**
     * Delete keyframes rule
     */
    deleteKeyframes(registry: RootRegistry, info: KeyframesInfo): void;
    /**
     * Schedule async cleanup check (non-stacking)
     */
    checkCleanupNeeded(registry: RootRegistry): void;
    /**
     * Perform the actual cleanup check (called asynchronously)
     */
    private performCleanupCheck;
    /**
     * Clean up resources for a root
     */
    cleanup(root: Document | ShadowRoot): void;
}
