UNPKG

2.73 kBTypeScriptView Raw
1import {
2 IExcludeType,
3 IIncludeOnlyType,
4 IDoNotFollowType,
5 IFocusType,
6} from "./filter-types";
7
8export interface IReporterOptions {
9 /**
10 * Options to tweak the output of the anonymous reporter
11 */
12 anon?: IAnonReporterOptions;
13 /**
14 * Options to tweak the output of the archi/ cdot reporter
15 */
16 archi?: IDotReporterOptions;
17 /**
18 * Options to tweak the output of the dot reporter
19 */
20 dot?: IDotReporterOptions;
21 /**
22 * Options to tweak the output of the dot reporter
23 */
24 ddot?: IDotReporterOptions;
25}
26
27export interface IReporterFiltersType {
28 exclude: IExcludeType;
29 includeOnly: IIncludeOnlyType;
30 focus: IFocusType;
31}
32
33export interface IAnonReporterOptions {
34 /**
35 * List of words to use to replace path elements of file names in the output
36 * with so the output isn't directly traceable to its intended purpose.
37 * When the list is exhausted, the anon reporter will use random strings
38 * patterned after the original file name in stead. The list is empty
39 * by default.
40 *
41 * Read more in https://github.com/sverweij/dependency-cruiser/blob/develop/doc/cli.md#anon---obfuscated-json",
42 */
43 wordlist?: string[];
44}
45
46export interface IDotReporterOptions {
47 /**
48 * Regular expressions to collapse to. For the "dot" reporter defaults
49 * to null, but "node_modules/[^/]+" is recommended for most use cases.
50 */
51 collapsePattern?: string;
52 /**
53 * filters to apply to the reporter before rendering it (e.g. to leave
54 * out details from the graphical output that are not relevant for the
55 * goal of the report)
56 */
57 filters?: IReporterFiltersType;
58 /**
59 * A bunch of criteria to (conditionally) theme the dot output
60 */
61 theme?: IDotTheme;
62}
63
64export interface IDotTheme {
65 /**
66 * If passed with the value 'true', the passed theme replaces the default
67 * one. In all other cases it extends the default theme
68 */
69 replace?: boolean;
70 /**
71 * Name- value pairs of GraphViz dot (global) attributes.
72 */
73 graph?: any;
74 /**
75 * Name- value pairs of GraphViz dot node attributes.
76 */
77 node?: any;
78 /**
79 * Name- value pairs of GraphViz dot edge attributes.
80 */
81 edge?: any;
82 /**
83 * List of criteria and attributes to apply for modules when the criteria are
84 * met. Conditions can use any module attribute. Attributes can be any
85 * that are valid in GraphViz dot nodes.
86 */
87 modules?: IDotThemeEntry[];
88 /**
89 * List of criteria and attributes to apply for dependencies when the criteria
90 * are met. Conditions can use any dependency attribute. Attributes can be any
91 * that are valid in GraphViz dot edges.
92 */
93 dependencies?: IDotThemeEntry[];
94}
95
96export interface IDotThemeEntry {
97 criteria: any;
98 attributes: any;
99}