import { IncomingMessage, ServerResponse } from "node:http"; import type { CompiledRoute, Manifest, CacheKey } from "../build/common"; export type ServerOptions = { serveAPI?: boolean; allowDynamicPages?: boolean; allowStatusCodePages?: boolean; port?: number; }; interface ApiRouteModule { GET?: (req: IncomingMessage, res: ServerResponse) => void | Promise; POST?: (req: IncomingMessage, res: ServerResponse) => void | Promise; PUT?: (req: IncomingMessage, res: ServerResponse) => void | Promise; DELETE?: (req: IncomingMessage, res: ServerResponse) => void | Promise; PATCH?: (req: IncomingMessage, res: ServerResponse) => void | Promise; } type MiddlewareFn = (req: IncomingMessage, res: ServerResponse, next: () => Promise) => void | Promise; interface CachedFileHeaders { raw: Record; gzip: Record; brotli: Record; } interface CachedFile { raw: Buffer; gzip: Buffer; brotli: Buffer; mime: string; etag: string; headers: CachedFileHeaders; } export interface MatchedRoute { pathname: string; pageFile: string; layouts: string[]; layoutCacheKeys: CacheKey[]; cacheKey: CacheKey; sharedChunkPaths: string[]; isDynamic: boolean; patternPathname?: string | undefined; matcher: (pathname: string) => Record | null; } declare class LRU { private readonly max; private readonly map; constructor(max: number); get(key: K): V | undefined; set(key: K, val: V): void; has(key: K): boolean; delete(key: K): void; } export declare const staticCache: Map; export declare const dynamicModuleCache: LRU; export declare const aotStaticCache: Map; export declare const statusCodePageCache: Map; export declare const middlewareChainCache: Map; export declare const encCache: LRU; export declare let staticRouteMap: Map | null; export declare let paramRoutes: MatchedRoute[] | null; export declare let apiRoutesCache: Map | null; export declare let middlewareMapCache: Map | null; export declare function primeStaticCache(): Promise; export declare function compileRouteMatcher(pattern: string): (pathname: string) => Record | null; export declare function warmDynamicCaches(manifest: Manifest): Promise<{ staticRouteMap: Map; paramRoutes: MatchedRoute[]; }>; export declare function loadApiRoutes(manifest: Manifest): Promise>; export declare function loadMiddlewareMap(manifest: Manifest): Promise>; type Encoding = "br" | "gzip" | null; export declare function serve(): Promise; export {}; //# sourceMappingURL=server.d.ts.map