/** * Auth Coverage Map — enumerates Next.js App Router routes, parses middleware * matchers, detects auth guards, and produces a coverage report. */ export interface RouteInfo { urlPath: string; filePath: string; method: string; hasAuthGuard: boolean; middlewareCovered: boolean; protectionSource: "auth-guard" | "middleware" | "layout" | "none"; } export interface FileEntry { path: string; content: string; } /** * Enumerate all routes from a set of app directory files. */ export declare function enumerateRoutes(files: FileEntry[]): RouteInfo[]; export declare function parseMiddlewareMatchers(content: string): string[]; /** * Clerk-style protect lists: `createRouteMatcher([...])`. When present these are the * precise routes the middleware enforces auth on — more accurate than config.matcher * (which only says where the middleware *runs*), so a sensitive route outside the * protect list is correctly still reported as unprotected. */ export declare function parseProtectedRouteMatchers(content: string): string[]; /** * Check if a route URL path matches any of the middleware matchers. * Empty matchers = middleware covers all routes. */ export declare function routeMatchesMatcher(urlPath: string, matchers: string[]): boolean; export interface AuthCoverageReport { totalRoutes: number; protectedRoutes: number; unprotectedRoutes: number; middlewareCoveragePercent: number; routes: RouteInfo[]; unprotectedList: RouteInfo[]; } /** * Analyze auth coverage across all route files. */ export declare function analyzeAuthCoverage(routeFiles: FileEntry[], middlewareContent: string, layoutFiles?: FileEntry[], authExceptions?: Array<{ path: string; reason: string; }>): AuthCoverageReport; /** * Format auth coverage report as markdown or JSON. */ export declare function formatAuthCoverage(report: AuthCoverageReport, format: "markdown" | "json"): string;