forked from sverweij/dependency-cruiser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
63 lines (59 loc) · 1.42 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-disable node/no-unpublished-import */
/* eslint-disable node/no-missing-import */
/* eslint-disable import/no-unresolved */
import {
IDependency,
IFolder,
IFolderDependency,
IModule,
IFlattenedRuleSet,
} from "../../types/cruise-result";
import { SeverityType } from "../../types/shared-types";
export interface IValidationResult {
/**
* true if the relation between pFrom and pTo is valid (as far as the
* given ruleset is concerend).
* false in all other cases.
*/
valid: boolean;
/**
* violated rule. Only present when the result of the validation is
* _not_ valid
*/
rules?: {
/**
* Name of the violated rule (taken from the rule set)
*/
name: string;
/**
* Severity of the violation (taken from the rule set)
*/
severity: SeverityType;
}[];
}
/**
* Validates the pModule module against the given
* ruleset pRuleSet
*/
export function module(
pRuleSet: IFlattenedRuleSet,
pModule: IModule
): IValidationResult;
/**
* Validates the pFrom and pTo dependency pair against the given
* ruleset pRuleSet
*/
export function dependency(
pRuleSet: IFlattenedRuleSet,
pFrom: IModule,
pTo: IDependency
): IValidationResult;
/**
* Validates the pFrom and pTo dependency pair against the given
* ruleset pRuleSet
*/
export function folder(
pRuleSet: IFlattenedRuleSet,
pFromFolder: IFolder,
pToFolder: IFolderDependency
): IValidationResult;