import { type NextFetchEvent, type NextRequest } from "next/server"; import { type GeistdocsConfig } from "./config"; export type DetectionMethod = "ua-match" | "signature-agent" | "heuristic" | null; export interface TrackMarkdownRequestEvent { acceptHeader: string | null; detectionMethod?: DetectionMethod; path: string; referer: string | null; requestType?: "md-url" | "header-negotiated" | "agent-rewrite"; userAgent: string | null; } export interface GeistdocsProxyContext { context: NextFetchEvent; defaultLanguage: string; languages: string[]; request: NextRequest; } type ProxyHookResult = Response | undefined | null; export type GeistdocsProxyHook = (context: GeistdocsProxyContext) => Promise | ProxyHookResult; export type GeistdocsRewriteTransform = (pathname: `/${string}`, context: GeistdocsProxyContext) => Promise<`/${string}`> | `/${string}`; export interface GeistdocsMarkdownRoute { from: `/${string}`; to: `/${string}` | ((context: { defaultLanguage: string; language: string; path: string[]; pathname: string; }) => `/${string}`); } export interface CreateProxyOptions { /** Prepend standalone Markdown mappings without replacing docs mappings. */ additionalMarkdownRoutes?: GeistdocsMarkdownRoute[]; after?: GeistdocsProxyHook | GeistdocsProxyHook[]; before?: GeistdocsProxyHook | GeistdocsProxyHook[]; config: Pick; /** Override automatic recovery for unmatched Markdown and detected-agent requests. */ markdownNotFound?: boolean | ((context: { language: string; pathname: string; }) => boolean); markdownRoutes?: GeistdocsMarkdownRoute[]; trackMarkdownRequest?: (event: TrackMarkdownRequestEvent) => Promise | void; /** Transform Geistdocs' localized, app-local internal rewrite destination. */ transformRewrite?: GeistdocsRewriteTransform; } export declare const createProxy: ({ additionalMarkdownRoutes, after, before, config, markdownNotFound, markdownRoutes, trackMarkdownRequest, transformRewrite, }: CreateProxyOptions) => (request: NextRequest, context: NextFetchEvent) => Promise; export {}; //# sourceMappingURL=proxy.d.ts.map