import { ConfigEnv, Plugin, PluginOption, UserConfig, UserConfigFn, UserConfigFnObject, UserConfigFnPromise } from "vite";
//#region src/assetsProxyPlugin.d.ts
/**
 * Forwards `/__l5e/assets-v1/*` requests from the Vite dev server to the
 * Lovable preview proxy so assets resolve when the page is loaded directly
 * from the sandbox dev server (e.g. `localhost:8080`) instead of via
 * `*.lovable.app` / `*.lovableproject.com`.
 *
 * No-op unless `LOVABLE_PREVIEW_HOST` is set (host only, no scheme), e.g.
 * `id-preview--<project-id>.lovable.app`.
 */
declare function lovableAssetsProxyPlugin(): Plugin;
//#endregion
//#region src/documents.d.ts
type PrerenderPage = {
  path: string;
  prerender?: Record<string, unknown>;
};
//#endregion
//#region src/index.d.ts
declare function stripRedundantNodejsCompatFlag(dirs?: PrerenderShimDirs): Plugin;
type NitroOutput = {
  serverDir?: string;
};
type PrerenderShimDirs = {
  /** Where upstream's preview middleware imports the server build from. */
  shimDir: string;
  /** Ordered fallbacks for the directory nitro emitted its entry into. */
  entryDirs: string[];
  /** Filled by nitro's `compiled` hook, which fires inside its own post-order `buildApp`. */
  nitroOutput: NitroOutput;
};
interface LovableViteTanstackOptions {
  plugins?: PluginOption[];
  vite?: UserConfig;
  serverFnErrorLogger?: boolean;
  ssrErrorLogger?: boolean;
  /**
   * Options forwarded to `nitro()` from `nitro/vite`.
   *
   * Behavior:
   * - **undefined** (default): nitro runs on every production build, defaulting
   *   to the `cloudflare-module` preset via Nitro's `defaultPreset` — zero-config
   *   target auto-detection (`NITRO_PRESET`, Vercel/Netlify/Cloudflare Pages)
   *   still wins, so a self-deploy auto-targets its own platform. If the optional
   *   `nitro` peer dep isn't installed, it's skipped (no deploy intent to honor).
   * - **`true`**: same as undefined, but fails fast if the `nitro` peer dep is
   *   missing — the explicit opt-in signals deploy intent.
   * - **object**: force-on, with these overrides. Set `preset`
   *   (e.g. `{ preset: "vercel" }`) to hard-pin a target from your own CI.
   * - **`false`**: skip nitro entirely.
   *
   * Inside a Lovable build `LOVABLE_NITRO_PRESET` (Cloudflare by default) pins
   * the preset and output layout; overrides here apply only outside it.
   *
   * The option surface is narrow on purpose — Nitro v3 is still pre-RC, so
   * we only expose stable build-time knobs to reduce churn if
   * `NitroPluginConfig` schema changes. File an issue if you need more.
   */
  nitro?: true | {
    preset?: string;
    output?: {
      dir?: string;
      publicDir?: string;
      serverDir?: string;
    };
    cloudflare?: {
      nodeCompat?: boolean;
      deployConfig?: boolean;
    };
  } | false;
  /** Options forwarded to tanstackStart(). Inside a Lovable build the prerender output shape is pinned. */
  tanstackStart?: Record<string, unknown>;
  /** Options forwarded to viteReact(). */
  react?: Record<string, unknown>;
  /** Set to false to disable automatic VITE_* env define injection. Default: true. */
  envDefine?: boolean;
  /** hmrGatePlugin() options. Default on in sandbox (false disables); true or an options object enables elsewhere. */
  hmrGate?: boolean | Record<string, unknown>;
}
declare function defineConfig(config: UserConfig): (env: ConfigEnv) => Promise<UserConfig>;
declare function defineConfig(config: Promise<UserConfig>): (env: ConfigEnv) => Promise<UserConfig>;
declare function defineConfig(config: UserConfigFnObject): (env: ConfigEnv) => Promise<UserConfig>;
declare function defineConfig(config: UserConfigFnPromise): (env: ConfigEnv) => Promise<UserConfig>;
declare function defineConfig(config: UserConfigFn): (env: ConfigEnv) => Promise<UserConfig>;
declare function defineConfig(options?: LovableViteTanstackOptions): (env: ConfigEnv) => Promise<UserConfig>;
//#endregion
export { LovableViteTanstackOptions, type PrerenderPage, defineConfig, lovableAssetsProxyPlugin, stripRedundantNodejsCompatFlag };