archunit
Version:
ArchUnit TypeScript is an architecture testing library, to specify and assert architecture rules in your TypeScript app
30 lines (29 loc) • 1.34 kB
TypeScript
import { Violation } from '../../common/assertion';
import { ProjectedEdge, ProjectedGraph } from '../../common/projection';
export type Rule = {
source: string;
target: string;
};
export declare class ViolatingEdge implements Violation {
rule: Rule | null;
projectedEdge: ProjectedEdge;
isNegated: boolean;
constructor(rule: Rule | null, projectedEdge: ProjectedEdge, isNegated?: boolean);
}
export declare const gatherViolations: (graph: ProjectedEdge[], forbidden: Rule[]) => ViolatingEdge[];
export declare const gatherPositiveViolations: (graph: ProjectedGraph, allowed: Rule[], nodesOfInterest: string[], ignoreNonListed: boolean) => ViolatingEdge[];
export interface CoherenceOptions {
ignoreOrphans?: boolean;
ignoreExternal?: boolean;
}
/**
* Checks for complete coherence in the architecture, ensuring all nodes are properly connected
* according to the defined rules.
*
* @param graph The projected graph to check
* @param allowed List of allowed rules
* @param nodes List of nodes that should be checked for coherence
* @param options Configuration options for coherence checking
* @returns List of violations where coherence rules are broken
*/
export declare const checkCoherence: (graph: ProjectedGraph, allowed: Rule[], nodes: string[], options?: CoherenceOptions) => ViolatingEdge[];