/** * API Relations Validator * * Enforces that the dependency graph is TRUTHFUL: a runnable project (role server * or client) that compiles against an api-lib must actually IMPLEMENT (serve) or * USE (call) at least one of its APIs. A dependency that is neither is almost * always a mistake — a forgotten client wiring, a dead import, or a controller * that was never registered — and it would draw an unexplained edge in the graph. * * The check reuses the same source scan that produces `apiRelations`, so "does P * relate to api-lib D" is answered by real code, never a declaration. */ import type { EnhancedGraph } from '../graph-sorter'; import { ProjectInfo } from '../project-info'; import { ApiScanResult, UnresolvedApiCall } from './api-scanner'; /** One `role:server`/`role:client` project that depends on an api-lib it neither implements nor uses. */ export interface UnclassifiedApiDep { project: string; role: string; apiLib: string; /** The API contract class names that api-lib exports (for the fix hint). */ apis: string[]; /** * Contracts this project DOES name at a call site but which never resolved to decorated * source. When non-empty the wiring almost certainly exists and the scan is blind — advice * to "add a controller" or "remove the dependency" would be actively wrong. */ unresolved: UnresolvedApiCall[]; } /** * Every server/client → api-lib edge for which the scan found NO implements and * NO uses. `graph` must already carry `apiRelations` (call scanAndAttachApiRelations first). */ export declare function findUnclassifiedApiDeps(graph: EnhancedGraph, projectInfos: Map, scan: ApiScanResult): UnclassifiedApiDep[]; /** Human-readable, fix-oriented report for one unclassified dependency. */ export declare function describeUnclassifiedApiDep(violation: UnclassifiedApiDep): string;