/**
 * Middleware Auth Detection
 * Detects global authentication middleware (Next.js, Express, etc.)
 * and determines which routes are protected
 */
import type { ScanFile } from '../types';
/**
 * Configuration describing detected auth middleware
 */
export interface MiddlewareAuthConfig {
    /** Whether auth middleware was detected */
    hasAuthMiddleware: boolean;
    /** The type of auth detected */
    authType?: 'clerk' | 'nextauth' | 'auth0' | 'custom' | 'unknown';
    /** File path where middleware was found */
    middlewareFile?: string;
    /** Protected path patterns (glob-like) */
    protectedPaths: string[];
    /** Public/excluded path patterns */
    publicPaths: string[];
    /** Raw matcher patterns found */
    matchers: string[];
    /** Additional context about the auth setup */
    context: {
        usesAuthProtect: boolean;
        usesGetToken: boolean;
        usesSession: boolean;
        hasPublicRoutes: boolean;
    };
}
/**
 * Detect global auth middleware from scanned files
 * Looks for Next.js middleware.ts, Express auth patterns, etc.
 */
export declare function detectGlobalAuthMiddleware(files: ScanFile[]): MiddlewareAuthConfig;
/**
 * Check if a given route path is protected by the middleware
 */
export declare function isRouteProtectedByMiddleware(routePath: string, config: MiddlewareAuthConfig): {
    isProtected: boolean;
    reason: string;
};
/**
 * Extract route path from a file path (e.g., app/api/users/route.ts -> /api/users)
 */
export declare function getRoutePathFromFile(filePath: string): string | null;
/**
 * Get user-scoping patterns from file content
 * Detects patterns like: user_id, userId, session.user.id
 */
export declare function detectUserScopingPatterns(content: string): {
    hasUserScoping: boolean;
    patterns: string[];
};
//# sourceMappingURL=middleware-detector.d.ts.map