/** * Static File Server * * Serves files from a directory with SPA fallback, content-type mapping, * path traversal protection, ETag/304 caching, and pre-compressed support. * * Usage: * const handler = serveStatic("/path/to/dist", { prefix: "/dashboard" }); * ctx.registerRoute("/dashboard", handler); */ import type { IncomingMessage, ServerResponse } from "node:http"; export interface ServeStaticOptions { /** SPA fallback file (default: "index.html"). Set to false to disable. */ fallback?: string | false; /** Cache-Control header value (default: "public, max-age=3600") */ cacheControl?: string; /** Strip this prefix from the URL path before resolving files */ prefix?: string; } /** * Create a static file serving handler. * * @param directory - Absolute path to the directory containing static files * @param options - Configuration options * @returns Request handler compatible with `ctx.registerRoute()` */ export declare function serveStatic(directory: string, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse) => Promise; //# sourceMappingURL=serve-static.d.ts.map