import type { Plugin, UserConfig } from 'vite'; import { type VitePWAOptions } from 'vite-plugin-pwa'; export interface KazzleAppViteOptions { /** * Name of the sibling process component that owns this app's backend/API * routes. Omit for a pure static UI with no backend component. * * When set, the dev server refuses to start until Kazzle injects that * component's URL (KAZZLE_APP_COMPONENT__URL), and the routes in * `proxyPaths` are forwarded to it. That internal URL is for this proxy * only — never expose it to the browser via import.meta.env / VITE_*. */ apiComponent?: string; /** * Relative root route names the browser calls (e.g. ['/todos', '/chat']) * that must be proxied to `apiComponent`. Ignored when `apiComponent` is * omitted. The browser always uses relative paths; the proxy hides the * backend address. */ proxyPaths?: string[]; } export type KazzleAppPwaOptions = { /** Merged over Kazzle's default workbox precache/runtime config. */ workbox?: VitePWAOptions['workbox']; /** Optional web app manifest. Omit for a SW-only install (no install prompt). */ manifest?: VitePWAOptions['manifest']; includeAssets?: VitePWAOptions['includeAssets']; }; /** * Kazzle preview/runtime Vite config. Spread the result into your Vite config: * * export default defineConfig(({ command }) => ({ * plugins: [react(), tailwindcss(), ...kazzleAppPwa()], * ...kazzleAppVite(command, { apiComponent: 'server', proxyPaths: ['/todos'] }), * })); */ export declare function kazzleAppVite(command: string, options?: KazzleAppViteOptions): UserConfig; /** * Kazzle production PWA plugins. Spread into `plugins` next to react/tailwind: * * plugins: [react(), tailwindcss(), ...kazzleAppPwa()] * * Always pair with `registerAppSW()` from `@kazzle/app/pwa` in main.tsx. * Do not import `vite-plugin-pwa` or `virtual:pwa-register` in the app. */ export declare function kazzleAppPwa(options?: KazzleAppPwaOptions): Plugin[];