/**
 * Static file serving for the viewer's own bundle (`dist/viewer/`).
 *
 * Deliberately small: a MIME table, a stream, and the SPA fallback. Everything
 * that decides WHETHER a path may be read lives in `security.ts`.
 */
import type { ServerResponse } from 'http';
/** The content type to send for a file, by extension. */
export declare function contentTypeFor(filePath: string): string;
/**
 * Cache policy.
 *
 * Vite content-hashes everything under `assets/`, so those are immutable for a
 * year — a reload of the viewer refetches nothing, and an upgraded CodeGraph
 * changes the hash and therefore the URL. `index.html` names those hashes, so
 * it must never be cached.
 */
export declare function cacheControlFor(relativePath: string): string;
/**
 * Stream a file as the response body.
 *
 * `HEAD` gets identical headers and no body — it is a GET whose body the client
 * asked us to skip, which keeps it read-only by construction.
 */
export declare function sendFile(res: ServerResponse, absolutePath: string, options: {
    rootDir: string;
    method: string;
    extraHeaders?: Record<string, string>;
}): void;
/** Send a plain-text status response (the error path for a browser or curl). */
export declare function sendText(res: ServerResponse, status: number, message: string, method: string): void;
/** Send a JSON response. Used for `/api/*`, which must never get HTML back. */
export declare function sendJson(res: ServerResponse, status: number, payload: unknown, method: string): void;
/**
 * Whether a request path should fall back to `index.html` when no file matches.
 *
 * The viewer is hash-routed (`/#/s/<id>`), so in practice only `/` is ever
 * requested — but a bookmarked or hand-typed `/anything` should still open the
 * app rather than a 404 page. A path that names a FILE (has an extension) never
 * falls back: answering `/assets/index-abc123.js` with HTML would hand the
 * browser a script that is not a script, and hide a genuinely missing asset
 * behind a page that looks like it loaded.
 */
export declare function shouldFallBackToIndex(pathname: string): boolean;
//# sourceMappingURL=static.d.ts.map