import { r as DevframeDefinition } from "../devframe-BuR6n9ZD.mjs"; //#region src/helpers/vite.d.ts interface ViteDevBridgeOptions { /** * Mount base. Defaults to `def.basePath ?? '/__/'` for this hosted * adapter — the devframe shares the origin with the host Vite app. * * Relative spellings like `'./'` (common for base-agnostic Nuxt builds) * are normalized to absolute paths so they compose with Vite's connect * router. */ base?: string; /** * Dev-time middleware mode. When set, the host app owns the SPA and * devframe spins up a separate RPC + WS server on a resolved port, * registering Vite middleware at `__connection.json` so the * host-served SPA can discover the WS endpoint. * * - `false` (default) — static-mount the SPA at `base` with SPA * fallback. No RPC server is started. * - `true` — bridge mode with all defaults (port from * {@link resolveDevServerPort}, host from `def.cli?.host`). * - object — bridge mode with explicit overrides. */ devMiddleware?: boolean | { /** Override the bridge port. Default: {@link resolveDevServerPort}. */port?: number; /** Override the bridge bind host. Default: `def.cli?.host ?? 'localhost'`. */ host?: string; /** Flag bag forwarded to `def.setup(ctx, { flags })`. */ flags?: Record; }; } interface DevframeVitePlugin { name: string; apply: 'serve'; configureServer: (server: { middlewares: { use: (path: string, handler: any) => void; }; httpServer?: { once: (event: 'close', cb: () => void) => void; } | null; }) => void | Promise; closeBundle?: () => void | Promise; } /** * Bridge a devframe into an existing Vite dev server. Returns a Vite * plugin with two modes, picked via `options.devMiddleware`: * * - **static-mount mode** (default) — mounts `def.cli.distDir` at * `options.base` with SPA fallback enabled. No RPC server is started. * * - **bridge mode** (`devMiddleware: true | {…}`) — skips the static * mount; the host app owns the SPA. Devframe starts a separate * RPC + WS dev server (via {@link createDevServer} in bridge mode) * and registers Vite middleware at `__connection.json` so the * host-served SPA can discover the WS endpoint via * {@link connectDevframe}. * * Use bridge mode when integrating with frameworks that own the SPA * (Nuxt, Astro, SolidStart, plain Vite apps). For the all-in-one * `dev` / `build` / `mcp` shell, reach for {@link createCli} instead. */ declare function viteDevBridge(d: DevframeDefinition, options?: ViteDevBridgeOptions): DevframeVitePlugin; //#endregion export { DevframeVitePlugin, ViteDevBridgeOptions, viteDevBridge };