import type { QueryExpr } from "../ir/ir.js"; import type { SchemaProvider } from "../qualify/schema-provider.js"; import { type ScopeTree } from "../scope/scope.js"; import type { Span, SymbolKind } from "../symbols/symbols.js"; export interface Occurrence { span: Span; role: "declaration" | "reference"; } export interface Occurrences { /** The resolved symbol's name (the column / CTE / alias / table name). */ symbol: string; kind: SymbolKind; /** The in-query declaration span, when one exists (a CTE name, an output projection). */ declaration?: Span; /** Every occurrence (references + the declaration), deduped by span. */ occurrences: Occurrence[]; } /** * Find the declaration + every occurrence of the symbol under `offset`. Schema-free works for * in-query columns and CTE/alias/source names; a base-table column's cross-boundary identity * needs the schema (without it, only the in-query occurrences are returned). Returns null when * the cursor is not on a resolvable symbol. Never throws. */ export declare function referencesAt(scopes: ScopeTree, offset: number, schema?: SchemaProvider, ast?: QueryExpr): Occurrences | null;