import React from 'react'; import { z } from 'zod'; type TokenMap = Record; type TokenSubscriber = (tokens: TokenMap) => void; interface LiveTokenSet { vars: Record; get(name: string): string | undefined; set(name: string, value: string): void; setAll(tokens: TokenMap): void; snapshot(): TokenMap; } interface LiveTokenEngineBridge { getToken(name: string): string | undefined; getTokens(): TokenMap; setToken(name: string, value: string): void; setTokens(tokens: TokenMap): void; applyTokenSet(tokens: TokenMap): void; subscribeTokens(fn: TokenSubscriber): () => void; subscribe?(fn: TokenSubscriber): () => void; } declare function tokenVar(name: string): string; declare function tokenRef(name: string): string; declare function liveToken(tokens: TokenMap): LiveTokenSet; declare function setToken(name: string, value: string): void; declare function setTokens(tokens: TokenMap): void; declare function applyTokenSet(tokens: TokenMap): void; declare function getToken(name: string): string | undefined; declare function getTokens(): TokenMap; declare function subscribeTokens(fn: TokenSubscriber): () => void; declare function generateTokenCssString(): string; declare function createUseTokens(): () => TokenMap; declare const liveTokenEngine: LiveTokenEngineBridge; declare global { interface Window { __TW_TOKEN_ENGINE__?: LiveTokenEngineBridge; } } declare const SubComponentDefSchema: z.ZodObject<{ tag: z.ZodOptional; class: z.ZodString; }, z.core.$strip>; type SubComponentDefInput = z.infer; declare const ComponentMetadataSchema: z.ZodObject<{ component: z.ZodString; tag: z.ZodString; baseClass: z.ZodString; subComponents: z.ZodRecord; class: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; type ComponentMetadataInput = z.infer; declare const ConditionalPropsSchema: z.ZodRecord; type ConditionalPropsInput = z.infer; declare const parseSubComponentDef: (data: unknown) => { class: string; tag?: string | undefined; }; declare const parseComponentMetadata: (data: unknown) => { component: string; tag: string; baseClass: string; subComponents: Record; }; /** * @tailwind-styled/runtime v5 * * Lightweight runtime helpers for compiled tailwind-styled-v5 components. * Live token engine has been moved to @tailwind-styled/theme package. */ interface SubComponentDef { /** HTML tag to render (default: "span") */ tag?: string; /** Scoped CSS class generated by Rust, e.g. "Button_icon_abc123" */ class: string; } type SubComponentMap = Record; /** * Map of prop name → CSS class appended when the prop is truthy. * e.g. { fullWidth: "w-full", large: "text-lg px-6 py-3" } */ type ConditionalProps = Record; /** * A compound styled component: base ForwardRef + attached .SubName properties. * The generic params are intentionally loose so callers don't need to repeat them. */ type StyledComponent = React.ForwardRefExoticComponent & React.RefAttributes> & { [K in keyof S]: React.ForwardRefExoticComponent & React.RefAttributes>; }; /** Metadata for one compound component produced by Rust. */ interface ComponentMetadata { component: string; tag: string; baseClass: string; subComponents: SubComponentMap; } type ClassInput = string | number | false | null | undefined | ClassInput[]; declare function cx(...inputs: ClassInput[]): string; /** * Build a compound styled React component from Rust-generated metadata. * * @param tag HTML element tag, e.g. "button" | "div" * @param baseClass Scoped base class from Rust, e.g. "Button_abc123" * @param subComponents Map of subcomponent definitions (optional) * @param conditionals Map of prop name → CSS class (optional) * * @example * // Injected automatically by the compiler — do not call manually * const Button = createComponent("button", "Button_abc123", { * icon: { tag: "span", class: "Button_icon_abc123" }, * text: { tag: "span", class: "Button_text_abc123" }, * }, { fullWidth: "w-full" }) * * // Usage in JSX: * */ declare function createComponent(tag: string, baseClass: string, subComponents?: S, conditionals?: ConditionalProps): StyledComponent; export { type ComponentMetadata, type ComponentMetadataInput, ComponentMetadataSchema, type ConditionalProps, type ConditionalPropsInput, ConditionalPropsSchema, type LiveTokenEngineBridge, type LiveTokenSet, type StyledComponent, type SubComponentDef, type SubComponentDefInput, SubComponentDefSchema, type SubComponentMap, type TokenMap, type TokenSubscriber, applyTokenSet, tokenRef as containerRef, createComponent, createUseTokens, cx, generateTokenCssString, getToken, getTokens, liveToken, liveTokenEngine, parseComponentMetadata, parseSubComponentDef, setToken, setTokens, subscribeTokens, tokenRef, tokenVar };