/** * Tailwind Compile-Probe — Spec 22 R1.2 * * Uses the project's own installed `tailwindcss` package as the oracle for * class validation. Zero hand-curated dictionaries — the project's compiler * IS the authority on what classes exist. * * **v4 (PRIMARY):** Uses `compile()` with `@apply` probe stylesheets. * Candidate classes are injected into a generated CSS file, compiled, and * checked for CSS output. Classes that produce declarations are valid. * * **v3 (FALLBACK):** Uses `resolveConfig()` to get the fully-resolved theme, * then generates utility classes from the config. Theme values come from * the project's config — the config IS the oracle. * * **Fail-open:** If tailwindcss can't be found, loaded, or compiled, the * probe returns `ready=false`. The caller MUST disable the undefined-class * detector — a claim that a class "does not exist" may not ship on a * known-incomplete dictionary. * * @module tailwindProbe */ export interface ProbeInitResult { /** Whether initialization succeeded. */ ok: boolean; /** Human-readable source description. */ source?: string; /** Error message if init failed. */ error?: string; } export declare class TailwindProbe { private validClasses; private _ready; private _failureReason; private _source; private projectRoot; private tailwindPath; private version; /** Whether the probe successfully initialized and is ready to validate classes. */ get ready(): boolean; /** Why initialization failed, if it did. */ get failureReason(): string | null; /** Human-readable description of the validation source. */ get source(): string | null; /** * Initialize the probe by locating and loading the project's tailwindcss * package. Tests compilation with a known-good class to verify the * pipeline works end-to-end. */ init(projectRoot: string): Promise; /** * Check if a single class is known-valid from the cache only. * Does NOT trigger a probe — use validateBatch() for that. */ isCached(className: string): boolean; /** * Validate a batch of class names against the project's Tailwind compiler. * Classes that produce CSS when @apply'd (v4) or are generated from the * resolved config (v3) are considered valid. * * Returns the full Set of all known-valid classes (including previously * cached ones). Unknown classes that don't validate are NOT added to the * cache — callers should treat absence from the returned set as "not valid." */ validateBatch(candidates: string[]): Promise>; /** * Generate a CSS file with @apply probe selectors, compile it with * Tailwind v4, and parse the output to determine which classes are valid. */ private probeV4Batch; /** * Parse compiled CSS output to find which probe selectors have actual * CSS declarations. A probe selector with no declarations or only empty * rules indicates an invalid/unknown class. */ private parseProbeOutput; /** * Generate the full set of utility classes from the project's resolved * Tailwind v3 config. Uses `resolveConfig()` to merge user config with * core plugin defaults, then generates class names from theme scales. * * This IS oracle-based: the config defines what's valid, and we * synthesize class names from it structurally. No hand-curated lists * of colors, spacing values, font sizes, or border radii. */ private generateV3Classes; /** * Load the fully-resolved Tailwind v3 theme using resolveConfig(). */ private loadV3ResolvedTheme; /** * Locate tailwindcss in the project's node_modules, walking up directories. */ private findTailwindcss; /** * Dynamically import tailwindcss v4 (ESM package). * Uses file:// URL for reliable resolution from the project's node_modules. */ private tryImportV4; } //# sourceMappingURL=tailwindProbe.d.ts.map