import type { IndexOptions, MetadataEntry, MetadataIndex } from './types.js'; export type BuildResult = { index: MetadataIndex; outputPath: string; }; /** * Builds the metadata index by scanning the source directory, parsing all files, * resolving dependencies, and writing the output. */ export declare function buildMetadataIndex(cwd: string, options: IndexOptions, warn?: (msg: string) => void): BuildResult; /** * Loads an existing metadata index from disk. */ export declare function loadMetadataIndex(cwd: string): MetadataIndex | null; /** * Queries the dependency graph for a given API name. * Returns direct dependencies and dependents. */ export declare function queryDependencies(index: MetadataIndex, apiName: string): { entry: MetadataEntry | null; dependencies: string[]; dependents: string[]; }; export type ImpactNode = { apiName: string; type: string; depth: number; }; export type ImpactClosure = { root: string; found: boolean; direction: 'up' | 'down' | 'both'; /** Transitive dependents ("what breaks if the root changes"). */ dependents: ImpactNode[]; /** Transitive dependencies ("what the root relies on"). */ dependencies: ImpactNode[]; }; /** * Computes the full transitive closure for a component using breadth-first * traversal. `up` walks dependents (reverse impact — what breaks if X changes), * `down` walks dependencies (what X relies on). Cycles are handled via a visited * set; each reachable node is reported once at its shortest depth. */ export declare function computeImpactClosure(index: MetadataIndex, apiName: string, direction?: 'up' | 'down' | 'both'): ImpactClosure;