/** * Version Adapters for Tailwind CSS and Next.js * * Two-layer architecture: * (a) Token rules: class name transforms (e.g., bg-opacity-50 -> removed in TW v4) * (b) Output-mode rules: structural differences (import patterns, metadata API) * * Stored as TypeScript modules so they can hold predicates and transforms. * Shared across all targets that use Tailwind (React, Vue, Svelte). */ import type { FrameworkVersions } from './config.js'; export interface ReactOutputRules { /** Whether React action hooks like useActionState are available */ supportsActions: boolean; /** Whether React 19's useEffectEvent hook is available */ supportsEffectEvent: boolean; /** Whether UMD globals are available for preview/runtime bootstrapping */ supportsUmdBuilds: boolean; } export interface ReactVersionProfile { major: 18 | 19; outputRules: ReactOutputRules; } export declare function buildReactProfile(versions: FrameworkVersions): ReactVersionProfile; /** * A token rule transforms individual Tailwind class names. * If the predicate matches, the transform function is applied. */ export interface TailwindTokenRule { /** Human-readable name for debugging */ name: string; /** Returns true if this rule applies to the given class */ predicate: (cls: string) => boolean; /** Transform the class name. Return empty string to remove. */ transform: (cls: string) => string; } /** * Output-mode rules for Tailwind structural differences. */ export interface TailwindOutputRules { /** Whether to use @import instead of @tailwind directives */ useAtImport: boolean; /** Whether opacity utilities use slash syntax (bg-black/50 vs bg-opacity-50) */ useSlashOpacity: boolean; /** Whether to use the new color-mix() approach for arbitrary opacity */ useColorMix: boolean; } /** * Combined Tailwind compatibility profile. */ export interface TailwindVersionProfile { major: 3 | 4; tokenRules: TailwindTokenRule[]; outputRules: TailwindOutputRules; } export declare function buildTailwindProfile(versions: FrameworkVersions): TailwindVersionProfile; /** * Apply token rules to a list of Tailwind classes. * Returns the transformed class string. */ export declare function applyTailwindTokenRules(classes: string, profile: TailwindVersionProfile): string; /** * Output-mode rules for Next.js structural differences. */ export interface NextjsOutputRules { /** Metadata export style: 'typed' = Metadata type, 'satisfies' = satisfies Metadata */ metadataStyle: 'typed' | 'satisfies'; /** Whether to use the next/navigation module (v13+) vs next/router */ useAppRouter: boolean; /** Image component import path */ imageImport: 'next/image' | 'next/legacy/image'; /** Whether async server components are supported */ asyncServerComponents: boolean; /** Whether to use the new Link behavior (no nested ) */ linkNoAnchor: boolean; } /** * Combined Next.js compatibility profile. */ export interface NextjsVersionProfile { major: 13 | 14 | 15 | 16; outputRules: NextjsOutputRules; } export declare function buildNextjsProfile(versions: FrameworkVersions): NextjsVersionProfile; export interface VersionProfile { react: ReactVersionProfile; tailwind: TailwindVersionProfile; nextjs: NextjsVersionProfile; } export declare function buildVersionProfile(versions: FrameworkVersions): VersionProfile;