import type { SourceLocation } from "../../types/base.js"; /** Visit every object in an AST subtree (descending arrays and object * values alike). The linter's ONE bespoke descent — it exists because * walkNodes does not reach type hints or tag arguments, which are * positions rules must see. Collectors (collectReferencedNames, * usedNamesIn, reassignedNames) are callbacks over this shared HOW, * each stating only WHAT it collects. */ export declare function walkValues(root: unknown, visit: (node: Record) => void): void; /** Sorted offsets of every "\n" in `source`. Build this ONCE per lint pass * (buildLineIndex) and hand it to locFromOffsets/nameRange so each * offset→line/col lookup is a binary search instead of a rescan from byte 0. * Without it, a rule that emits one finding per declaration turns a * whole-file pass into O(n²): each finding pays O(its own offset), and the * offsets span the file. */ export type LineIndex = number[]; export declare function buildLineIndex(source: string): LineIndex; /** 0-indexed line/col plus offsets, matching the codebase's SourceLocation. * Pass a `lineIndex` (buildLineIndex) to make this O(log n); without one it * falls back to an O(offset) scan — fine for a handful of calls, quadratic * across a finding-per-declaration pass. */ export declare function locFromOffsets(source: string, start: number, end: number, lineIndex?: LineIndex): SourceLocation; /** The local name's character range within a statement's source span, matched * on word boundaries so `b` never matches inside `ab` or inside the module * path. Falls back to the whole statement span if the token is somehow not * found (dimming the whole statement is honest; pointing at the wrong * character is not). */ export declare function nameRange(source: string, stmtStart: number, stmtEnd: number, localName: string, lineIndex?: LineIndex): SourceLocation; /** The statement's span with trailing whitespace trimmed off: the parser's * span includes the optional trailing newline it consumed, which is not part * of the statement text we match names in or replace on regeneration. */ export declare function statementSpan(source: string, node: { loc?: SourceLocation; }): { start: number; end: number; };