UNPKG

1.73 kBTypeScriptView Raw
1import * as tsdoc from '@microsoft/tsdoc';
2import { AstDeclaration } from './AstDeclaration';
3import { Collector } from '../collector/Collector';
4/**
5 * Used by `AstReferenceResolver` to report a failed resolution.
6 *
7 * @privateRemarks
8 * This class is similar to an `Error` object, but the intent of `ResolverFailure` is to describe
9 * why a reference could not be resolved. This information could be used to throw an actual `Error` object,
10 * but normally it is handed off to the `MessageRouter` instead.
11 */
12export declare class ResolverFailure {
13 /**
14 * Details about why the failure occurred.
15 */
16 readonly reason: string;
17 constructor(reason: string);
18}
19/**
20 * This resolves a TSDoc declaration reference by walking the `AstSymbolTable` compiler state.
21 *
22 * @remarks
23 *
24 * This class is analogous to `ModelReferenceResolver` from the `@microsoft/api-extractor-model` project,
25 * which resolves declaration references by walking the hierarchy loaded from an .api.json file.
26 */
27export declare class AstReferenceResolver {
28 private readonly _collector;
29 private readonly _astSymbolTable;
30 private readonly _workingPackage;
31 constructor(collector: Collector);
32 resolve(declarationReference: tsdoc.DocDeclarationReference): AstDeclaration | ResolverFailure;
33 private _getMemberReferenceIdentifier;
34 private _selectDeclaration;
35 private _selectUsingSystemSelector;
36 private _selectUsingIndexSelector;
37 /**
38 * This resolves an ambiguous match in the case where the extra matches are all ancillary declarations,
39 * except for one match that is the main declaration.
40 */
41 private _tryDisambiguateAncillaryMatches;
42}
43//# sourceMappingURL=AstReferenceResolver.d.ts.map
\No newline at end of file