/** * Shared utilities for scanners. Owns line-number calc, comment detection, * placeholder detection, and Pass-1 taint variable collection. */ export type Language = 'javascript' | 'typescript' | 'python' | 'java' | 'go'; /** * Returns the 1-based line number containing `charIndex` in `code`. * Index 0 → line 1. A '\n' belongs to the line it terminates. * Indices past end saturate at the last line. Negative → 1. */ export declare function lineOf(code: string, charIndex: number): number; /** * Whether the line *begins* with a comment marker for the given language. * Does not look at the tail of the line — use stripInlineComments for that. */ export declare function isCommentLine(line: string, language: Language): boolean; /** * Whether charIndex falls inside a block comment (opening with slash-star). * Limitation: does not understand strings (rare false positive). */ export declare function isInBlockComment(code: string, charIndex: number): boolean; /** * Returns the line with any trailing line-comment removed. * Quote-aware: // or # inside "..."/'...'/`...` is preserved. */ export declare function stripInlineComments(line: string, language: Language): string; /** * Whether `value` looks like a placeholder rather than a real secret. * Operates on the matched secret VALUE, not on the surrounding line text. */ export declare function isPlaceholderValue(value: string): boolean; export declare function escapeRegex(s: string): string; /** * Pass 1 of the taint-flow detection. Returns the set of variable names * assigned directly from a user-input source. Returns empty set if the * count exceeds MAX_TAINTED_VARS (50). */ export declare function collectTaintedVars(code: string, language: Language): Set; /** * Build a regex source fragment matching any tainted identifier as a * whole word. Empty set yields empty string for safe concatenation. */ export declare function taintAlternation(tainted: Set): string;