/** * Shared helpers for the tree-sitter extractor. * * Newline-offset binary search is the same pattern `generic-parser.ts` and * `import-extractor.ts` use: precompute the offset of every `\n` once per * file, then resolve match→line in O(log n) instead of O(n). Tree-sitter * gives us `{ row, column }` directly, but we need the same conversion for * identifiers that we extract from arbitrary child nodes whose byte offset * we have to translate into 1-based line + 0-based col ourselves. */ /** * 1-based line, 0-based col (the index schema's convention) for an offset, * using binary search over newline offsets. The col used to be 1-based — * `index - lastNl` counts the newline itself — so every tree-sitter symbol * sat one column right of where every other parser puts it. */ export declare function lineColAt(offsets: readonly number[], index: number): { line: number; col: number; }; /** * Precompute newline offsets once per file. The cost is a single O(n) scan * of the buffer; subsequent lookups (typically dozens to hundreds per file) * are O(log n) instead of O(n). */ export declare function newlineOffsets(content: string): number[]; /** * Cap the source the visitor walks, mirroring `GENERIC_MAX_FILE_CHARS` in * `generic-parser.ts`. Files larger than this get sliced; the rest is dropped * from the index. Mirrors the safety net that the regex extractor already * applies — without it, a multi-MB blob can blow the AST heap. */ export declare const TREE_SITTER_MAX_FILE_CHARS: number; /** Soft cap on symbols per file (matches `GENERIC_MAX_SYMBOLS_DEFAULT`). */ export declare const TREE_SITTER_MAX_SYMBOLS = 500; //# sourceMappingURL=util.d.ts.map