import type { Expr, QueryExpr } from "../ir/ir.js"; import type { Scope, ScopeTree } from "./scope.js"; /** The Exprs that belong directly to a scope's body (not its child scopes). */ export declare function scopeExprs(scope: Scope): Expr[]; /** Every (expr, owning scope) pair in structure order. `ast` additionally attributes * QueryExpr.orderBy/limit exprs (they live on QueryExpr, not in any Scope.body). */ export declare function walk(scopes: ScopeTree, ast?: QueryExpr): Generator<{ node: Expr; scope: Scope; }>; /** The scope owning `node`, or undefined if the node is not reachable from these scopes. * Lazy: first call walks once and memoizes per ScopeTree (WeakMap — annotation-side). * Pass `ast` on the FIRST call to cover ORDER BY/LIMIT nodes — the index is built once * and never rebuilt, so a later call's `ast` is ignored once an index exists. */ export declare function scopeOf(scopes: ScopeTree, node: Expr, ast?: QueryExpr): Scope | undefined;