import { T as TimingInfo, D as DebugEntry, M as MiddlewareOptions } from './types-BkAB9qwz.js'; export { a as DashboardOptions, R as RequestCapture, b as ResponseCapture } from './types-BkAB9qwz.js'; export { dashboardRoute, withHttpDebugger } from './next.js'; export { httpDebugger as elysia } from './adapters/elysia.js'; import 'elysia'; /** High-resolution timer for tracking HTTP request lifecycle phases. */ interface Timing { /** Time in ms from request start to when headers were received. */ headersReceived: number; /** Time in ms from request start to when the request body was fully read. */ bodyComplete: number; /** Time in ms from request start to when the route handler began executing. */ handlerStart: number; /** Time in ms from request start to when the route handler finished executing. */ handlerEnd: number; /** Time in ms from request start to when the response body started being written. */ responseStart: number; /** Time in ms from request start to when the response was fully sent. */ responseEnd: number; /** Total request duration in ms. */ duration: number; /** Mark the point when request headers were received. */ markHeadersReceived(): void; /** Mark the point when the request body was fully read. */ markBodyComplete(): void; /** Mark the point when the route handler started. */ markHandlerStart(): void; /** Mark the point when the route handler finished. */ markHandlerEnd(): void; /** Mark the point when the response body started being written. */ markResponseStart(): void; /** Mark the point when the response was fully sent. */ markResponseEnd(): void; /** Serialize timing data to a plain object. */ toJSON(): TimingInfo; } /** * Creates a high-resolution timer using `performance.now()`. * All timing values are relative to the moment this function is called. */ declare function createTiming(): Timing; /** Result of capturing a request or response body. */ interface CaptureResult { /** The parsed body, or null if empty/truncated. */ body: unknown; /** Whether the body exceeded maxBodySize and was truncated. */ truncated: boolean; } /** Generates a unique UUID for each request. */ declare function generateId(): string; /** * Captures and parses a request body from raw stream chunks. * * @param chunks - Raw body chunks collected from the request stream. * @param contentType - The Content-Type header value for JSON detection. * @param maxBodySize - Max bytes to capture before truncating (default: 1024). * @returns The parsed body and whether it was truncated. */ declare function captureRequestBody(chunks: Buffer[], contentType: string, maxBodySize?: number): CaptureResult; /** * Captures and parses a response body from raw stream chunks. * * @param chunks - Raw body chunks collected from the response stream. * @param maxBodySize - Max bytes to capture before truncating (default: 1024). * @returns The parsed body and whether it was truncated. */ declare function captureResponseBody(chunks: Buffer[], maxBodySize?: number): CaptureResult; /** * Formats a debug entry into a human-readable terminal string. * * @param entry - The captured request/response data. * @param options - Formatting options (colors, sanitize, maxDepth, maxArrayItems, curl). * @returns Formatted string ready for console output. */ declare function formatEntry(entry: DebugEntry, options?: Pick): string; /** * Redacts sensitive headers (Authorization, Cookie, etc.) from a headers object. * * @param headers - The original headers object. * @param enabled - Whether sanitization is enabled (default: true). * @returns A new headers object with sensitive values replaced by '***'. */ declare function sanitizeHeaders(headers: Record, enabled?: boolean): Record; declare const DASHBOARD_HTML: string; declare function createDashboardEngine(maxEntries?: number): { isEnabled: boolean; addEntry: (entry: DebugEntry) => void; addClientWithHistory: (sendFn: (chunk: string) => void) => () => void; getAllEntries: () => DebugEntry[]; clear: () => void; pause: () => void; resume: () => void; isPaused: boolean; setMaxEntries: (max: number) => void; }; export { type CaptureResult, DASHBOARD_HTML, DebugEntry, MiddlewareOptions, TimingInfo, captureRequestBody, captureResponseBody, createDashboardEngine, createTiming, formatEntry, generateId, sanitizeHeaders };