/** How long each subtree may be cached. Content-hashed bundle output can be immutable; a * user-authored file keeps its name across deploys, so it gets a day and a revalidation. */ export interface PublicDirCache { /** `cache-control` for content-hashed assets (default immutable, one year). */ readonly hashed?: string; /** `cache-control` for everything else under `public/` (default one day). */ readonly assets?: string; } export interface ServePublicDirOptions { /** Absolute path of the directory to serve. */ readonly dir: string; /** URL prefix whose files are content-hashed and may be cached immutably (default `"/assets/"`). */ readonly hashedPrefix?: string; readonly cache?: PublicDirCache; /** Optional encoded URL-path allowlist. When present, route misses avoid a filesystem probe. */ readonly files?: ReadonlySet; } /** * Resolve a URL pathname to an absolute path **confined** to `root`, or `undefined` if it escapes. * * This is a user-path-to-filesystem sink, which makes it the one part of this feature with a security * consequence. Decode first (`%2e%2e%2f` is `../`), then normalize, then verify the result is still * under `root` by prefix - checking the *resolved* path rather than scanning the input for `..`, * because a blocklist over encodings is exactly the kind of check that gets bypassed. */ export declare function resolvePublicPath(root: string, pathname: string): string | undefined; /** * Build a static-file handler for `dir`. * * Returns `undefined` on any miss so the caller **falls through to routing** - a static probe must * never shadow a route. That ordering is also why a `routes/robots.txt.tsx` beats a * `public/robots.txt` only if the caller checks routes first; the documented precedence is that the * static probe runs first, so `public/` wins, and an app wanting the route should not ship both. */ export declare function servePublicDir(options: ServePublicDirOptions): (request: Request) => Promise; //# sourceMappingURL=public-dir.d.ts.map