1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | import { SourceRange } from '../analysis-format/analysis-format';
|
15 | import { AnalysisContext } from '../core/analysis-context';
|
16 | import { Document } from './document';
|
17 | import { Feature } from './feature';
|
18 | import { AnalysisQuery as Query, AnalysisQueryWithKind as QueryWithKind, FeatureKind, FeatureKindMap, Queryable } from './queryable';
|
19 | import { ResolvedUrl } from './url';
|
20 | import { Warning } from './warning';
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export declare type Result<T, E> = {
|
29 | successful: true;
|
30 | value: T;
|
31 | } | {
|
32 | successful: false;
|
33 | error: E;
|
34 | };
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export declare class Analysis implements Queryable {
|
43 | private readonly context;
|
44 | private readonly _results;
|
45 | private readonly _searchRoots;
|
46 | static isExternal(path: string): boolean;
|
47 | constructor(results: Map<ResolvedUrl, Document | Warning>, context: AnalysisContext);
|
48 | getDocument(packageRelativeUrl: string): Result<Document, Warning | undefined>;
|
49 | /**
|
50 | * Get features in the package.
|
51 | *
|
52 | * Be default this includes features in all documents inside the package,
|
53 | * but you can specify whether to also include features that are outside the
|
54 | * package reachable by documents inside. See the documentation for Query for
|
55 | * more details.
|
56 | *
|
57 | * You can also narrow by feature kind and identifier.
|
58 | */
|
59 | getFeatures<K extends FeatureKind>(query: QueryWithKind<K>): Set<FeatureKindMap[K]>;
|
60 | getFeatures(query?: Query): Set<Feature>;
|
61 | /**
|
62 | * Get all warnings in the project.
|
63 | */
|
64 | getWarnings(options?: Query): Warning[];
|
65 | /**
|
66 | * Potentially narrow down the document that contains the sourceRange.
|
67 | * For example, if a source range is inside a inlineDocument, this function
|
68 | * will narrow down the document to the most specific inline document.
|
69 | *
|
70 | * @param sourceRange Source range to search for in a document
|
71 | */
|
72 | getDocumentContaining(sourceRange: SourceRange | undefined): Document | undefined;
|
73 | private _getDocumentQuery;
|
74 | }
|