import type { Plugin } from "vite"; /** * How the legacy interpolation transform is handled relative to the installed * Nix.js core and Vite plugin: * * - `"auto"` (default): the kit's legacy transform is only applied when the * Vite plugin (`@deijose/vite-plugin-nix-js` >= 1.1.0) is NOT installed. * The plugin has a more powerful state-machine lexer and takes precedence. * - `"legacy"`: always apply the kit's transform (for migrations), with a * one-time deprecation warning. * - `"off"`: never apply the kit's transform. Recommended when the Vite * plugin is installed. */ export type InterpolationMode = "auto" | "legacy" | "off"; /** * Detects whether the Vite plugin (`@deijose/vite-plugin-nix-js`) is * installed and provides compile-time partial attribute interpolation. */ export declare function pluginSupportsPartialInterpolation(): boolean; /** * Detects whether the installed Nix.js core supports partial attribute * interpolation natively (via the public `templateFeatures` capability). * Note: as of core v3.4.0, this is always false — the lexer moved to the * Vite plugin. */ export declare function coreSupportsPartialInterpolation(): boolean; /** * Resolves whether the kit's legacy transform should be applied. * * In `"auto"` mode, the kit's transform runs only when neither the Vite * plugin nor the core provides partial interpolation. When the Vite plugin * is installed (>= 1.1.0), it takes precedence and the kit's transform is * skipped to avoid double-processing. */ export declare function shouldUseLegacyInterpolation(mode: InterpolationMode): boolean; /** * Transforms Nix.js `html\`\`` templates so that attributes with partial * interpolation become a single interpolation expression. * * Nix.js requires every dynamic attribute to be a single interpolation covering * the whole value. This plugin rewrites patterns such as: * * html\`...\` * * into: * * html\`...\` * * Only files inside the app and islands directories are processed. * * @deprecated Nix.js core supports partial attribute interpolation natively. * Keep this transform only for migrations against older cores * (`interpolation: "legacy"`). */ export interface InterpolationPluginOptions { appDir?: string; islandsDir?: string; } /** * @deprecated Use the native partial attribute interpolation of Nix.js core * (core >= 3.3). Kept for legacy migrations and direct consumers. */ export declare function transformPartialInterpolations(source: string): string; export declare function nixJsInterpolationPlugin(options?: InterpolationPluginOptions): Plugin;