/** * Package-aware callee resolution. * * A call edge stores its target as a `bodyHash`, which is a CONTENT hash: * two functions with identical bodies in different packages share one hash. * Looking a callee up by hash alone therefore mis-attributes its package * whenever bodies collide (the cause of impossible coupling edges like * `core→fitness`). `resolveCallee` disambiguates such a hash to the * occurrence the caller can actually reach, deterministically. * * Pure, dependency-free (no node imports) so the same logic can be mirrored * verbatim in the dashboard's browser-side coupling view. */ import type { FunctionOccurrence, Indexes } from './types.js'; /** * The first path segment under `packages/` — the unit the coupling grid * groups by (so `packages/languages/lang-typescript/...` → `languages`, * `packages/graph/graph-typescript/...` → `graph`). Returns `''` * for paths outside `packages/`. Must match the dashboard's `packageOfPath`. */ export declare function packageOf(filePath: string): string; /** * The package an occurrence belongs to. Prefers the build-time-stamped * `occurrence.package` (nearest `package.json` name — accurate for any repo * layout); falls back to the `packages/` path heuristic for * legacy catalogs that predate the stamp. */ export declare function pkgOf(occ: Pick): string; /** * A package-unique, collision-free id for a single occurrence — its source * location `${filePath}:${line}:${column}`. Unlike `bodyHash` (a CONTENT hash * that two functions with identical bodies in different packages share), every * occurrence has a unique declaration site, so occId never collapses distinct * functions. Used as the SCC/cycle graph's node identity (the body-hash * cross-package phantom fix) and keyed into `Indexes.byOccId`. */ export declare function occId(occ: Pick): string; /** The package groups the caller's module imports (empty in fast mode). */ export declare function callerImportedPackages(callerOcc: FunctionOccurrence, indexes: Indexes): ReadonlySet; /** * Resolve a call edge's target `bodyHash` to the callee occurrence the * caller can actually reach, disambiguating body-hash collisions across * packages. Order: * 1. an occurrence in the caller's own package; * 2. an occurrence in a package the caller's module imports; * 3. deterministic fallback — lowest `qualifiedName`. * Returns `undefined` when the hash has no occurrences. */ export declare function resolveCallee(targetHash: string, callerOcc: FunctionOccurrence, indexes: Indexes): FunctionOccurrence | undefined; //# sourceMappingURL=resolve-callee.d.ts.map