import { i as __name } from "../chunks/rolldown-runtime.mjs"; import { n as LikeC4LanguageServices } from "../chunks/index2.mjs"; import { PluginOption } from "vite"; import { AnyTextAdapter } from "@tanstack/ai"; //#region ../vite-plugin/dist/index.d.mts //#region src/virtuals/app-config.d.ts interface AppConfig { /** * Webcomponent prefix for likec4 webcomponents * @default 'likec4' */ webcomponentPrefix?: string; /** * Page title for the application * @default 'LikeC4' */ pageTitle?: string; /** * Whether to use hash history for the application * @default false */ useHashHistory?: boolean | undefined; /** * Default color scheme for the application * @default 'auto' */ theme?: 'light' | 'dark' | undefined; } //#endregion //#region src/plugin.d.ts interface AIOptions { /** * The AI adapter to use * * @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters * @example * ```ts * import { openRouterText } from '@tanstack/ai-openrouter' * * export default defineConfig({ * plugins: [ * likec4VitePlugin({ * ai: { * adapter: openRouterText("openai/gpt-5") * }, * }), * ], * }) * ``` */ adapter: TAdapter; /** Model-specific provider options (type comes from adapter) */ modelOptions?: TAdapter['~types']['providerOptions']; maxTokens?: number; } type SharedOptions = { /** * AI configuration, by default enabled with automatic detection based on environment variables. * You can also provide explicit configuration. * Or set to `disabled` to disable AI. * * @default 'auto' (automatic detection based on environment variables) * * @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters * @example * ```ts * import { openRouterText } from '@tanstack/ai-openrouter' * * export default defineConfig({ * plugins: [ * likec4VitePlugin({ * ai: { * adapter: openRouterText("openai/gpt-5") * }, * }), * ], * }) * ``` */ ai?: 'disabled' | 'auto' | AIOptions | undefined; /** * Define vite environments where this plugin should be active * By default, the plugin is active in all environments */ environments?: string | string[]; /** * Configuration for the static application */ appConfig?: AppConfig; }; type LikeC4VitePluginOptions = SharedOptions & ({ /** * Initializes a LikeC4 instance from the specified workspace path. * By default it is vite project root. */ workspace?: string; /** * By default, if LikeC4 model is invalid, errors are printed to the console. * Disable this behavior by setting this option to false. * * @default true */ printErrors?: boolean; /** * If true, initialization will return rejected promise with the LikeC4 instance. * Use `likec4.getErrors()` to get the errors. * @default false */ throwIfInvalid?: boolean; /** * Whether to use the `dot` binary for layouting or the WebAssembly version. * @default 'wasm' */ graphviz?: 'wasm' | 'binary'; /** * Whether to watch for changes in the workspace. * @default true if vite mode is 'development', false otherwise */ watch?: boolean; /** * The log level to use. * @default 'warning' */ logLevel?: 'trace' | 'debug' | 'info' | 'warning' | 'error' | undefined; languageServices?: never; } | { /** * If you have instance of {@link LikeC4LanguageServices} * you can pass `languageServices` from it. */ languageServices: LikeC4LanguageServices; workspace?: never; printErrors?: never; throwIfInvalid?: never; graphviz?: never; watch?: never; logLevel?: never; }); declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption; //#endregion //#endregion export { LikeC4VitePlugin, type LikeC4VitePluginOptions };