/** * Vite plugin for automatic theme type generation * Watches CSS files and regenerates TypeScript types on change */ import type { PluginOption } from 'vite'; import type { NestingOptions, OverrideOptions, RuntimeGenerationOptions, SharedThemeOptions, TailwindDefaultsOptions } from '../types'; /** * Re-export for convenience */ export type { NestingOptions, OverrideOptions, RuntimeGenerationOptions, SharedThemeOptions, TailwindDefaultsOptions, }; /** * Vite plugin configuration options * * @example * ```typescript * // Minimal configuration * { * input: 'src/theme.css' * } * * // Production configuration * { * input: 'src/theme.css', * outputDir: 'src/generated/tailwindcss', * generateRuntime: true, * includeDefaults: true * } * * // Development configuration with all debug data * { * input: 'src/theme.css', * debug: true, * generateRuntime: { * variants: true, * selectors: true, * files: true, * variables: true, * reports: true * } * } * * // Complete configuration showing all options * { * input: 'src/theme.css', * outputDir: 'src/generated/tailwindcss', * resolveImports: true, * generateRuntime: { * variants: true, * selectors: true, * files: false, * variables: false, * reports: { * conflicts: true, * unresolved: true * } * }, * includeDefaults: { * colors: true, * spacing: true, * fonts: true, * fontSize: true, * fontWeight: true, * shadows: false * }, * overrides: { * '*': { 'fonts.sans': 'Inter' }, * 'dark': { 'colors.background': '#000' } * }, * nesting: { * default: { maxDepth: 1, flattenMode: 'camelcase' }, * colors: { maxDepth: 2, flattenMode: 'literal', consecutiveDashes: 'exclude' } * }, * debug: false * } * ``` */ export interface VitePluginOptions extends SharedThemeOptions { /** * Path to your CSS input file (relative to Vite project root) */ input: string; /** * Output directory for generated files (relative to Vite project root) * @default 'src/generated/tailwindcss' if src/ exists, otherwise 'generated/tailwindcss' */ outputDir?: string; /** * Control what gets generated in the runtime file * - `false`: No runtime file (types only) * - `true`: Generate variants and selectors (optimized for production) * - object: Granular control over variants, selectors, files, variables, and reports * @default true * * @example * ```typescript * // Production (default) * generateRuntime: true * * // Development with debug data * generateRuntime: { * variants: true, * selectors: true, * files: true, * variables: true, * reports: { conflicts: true, unresolved: true } * } * * // Minimal (no reports) * generateRuntime: { * variants: true, * selectors: true, * files: false, * variables: false, * reports: false * } * ``` */ generateRuntime?: boolean | RuntimeGenerationOptions; } export declare function tailwindResolver(options: VitePluginOptions): PluginOption;