/** * Shared file generation logic for CLI and Vite plugin */ import type { NestingOptions, OverrideOptions, ReportGenerationOptions, RuntimeGenerationOptions, TailwindDefaultsOptions } from '../types'; /** * Generates TypeScript theme type declarations and runtime files from CSS * * This function is used by both the Vite plugin and the CLI tool to generate * theme files. It handles the full pipeline from parsing CSS to writing output files. * * Error Handling: * - Input file not found: Throws error and logs to console * - Missing `@import` files: Silently skipped (see resolveTheme) * - Invalid CSS syntax: Throws error with parse details * - File system errors: Throws if output directory cannot be created or files cannot be written * - Enable `debug` parameter to log warnings for import resolution failures * * Generated Files: * - Always: types.ts (TypeScript interfaces including Tailwind and DefaultTheme) * - Conditional: theme.ts (runtime theme objects, if runtimeOptions is not false) * - Conditional: index.ts (re-exports from types.ts and theme.ts, if runtimeOptions is not false) * - Conditional: conflicts.md and conflicts.json (if CSS conflicts detected and reports enabled) * - Conditional: unresolved.md and unresolved.json (if unresolved variables detected and reports enabled) * * Type Safety: * The types.ts file generates a Tailwind interface that users pass as a generic parameter * to resolveTheme() for full type safety with autocomplete for all theme properties. * * @param inputPath - Absolute path to the CSS input file * @param outputDir - Absolute path to the output directory * @param resolveImports - Whether to resolve `@import` statements recursively * @param runtimeOptions - Controls what gets generated in runtime file (false = no runtime file) * @param includeDefaults - Control inclusion of Tailwind CSS defaults (boolean or granular options) * @param debug - Enable debug logging for troubleshooting * @param basePath - Base path for resolving node_modules (defaults to input file's directory) * @param reportOptions - Controls which diagnostic reports to generate * @param overrides - Optional theme value overrides * @param nesting - Optional nesting configuration for CSS variable keys * @returns Promise resolving to object with files and optional report info * @throws Error if input file cannot be read or parsed * @throws Error if output files cannot be written */ export declare function generateThemeFiles(inputPath: string, outputDir: string, resolveImports: boolean, runtimeOptions: RuntimeGenerationOptions | false, includeDefaults: boolean | TailwindDefaultsOptions, debug?: boolean, basePath?: string, reportOptions?: ReportGenerationOptions, overrides?: OverrideOptions, nesting?: NestingOptions): Promise<{ files: Array; conflictCount?: number; conflictReportPath?: string; unresolvedCount?: number; unresolvedReportPath?: string; }>;