import { type NextRequest } from 'next/server'; export declare const isNoPrettyPrint: boolean; export declare enum EndpointType { webVitals = "web-vitals", logs = "logs" } export interface RequestJSON { method: string; url: string; headers: Record; cookies: Record; nextUrl?: { basePath: string; buildId?: string; defaultLocale?: string; domainLocale?: { defaultLocale: string; domain: string; locales?: string[]; }; hash: string; host: string; hostname: string; href: string; locale?: string; origin: string; password: string; pathname: string; port: string; protocol: string; search: string; searchParams: Record; username: string; }; ip?: string; geo?: { city?: string; country?: string; region?: string; latitude?: string; longitude?: string; }; body?: any; cache: { mode: RequestCache; credentials: RequestCredentials; redirect: RequestRedirect; referrerPolicy: ReferrerPolicy; integrity: string; }; mode: RequestMode; destination: RequestDestination; referrer: string; keepalive: boolean; signal: { aborted: boolean; reason: any; }; } export type LogRequestDetails = boolean | (keyof RequestJSON)[]; /** * Builds the `details` of a request report according to `logRequestDetails`: everything for `true`, * only the listed keys for a list, nothing when unset. The body is read (through a clone) only when it * is asked for and `readBody` allows it. Middleware must never touch it: on Edge runtimes even `clone()` * locks the stream the platform forwards to the route handler behind the middleware. */ export declare function requestDetails(request: Request | NextRequest, logRequestDetails: LogRequestDetails | undefined, { readBody }?: { readBody?: boolean; }): Promise; /** * Transforms a NextRequest or Request object into a JSON-serializable object */ export declare function requestToJSON(request: Request | NextRequest, { readBody }?: { readBody?: boolean; }): Promise; export declare const throttle: (fn: Function, wait: number) => (this: any) => void;