/** * Tailwind v4 Theme Resolver * * A library for parsing Tailwind v4 CSS files and resolving theme variables * into a structured JavaScript object for use in contexts where CSS variables * are not available (e.g., charts, iframes, canvas). * * @example * ```typescript * import { resolveTheme } from 'tailwind-resolver/v4'; * * // Parse from file * const result = await resolveTheme({ * input: './src/theme.css' * }); * * // Use the theme * console.log(result.theme.colors.primary[500]); * ``` */ import type { ParseOptions, TailwindResult, UnknownTailwind } from './types'; /** * Resolves theme variables from Tailwind v4 CSS files with full type safety * * When used with a generated Tailwind type, provides complete TypeScript autocomplete * for all theme properties, variants, selectors, files, and variables. * * Automatically includes Tailwind's default theme and merges with user overrides * unless `includeDefaults: false` is specified. * * Error Handling: * - File not found: Throws error if the specified filePath doesn't exist * - Missing @import files: Silently skipped, continues processing remaining CSS * - Invalid CSS: PostCSS parsing errors will throw * - Tailwind not installed: Falls back to user theme only (no error thrown) * - Enable `debug: true` in options to log warnings for import resolution failures * * @template TTailwind - The generated Tailwind interface from your project * @param options - Options for theme resolution * @returns Promise resolving to the Tailwind structure with full type safety * @throws Error if neither input nor css is provided in options * @throws Error if input is provided but file cannot be read * @throws Error if CSS syntax is invalid * * @example * ```typescript * import type { Tailwind } from './generated/tailwindcss'; * import { resolveTheme } from 'tailwind-resolver'; * * // With generated type for full type safety * const tailwind = await resolveTheme({ * input: './src/theme.css' * }); * * // Now fully typed - autocomplete works! * tailwind.variants.default.colors.primary[500]; * tailwind.variants.dark.colors.background; * tailwind.selectors.dark; * tailwind.files; * tailwind.variables; * * // With theme overrides * const customTailwind = await resolveTheme({ * input: './src/theme.css', * overrides: { * 'dark': { 'colors.background': '#000000' }, * '*': { 'fonts.sans': 'Inter, sans-serif' } * } * }); * * // Without type parameter (fallback typing) * const result = await resolveTheme({ * input: './src/theme.css' * }); * ``` */ export declare function resolveTheme(options: ParseOptions): Promise>; export type { Theme, ThemeColors, ThemeSpacing, ThemeFonts, ThemeFontSizes, ThemeFontWeights, ThemeTracking, ThemeLeading, ThemeBreakpoints, ThemeContainers, ThemeRadius, ThemeShadows, ThemeInsetShadows, ThemeDropShadows, ThemeTextShadows, ThemeBlur, ThemePerspective, ThemeAspect, ThemeEase, ThemeAnimations, ThemeDefaults, ThemeKeyframes, ColorScale, CSSVariable, ParseOptions, ParseResult, ThemeVariant, DeprecationWarning, TailwindResult, UnknownTailwind, OverrideValue, OverrideConfig, OverrideOptions, TailwindDefaultsOptions, } from './types'; export type { InitialExclusion } from './core'; export { extractInitialExclusions, filterDefaultsByExclusions, filterThemeByExclusions, matchesExclusion, } from './core';