import { AttributeDescriptors, AttributeTypeValue, ClusterMembership, DomainWord, FixedPosition, ImportedNodeRule, MarkedPackage, NodeType } from "./domain.model" export interface CcJson2 { meta: Meta2 files: FileNode[] lenses: Lenses } interface Meta2 { projectName: string apiVersion: string checksum: string commitHash?: string } export interface FileNode { id: string name: string type: NodeType children?: FileNode[] contentHash?: string link?: string } interface Lenses { metrics?: MetricsLensData dependency?: DependencyLensData domain?: DomainLens clusters?: ClustersLensWire } interface ClustersLensWire { clusterings?: Record } interface ClusteringWire { title: string membership: ClusterMembership weightBasis?: string analyzers: string[] clusters: ClusterWire[] attributeDescriptors?: Record } interface ClusterWire { id: string name: string parentId?: string | null attributes?: Record members: ClusterMemberWire[] } interface ClusterMemberWire { nodeId: string /** Omitted means the whole node belongs to the cluster. */ weight?: number } interface DomainLens { /** Optional so an unused lens slot stays `{}`, the form the analysis side treats as carrying nothing. */ nodes?: Record } interface DomainNode { words: DomainWord[] } interface MetricsLensData { attributes: Record> attributeDescriptors: AttributeDescriptors attributeTypes: Record } export interface DependencyLensData { edges: DependencyEdge[] attributeTypes: Record attributeDescriptors: AttributeDescriptors /** Optional so an unused lens slot stays `{}`, the form the analysis side treats as carrying nothing. */ nodes?: Record namespaces?: Record leaves?: Record> leafEdges?: DependencyLeafEdge[] } interface DependencyLensNode { level: number } interface DependencyLensNamespace { parent?: string level: number } export interface DependencyLensLeaf { name?: string kind: string language?: string namespace?: string parent?: string level?: number } /* Separate from `edges` because an edge between two declarations of the same file has no file-level counterpart. */ interface DependencyLeafEdge { fromId: string fromLeaf: string toId: string toLeaf: string attributes?: Record usage?: string[] isCyclic?: boolean isPointingUpwards?: boolean } /* * `isCyclic` and `isPointingUpwards` place the edge in the dependency graph; the four edge types * (regular, cyclic, container-level feedback, leaf-level feedback) are a pure function of that pair * and are derived where they are consumed. Absent means false. */ interface DependencyEdge { fromId: string toId: string attributes: Record isCyclic?: boolean isPointingUpwards?: boolean } /* * 1.x carryover fields — NOT part of cc.json 2.0; set by `normalizeToCcJson2` so the reader * can still apply legacy exclude/flatten rules, marked-folder colors, and fixed placement. */ export interface FileNodeWithCarryover extends FileNode { fixedPosition?: FixedPosition children?: FileNodeWithCarryover[] } export type CcJson2WithCarryover = Omit & { files: FileNodeWithCarryover[] blacklist?: ImportedNodeRule[] markedPackages?: MarkedPackage[] }