/**
 * Math.random() Detection
 *
 * Context-aware detection of Math.random() usage with intelligent severity
 * classification based on usage context, variable names, and function intent.
 */
import type { ParsedFile } from '../../utils/parsed-file';
/**
 * Check if Math.random() is used in a jitter/backoff/retry context
 * These are legitimate uses of Math.random() for network resilience,
 * not security-sensitive randomness.
 *
 * Examples:
 *   const delay = baseDelay + Math.random() * jitter
 *   setTimeout(retry, delay * Math.random())
 *   await sleep(backoff * (1 + Math.random() * 0.1))
 *
 * @param content - Full file content
 * @param lineNumber - The 0-indexed line number where Math.random() was found
 */
export declare function isJitterOrBackoffContext(content: string, lineNumber: number, lines?: string[]): boolean;
/**
 * Check if Math.random() is used in a React key prop context
 * This is a common pattern to force re-renders, not a security issue.
 *
 * Examples:
 *   key={Math.random()}
 *   key={`prefix-${Math.random()}`}
 *   key={Math.random().toString()}
 *
 * @param lineContent - The line of code to check
 * @param filePath - The file path (only check JSX/TSX files)
 */
export declare function isReactKeyPattern(lineContent: string, filePath: string): boolean;
/**
 * Check if Math.random() is used for cosmetic/UI purposes (not security)
 * Cosmetic uses: CSS values, animations, UI variations, demo data
 * Security uses: tokens, IDs, cryptographic operations, session management
 */
export declare function isCosmeticMathRandom(lineContent: string, content: string, lineNumber: number, lines?: string[]): boolean;
/**
 * Classify function intent based on function name
 * Used to determine if Math.random() usage is legitimate
 */
export declare function classifyFunctionIntent(functionName: string | null): 'uuid' | 'captcha' | 'demo' | 'security' | 'unknown';
/**
 * Analyze toString() pattern in Math.random() usage
 * Determines intent based on base and truncation length
 */
export declare function analyzeToStringPattern(lineContent: string): {
    hasToString: boolean;
    base: number | null;
    isTruncated: boolean;
    truncationLength: number | null;
    intent: 'short-ui-id' | 'business-id' | 'full-token' | 'unknown';
};
/**
 * Extract variable name from Math.random() assignment
 * Examples:
 *   const token = Math.random() -> "token"
 *   const businessId = Math.random().toString(36) -> "businessId"
 *   return Math.random() -> null (no variable)
 */
export declare function extractMathRandomVariableName(lineContent: string): string | null;
/**
 * Classify variable name security risk based on naming patterns
 *
 * High risk: Security-sensitive names (token, secret, key, etc.)
 * Medium risk: Unclear context
 * Low risk: Non-security names (id, businessId, orderId, etc.)
 */
export declare function classifyVariableNameRisk(varName: string | null): 'high' | 'medium' | 'low';
/**
 * Analyze surrounding code context for security signals
 * Returns context type and description for severity classification
 */
export declare function analyzeMathRandomContext(content: string, filePath: string, lineNumber: number, lines?: string[]): {
    inSecurityContext: boolean;
    inTestContext: boolean;
    inUIContext: boolean;
    inBusinessLogicContext: boolean;
    contextDescription: string;
};
/**
 * Check if file is an animation/motion component based on file name
 * Files with animation-related names typically use Math.random for visual effects
 */
export declare function isAnimationFile(filePath: string): boolean;
/**
 * Check if Math.random() is used for animation/motion coordinates
 * Common in animation libraries like framer-motion, react-spring, Three.js, etc.
 */
export declare function isAnimationCoordinateUsage(lineContent: string, context: string): boolean;
/**
 * Check if Math.random() is used in a template placeholder generator context
 * Template systems often use random generators for placeholder values
 *
 * Examples:
 *   const templates = { random: () => Math.random().toString() }
 *   random_hex: () => Math.random().toString(16)
 *   {{random}} placeholder generation
 */
export declare function isTemplatePlaceholderGenerator(line: string, content: string, lineNumber: number, lines?: string[]): boolean;
/**
 * Check if Math.random() should be skipped entirely
 * Returns true for seed files, test fixtures, captcha/puzzle, uuid, React keys, jitter/backoff, and pure cosmetic uses
 */
export declare function shouldSkipMathRandom(content: string, filePath: string, lineNumber: number, options?: {
    parsed?: ParsedFile;
}): boolean;
//# sourceMappingURL=math-random.d.ts.map