import { PluginContext, PartialResolvedId, LoadResult, TransformResult } from 'rollup'; import { z } from 'zod'; type TokenMap = Record; type CompoundCondition = Record; declare const TwPluginOptionsSchema: z.ZodObject<{ classProcessor: z.ZodOptional], null>, z.ZodObject<{ css: z.ZodString; classes: z.ZodArray; }, z.core.$strip>>>; tokens: z.ZodOptional>, unknown, z.core.$ZodTypeInternals>, unknown>>>; debug: z.ZodOptional; minify: z.ZodOptional; }, z.core.$strip>; type TwPluginOptionsInput = z.infer; declare const PluginManifestSchema: z.ZodObject<{ name: z.ZodString; setup: z.ZodFunction, z.ZodUnknown>; }, z.core.$strip>; type PluginManifestInput = z.infer; declare const TransformRegistrationSchema: z.ZodFunction, z.ZodUnknown>; declare const TokenRegistrationSchema: z.ZodObject<{ name: z.ZodString; value: z.ZodString; }, z.core.$strip>; type TokenRegistrationInput = z.infer; declare const parseTwPluginOptions: (options: unknown) => { classProcessor?: z.core.$InferOuterFunctionType], null>, z.ZodObject<{ css: z.ZodString; classes: z.ZodArray; }, z.core.$strip>> | undefined; tokens?: Record> | undefined; debug?: boolean | undefined; minify?: boolean | undefined; }; declare const parsePluginManifest: (plugin: unknown) => { name: string; setup: z.core.$InferOuterFunctionType, z.ZodUnknown>; }; declare const parseTokenRegistration: (data: unknown) => { name: string; value: string; }; interface TwClassResult { css: string; classes: string[]; } interface DesignTokens { [key: string]: string | number | DesignTokens; } interface TwPluginOptions { classProcessor?: (classes: string[]) => TwClassResult; tokens?: DesignTokens; debug?: boolean; minify?: boolean; } type VariantResolver = (selector: string) => string; interface UtilityDefinition { [property: string]: string; } interface ComponentConfig { base: string; variants: Record>; compoundVariants: Array<{ class: string; } & CompoundCondition>; defaultVariants: Record; } interface TransformMeta { componentName: string; tag: string; } type TransformFn = (config: ComponentConfig, meta: TransformMeta) => ComponentConfig; type CssHook = (css: string) => string; interface TwContext { addVariant(name: string, resolver: VariantResolver): void; addUtility(name: string, styles: UtilityDefinition): void; addToken(name: string, value: string): void; addTransform(fn: TransformFn): void; onGenerateCSS(hook: CssHook): void; onBuildEnd(hook: () => void | Promise): void; getToken(name: string): string | undefined; subscribeTokens(callback: (tokens: TokenMap) => void): () => void; readonly config: Record; } interface TwPlugin { name: string; setup(ctx: TwContext): void; } interface PluginRegistry { variants: Map; utilities: Map; tokens: Map; transforms: TransformFn[]; cssHooks: CssHook[]; buildHooks: Array<() => void | Promise>; plugins: Set; } interface TokenEngineAPI { getToken?: (name: string) => string | undefined; getTokens?: () => Record | undefined; subscribeTokens?: (callback: (tokens: Record) => void) => () => void; subscribe?: (callback: (tokens: Record) => void) => () => void; } declare function resolveTokenEngine(): TokenEngineAPI | undefined; declare function readToken(engine: TokenEngineAPI | undefined, name: string): string | undefined; interface TransformContext { filename?: string; componentName?: string; tag?: string; } interface TwGlobalRegistry { transforms: Array<(config: ComponentConfig, ctx: TransformContext) => ComponentConfig>; tokens: Record; variants: Map; } declare function getGlobalRegistry(): TwGlobalRegistry; declare function registerTransform(transform: (config: ComponentConfig, ctx: TransformContext) => ComponentConfig): void; declare function registerToken(name: string, value: string): void; declare function createPluginRegistry(): PluginRegistry; declare function resetGlobalRegistry(): void; declare function createPluginContext(registry: PluginRegistry, config?: Record): TwContext; declare function createTw(config?: Record): TwContext & { registry: { plugins: Set; variants: Map; utilities: Map; tokens: Map; }; use: (plugin: TwPlugin) => void; }; /** * Creates a TwContext that writes through to the global (legacy) registry. * Used by createTwPlugin() in the plugin package. */ declare function createGlobalPluginContext(config?: Record): TwContext; declare function use(plugin: TwPlugin): void; declare function presetTokens(tokens: Record): TwPlugin; declare function presetVariants(variants: Record): TwPlugin; declare function presetScrollbar(): TwPlugin; /** * Plugin hooks for tailwind-styled-v4 * * Hooks allow plugins to intercept and modify the CSS generation pipeline. */ interface PluginHookContext { source: string; filename: string; extractedConfigs?: unknown[]; cssOutput?: string; } type PluginHook = (ctx: PluginHookContext) => PluginHookContext | Promise; interface PluginHooks { beforeExtract?: PluginHook; afterExtract?: PluginHook; beforeGenerate?: PluginHook; afterGenerate?: PluginHook; } declare function registerPluginHooks(hooks: PluginHooks): void; declare function getPluginHooks(): PluginHooks; declare function applyHooks(hookName: keyof PluginHooks, ctx: PluginHookContext): Promise; interface TwVitePlugin extends TwContext { resolveId(this: PluginContext, source: string, importer: string): Promise; load(this: PluginContext, id: string): Promise; transform(this: PluginContext, code: string, id: string): Promise; } declare function createTwPlugin(options?: TwPluginOptions): TwVitePlugin; export { type ComponentConfig, type CompoundCondition, type CssHook, type DesignTokens, type PluginHook, type PluginHookContext, type PluginHooks, type PluginManifestInput, PluginManifestSchema, type PluginRegistry, type TokenEngineAPI, type TokenMap, type TokenRegistrationInput, TokenRegistrationSchema, type TransformContext, type TransformFn, type TransformMeta, TransformRegistrationSchema, type TwClassResult, type TwContext, type TwGlobalRegistry, type TwPlugin, type TwPluginOptions, type TwPluginOptionsInput, TwPluginOptionsSchema, type TwVitePlugin, type UtilityDefinition, type VariantResolver, applyHooks, createGlobalPluginContext, createPluginContext, createPluginRegistry, createTw, createTwPlugin, getGlobalRegistry, getPluginHooks, parsePluginManifest, parseTokenRegistration, parseTwPluginOptions, presetScrollbar, presetTokens, presetVariants, readToken, registerPluginHooks, registerToken, registerTransform, resetGlobalRegistry, resolveTokenEngine, use };