/** * Nesting depth validation for the pre-scanner. * Detects excessive bracket nesting that could overflow parser stack. * * @module pre-scanner/checks/nesting-check */ import type { PreScannerConfig } from '../config'; import type { ScanState } from '../scan-state'; /** * Check bracket nesting depth. * This is a fast O(n) scan that tracks nesting without full parsing. * * Note: This is a heuristic check. It doesn't handle brackets in strings * or comments perfectly, but it catches malicious deep nesting attacks * which wouldn't be valid code anyway. * * @param source - The source code to check * @param config - Pre-scanner configuration * @param state - Scan state for recording issues */ export declare function checkNestingDepth(source: string, config: PreScannerConfig, state: ScanState): void; /** * Check for excessive consecutive operators. * Catches patterns like "a++++++b" that could confuse parsers. * * @param source - The source code to check * @param config - Pre-scanner configuration * @param state - Scan state for recording issues */ export declare function checkConsecutiveOperators(source: string, config: PreScannerConfig, state: ScanState): void; /** * Perform all nesting-related checks. * * @param source - The source code to check * @param config - Pre-scanner configuration * @param state - Scan state for recording issues */ export declare function performNestingChecks(source: string, config: PreScannerConfig, state: ScanState): void;