/**
 * Auth Helper Detector
 *
 * Detects authentication helper functions that throw on missing auth,
 * return non-null types, and provide security guarantees.
 *
 * When these helpers are called, subsequent code is GUARANTEED to have
 * an authenticated user - no additional `if (!userId)` checks are needed.
 */
import type { ScanFile } from '../shared/types';
export interface AuthHelper {
    /** Name of the helper function */
    name: string;
    /** File where it's defined (if detected) */
    definedIn?: string;
    /** Whether it throws on missing auth (vs returning null) */
    throwsOnMissing: boolean;
    /** Return type if detected (e.g., 'string', 'User', 'Promise<string>') */
    returnType?: string;
    /** Whether return type is non-null */
    returnsNonNull: boolean;
    /** Pattern that matches calls to this helper */
    callPattern: RegExp;
}
export interface AuthHelperContext {
    /** All detected auth helpers */
    helpers: AuthHelper[];
    /** Whether the project has any throwing auth helpers */
    hasThrowingHelpers: boolean;
    /** Summary for AI validation */
    summary: string;
}
/**
 * Detect auth helper functions in the codebase
 */
export declare function detectAuthHelpers(files: ScanFile[]): AuthHelperContext;
/**
 * Check if a code line uses a throwing auth helper
 * Returns the helper if found, undefined otherwise
 */
export declare function usesThrowingAuthHelper(lineContent: string, surroundingContent: string, helpers: AuthHelper[]): AuthHelper | undefined;
/**
 * Check if a file has auth helper calls before a given line
 * This indicates the code after the call is in authenticated context
 */
export declare function hasAuthHelperCallBefore(content: string, lineNumber: number, helpers: AuthHelper[]): {
    hasCall: boolean;
    helper?: AuthHelper;
    callLine?: number;
};
/**
 * Check if code suggests user ID is already validated
 * Detects patterns like: const userId = await getCurrentUserId()
 */
export declare function isUserIdAlreadyValidated(content: string, lineNumber: number, helpers: AuthHelper[]): boolean;
//# sourceMappingURL=auth-helper-detector.d.ts.map