/** * CSS `@import` resolver for Tailwind theme files * Recursively resolves and inlines `@import` statements */ import type { Root } from 'postcss'; /** * Resolves all `@import` statements in a PostCSS AST recursively * * This function performs graceful error handling by design: * - Missing files: `@import` statements referencing non-existent files are silently removed * - Invalid CSS: Malformed CSS in imported files causes the `@import` to be removed * - Permission errors: Files that can't be read due to permissions are skipped * - Circular imports: Already-processed files are skipped to prevent infinite loops * - Deep nesting: Import depth is limited to 50 levels to prevent stack overflow * * When errors occur, the `@import` rule is removed from the AST, allowing the rest of the * CSS to be parsed successfully. Enable `debug` mode to log warnings for troubleshooting. * * @param root - The PostCSS root node to process * @param basePath - Base directory path for resolving relative imports * @param processedFiles - Set of already processed file paths to prevent circular imports * @param debug - Enable debug logging for troubleshooting failed imports * @param depth - Current import depth (internal use for recursion tracking) * @returns Array of file paths that were processed * @throws ImportDepthExceededError if import depth exceeds MAX_IMPORT_DEPTH */ export declare function resolveImports(root: Root, basePath: string, processedFiles?: Set, debug?: boolean, depth?: number): Promise>;