1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | import { ResolvedUrl } from '../model/url';
|
15 |
|
16 |
|
17 |
|
18 | export declare class DependencyGraph {
|
19 | private _documents;
|
20 | constructor(from?: DependencyGraph);
|
21 | private _getRecordFor;
|
22 | /**
|
23 | * Add dependencies of the given path.
|
24 | *
|
25 | * @param url The url of a document.
|
26 | * @param newDependencies The paths of that document's direct dependencies.
|
27 | */
|
28 | addDocument(url: ResolvedUrl, dependencies: Iterable<ResolvedUrl>): void;
|
29 | rejectDocument(url: ResolvedUrl, error: Error): void;
|
30 | /**
|
31 | * Returns a Promise that resolves when the given document and all
|
32 | * of its transitive dependencies have been resolved or rejected. This
|
33 | * Promise never rejects, if the document or any dependencies are rejected,
|
34 | * the Promise still resolves.
|
35 | */
|
36 | whenReady(url: ResolvedUrl): Promise<void>;
|
37 | private _whenReady;
|
38 | /**
|
39 | * Returns a fork of this graph without the documents at the given paths.
|
40 | */
|
41 | invalidatePaths(paths: ResolvedUrl[]): DependencyGraph;
|
42 | /**
|
43 | * Returns the set of transitive dependencies on the given path.
|
44 | *
|
45 | * So if A depends on B which depends on C, then getAllDependentsOf(C) will
|
46 | * be Set([A,B]), and getAllDependantsOf(B) will be Set([A]).
|
47 | */
|
48 | getAllDependantsOf(path: ResolvedUrl): Set<ResolvedUrl>;
|
49 | private _getAllDependantsOf;
|
50 | toString(): string;
|
51 | }
|