-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.d.ts
27 lines (27 loc) · 825 Bytes
/
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
export declare class Vertex {
readonly name: string;
successors: Vertex[];
index: number;
lowLink: number;
onStack: boolean;
visited: boolean;
constructor(name: string, successors?: Vertex[]);
reset(): void;
}
export declare class CycleError extends Error {
readonly cycles: any[];
constructor(message: string, cycles: any[]);
}
export default class Graph {
private readonly vertices;
add(key: string, descendants: string | string[]): this;
reset(): void;
addAndVerify(key: string, descendants: string | string[]): this;
dfs(key: string, visitor: (v: Vertex) => void): void;
getDescendants(key: string): string[];
hasCycle(): boolean;
getStronglyConnectedComponents(): Vertex[][];
getCycles(): Vertex[][];
clone(): Graph;
toDot(): string;
}