/** * @deijose/nix-ionic / vite-plugin.ts * * Vite plugin `nixIonic()` that scans `html\`\`` template literals for * `` tags and static `name="icon-name"` attributes, then generates * a virtual module that imports and registers only the used components * and icons. * * Usage: * ```ts * // vite.config.ts * import { defineConfig } from "vite"; * import { nix } from "@deijose/vite-plugin-nix"; * import { nixIonic } from "@deijose/nix-ionic/vite-plugin"; * * export default defineConfig({ * plugins: [nix(), nixIonic()], * }); * ``` * * The plugin generates a virtual module at `virtual:nix-ionic/registration` * that imports only the detected components and icons, and calls * `initializeNixIonic()` + `registerIonicComponents()` + `registerIonicons()`. * * For dynamic tags or icons (e.g. `` or `name=${iconName}`), * the plugin emits a diagnostic warning. Users can suppress warnings and * declare allowlists via the `allow` option. */ import type { Plugin } from "vite"; export interface NixIonicPluginOptions { /** * Auto-register detected components. Set to `false` to only scan and * emit diagnostics without generating registration code. * @default true */ autoRegister?: boolean; /** * Tags to allow even if not detected statically (e.g. dynamically * rendered components). Suppresses diagnostics for these tags. */ allowTags?: string[]; /** * Icon names to allow even if not detected statically. */ allowIcons?: string[]; /** * Icon import mode: "inline" (default) or "assets". */ icons?: "inline" | "assets"; /** * Custom icon asset path (only used when icons === "assets"). */ iconAssetPath?: string; /** * Emit warnings for undetected/dynamic tags. Set to `false` to silence. * @default true */ diagnostics?: boolean; } export declare function generateRegistrationModule(tags: Set, icons: Set, options: NixIonicPluginOptions): string; export declare function nixIonic(options?: NixIonicPluginOptions): Plugin;