import type { QueryExpr } from "../ir/ir.js"; import type { Scope, ScopeTree } from "./scope.js"; export interface Frame { /** The owning Scope object itself: the identity anchor when two same-named CTEs shadow (the * label alone is not unique; this is). */ scope: Scope; /** The frame label `Sym.frame` uses for symbols declared/referenced inside `scope`. */ frame: string; } /** The narrowest (deepest) scope whose construct covers `offset`, plus its frame label. `ast` * (optional, mirrors `nodeAt`'s own param) widens a scope's own cover to its owning QueryExpr's FULL * span (CTE list, trailing ORDER BY / LIMIT), so an offset in those trailing clauses still resolves * to the right query level rather than falling through uncovered; without it, only `scope.body.cst` * (the queryTerm/select span, narrower) is tested. Total: undefined off-document / off-construct, * never throws. */ export declare function frameAt(scopes: ScopeTree, offset: number, ast?: QueryExpr): Frame | undefined;