import type { Plugin } from 'vite';
import { type JanuxPluginOptions } from './app-config.js';
/**
* Dev stylesheet URLs for the HTML shell. `?direct` is Vite's contract for the
* compiled stylesheet itself: without it the same path is served as a JS
* module (`text/javascript`, how CSS HMR works), and a
* pointing at that is a MIME mismatch the browser may
* refuse — and, with no charset on the response, may decode as Latin-1,
* turning non-ASCII `content:` glyphs into mojibake.
*/
export declare function devStylesheets(root: string, stylesheet: string | undefined): string[];
/**
* Whether a Vite module id is one of the *app's* api modules — inside its
* server directory and named `*.api.ts|js`. The config carries the directory as
* a native path while Vite's ids are forward-slashed on every OS, so on Windows
* a raw prefix test never matches and the stub transform silently stops; both
* sides are compared in their forward-slash form.
*/
export declare function isApiModule(serverDir: string, id: string): boolean;
/**
* A 404 falls through to Vite only when it is a genuine page-router miss with
* nothing to show. Framework endpoints (`/_janux/*`) and `src/api/**` handlers
* own their responses — a handler's real 404 (e.g. a proxied upstream 404) must
* be sent as-is, never masked by Vite's fallback — and so does an app with a
* `_404` page, whose rendered document arrives as HTML.
*/
export declare function fallsThroughToVite(response: Response, path: string): boolean;
/**
* `foreign()` reaches React through a dynamic import, but Rollup resolves those
* statically: an app that never uses foreign islands (and so never installs
* react) used to fail `janux build` on an import it can never execute. When the
* app root can't resolve them, they stay external — the expression survives in
* dead code instead of breaking the bundle.
*/
export declare function foreignExternals(root: string): string[];
/**
* What dev answers before the app does: a file the app put in `public/`, a
* self-hosted font out of the resolver's cache, or an image variant derived
* from a public file. All three are the URLs `janux build` writes to disk,
* produced on demand here — so the page you are writing and the page you ship
* pick from the same files.
*/
export declare function devAsset(root: string, path: string): Promise;
/** The Janux Vite plugin: JSX runtime config, api() client stubs (SWC) and the SSR dev bridge. */
export declare function janux(options?: JanuxPluginOptions): Plugin;