-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.ts
33 lines (26 loc) · 953 Bytes
/
mod.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
import { dotformatter } from './src/formatter/dot.ts';
import { type Formatter, FormatterRegistry } from './src/formatter/formatter_registry.ts';
import { DefaultEdge, DefaultNode, type Edge, type Node } from './src/graph.ts';
export { analyzeDependencies } from './src/analyzer.ts';
export {
type DefaultEdge,
type DefaultGraph,
type DefaultNode,
DependencyGraph,
type Edge,
type Node,
} from './src/graph.ts';
export { type Formatter, FormatterRegistry } from './src/formatter/formatter_registry.ts';
export const defaultFormatterRegistry = new FormatterRegistry<DefaultNode, DefaultEdge>();
export const builtInFormatters = {
dot: dotformatter,
};
Object.values(builtInFormatters).forEach((formatter) =>
defaultFormatterRegistry.register(formatter)
);
export function registerFormatter<T extends Node, E extends Edge<T>>(
registry: FormatterRegistry<T, E>,
formatter: Formatter<T, E>,
) {
registry.register(formatter);
}