Kind: Interface
Source: packages/core/inspector/interfaces/edge.interface.ts
Part of: Core
Edge represents a directed relationship between two entities in the inspector graph. It identifies the connection, its source and target node IDs, and metadata describing whether the relationship is module-to-module or class-to-class.
Properties
| Property | Type |
|---|---|
id | string |
source | string |
target | string |
metadata | `ModuleToModuleEdgeMetadata |
Diagram
mermaidgraph LR Source["Source entity<br/>(source)"] --> Edge["Edge<br/>id + metadata"] --> Target["Target entity<br/>(target)"] Edge --- Metadata["ModuleToModuleEdgeMetadata<br/>or ClassToClassEdgeMetadata"]
Usage
tsimport type { Edge } from '@core/inspector/interfaces/edge.interface';
const moduleDependency: Edge = {
id: 'app-module->users-module',
source: 'app-module',
target: 'users-module',
metadata: {
type: 'module-to-module',
// Additional ModuleToModuleEdgeMetadata fields
},
};
// Use the edge when constructing an inspector dependency graph.
graph.edges.push(moduleDependency);
AI Coding Instructions
- Use stable, unique
idvalues so graph edges can be reliably indexed, updated, and rendered. - Ensure
sourceandtargetreference valid node IDs already present in the inspector graph. - Provide metadata that matches the relationship type:
ModuleToModuleEdgeMetadatafor module dependencies andClassToClassEdgeMetadatafor class relationships. - Treat edges as directed:
source -> targetmay not represent the same relationship astarget -> source. - Keep edge metadata aligned with the graph consumer’s expected discriminators and rendering logic.
Relationships
- IMPORTS →
InjectionToken
Was this page helpful?