/** * resolveDeclToHash — map a type-checker-resolved declaration to the catalog * bodyHash of its SOURCE occurrence. * * The single seam every exact-engine resolver (direct-call, property-access, * jsx-element, new-expression, polymorphic) routes a resolved declaration * through. It unifies the two ways a declaration's source body is reached: * * 1. IN-PROJECT SOURCE — the declaration lives in a `.ts(x)` file the program * compiled from source. Hash the declaration body and match it in the * catalog (the original {@link findCatalogEntry} behavior). * * 2. WORKSPACE-PACKAGE BOUNDARY — Node16 resolves a `@scope/pkg` import to the * package's BUILT `dist/*.d.ts`, so the type checker hands back a BODILESS * declaration. Hashing it never matches the SOURCE body the catalog holds * → the real cross-package edge was dropped. Instead, re-resolve through * the SAME export-index model the sharded linker uses: (the call site's * import specifier for this name) + (callee name) → the UNIQUE exported * source occurrence. Binding-required, so a bare name with no import never * resolves (no phantom). Decline-beats-guess on ambiguity. * * A declaration in a `.d.ts` that is NOT a workspace package the importer bound * to (e.g. a `@types/*` ambient global like Vitest's `describe`, or `lib.dom`) * resolves to nothing — exactly right: those are not project functions. */ import type { ResolverContext } from '../edge-resolvers/types.js'; import type ts from 'typescript'; /** * Resolve `declNode` (a function-shaped node returned by * `functionLikeFromDeclaration`) to a catalog bodyHash, or `null` to decline. * * `candidateNames` is the semantic SOURCE/export name(s) of the target * declaration (e.g. `getSharedSourceFile`, `walkNodes`). Used both for the * in-project hash lookup and the cross-package export lookup. A caller-local * named-import alias is deliberately not a target candidate. * * `bindingNames` is the local binding name(s) that were IMPORTED in the call * site's file (the namespace receiver for `ns.fn()`, or the callee name itself * for a direct `fn()` / `` / `new Fn()`). The cross-package path requires * one of these to carry a workspace import specifier — a binding-required check * that rules out phantom same-name matches. When `bindingNames` is omitted it * defaults to `candidateNames` (direct calls bind by the callee name). */ export declare function resolveDeclToHash(declNode: ts.Node, declSourceFile: ts.SourceFile, candidateNames: readonly string[], ctx: ResolverContext, bindingNames?: readonly string[]): string | null; //# sourceMappingURL=resolve-decl.d.ts.map