import type { AgencyProgram } from "../types.js"; import type { ScopeInfo } from "../typeChecker/types.js"; /** * Find the AST definition node (function or graphNode) for a named scope. */ export declare function findDefForScope(name: string, program: AgencyProgram): import("../types.js").GraphNodeDefinition | import("../types.js").FunctionDefinition | null; /** * Build a reusable scope finder. * * Matching an offset to a scope needs a name→definition map, and * building that map costs a scan of `program.nodes` for every scope. For * a one-shot question — a hover, a go-to-definition — paying that once * per call is fine. * * It is not fine for a caller asking about every identifier in the file: * that turns one document into scopes × nodes × identifiers work. So the * map is built here, once, and the returned function reuses it. * `findContainingScope` is the one-shot form, and calls this. */ export declare function makeScopeFinder(scopes: ScopeInfo[], program: AgencyProgram): (offset: number) => ScopeInfo | undefined; /** * Find the innermost scope that contains the given character offset. * Falls back to the top-level scope if no function/node scope matches. * * Asking this repeatedly for the same document rebuilds the definition * map each time — use `makeScopeFinder` for that. */ export declare function findContainingScope(offset: number, scopes: ScopeInfo[], program: AgencyProgram): ScopeInfo | undefined;