/**
 * tRPC Router Analyzer
 * Analyzes tRPC router definitions to understand which procedures are protected
 * by middleware (e.g., adminProcedure, protectedProcedure).
 *
 * This helps prevent false positives when frontend code calls protected tRPC
 * procedures - the backend already handles authorization.
 */
import type { ScanFile } from '../shared/types';
export interface TRPCMiddleware {
    /** Name of the middleware/procedure base */
    name: string;
    /** Type of protection */
    type: 'admin' | 'authenticated' | 'public' | 'unknown';
    /** File where defined */
    definedIn?: string;
    /** Line number where defined */
    lineNumber?: number;
}
export interface TRPCProcedure {
    /** Procedure name (e.g., 'getUsers', 'createPost') */
    name: string;
    /** Router this procedure belongs to */
    router: string;
    /** Whether this procedure has auth middleware */
    hasAuthMiddleware: boolean;
    /** Type of middleware protection */
    middlewareType?: 'admin' | 'authenticated' | 'public';
    /** File where defined */
    definedIn?: string;
}
export interface TRPCRouter {
    /** Router name (e.g., 'admin', 'user', 'post') */
    name: string;
    /** File where router is defined */
    file: string;
    /** Procedures in this router */
    procedures: string[];
    /** Default middleware for this router (if any) */
    defaultMiddleware?: string;
    /** Whether all procedures in this router are protected */
    isProtected: boolean;
}
export interface TRPCRouterContext {
    /** All detected routers */
    routers: Map<string, TRPCRouter>;
    /** All detected procedures with their protection status */
    procedures: Map<string, TRPCProcedure>;
    /** All detected middleware definitions */
    middlewares: Map<string, TRPCMiddleware>;
    /** Whether tRPC is detected in the project */
    hasTRPC: boolean;
}
/**
 * Analyze tRPC routers across all files
 */
export declare function analyzeTRPCRouters(files: ScanFile[]): TRPCRouterContext;
/**
 * Check if a tRPC procedure is protected by middleware
 */
export declare function isProcedureProtected(context: TRPCRouterContext, routerName: string, procedureName?: string): boolean;
/**
 * Parse a tRPC client call to extract router and procedure names
 * e.g., trpc.admin.getUsers.useQuery() -> { router: 'admin', procedure: 'getUsers' }
 */
export declare function parseTRPCCall(lineContent: string): {
    router: string;
    procedure: string;
} | null;
/**
 * Check if a line contains a tRPC client call
 */
export declare function isTRPCClientCall(lineContent: string): boolean;
/**
 * Get a summary of tRPC context for logging
 */
export declare function getTRPCSummary(context: TRPCRouterContext): string;
//# sourceMappingURL=trpc-analyzer.d.ts.map