UNPKG

2.48 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import { ResourceResolver } from './resource-resolver';
3import { PipeSymbol } from './pipe-symbol';
4import { DirectiveSymbol } from './directive-symbol';
5import { ModuleSymbol } from './module-symbol';
6import { ProviderSymbol } from './provider-symbol';
7export interface ErrorReporter {
8 (error: any, path: string): void;
9}
10/**
11 * Creates a proxy which provides us access to the symbols
12 * defined in given context (could be lazy loaded module or the root module).
13 *
14 * @export
15 * @class ProjectSymbols
16 */
17export declare class ProjectSymbols {
18 private tsconfigPath;
19 private resourceResolver;
20 private errorReporter;
21 private metadataResolver;
22 private reflector;
23 private summaryResolver;
24 private staticSymbolResolver;
25 private staticResolverHost;
26 private pipeResolver;
27 private directiveResolver;
28 private urlResolver;
29 private directiveNormalizer;
30 private program;
31 private compilerHost;
32 private analyzedModules;
33 private options;
34 /**
35 * Creates an instance of ProjectSymbols.
36 *
37 * @param {ts.Program} program
38 * @param {ResourceResolver} resourceResolver
39 *
40 * @memberOf ProjectSymbols
41 */
42 constructor(tsconfigPath: string, resourceResolver: ResourceResolver, errorReporter: ErrorReporter);
43 /**
44 * Returns the metadata associated to this module.
45 *
46 * @returns {ModuleSymbol[]}
47 *
48 * @memberOf ProjectSymbols
49 */
50 getModules(): ModuleSymbol[];
51 /**
52 * Returns all the directives available in the context.
53 *
54 * @returns {DirectiveSymbol[]}
55 *
56 * @memberOf ProjectSymbols
57 */
58 getDirectives(): DirectiveSymbol[];
59 /**
60 * Returns all the pipes available in this module.
61 *
62 * @returns {PipeSymbol[]}
63 *
64 * @memberOf ProjectSymbols
65 */
66 getPipes(): PipeSymbol[];
67 /**
68 * Returns all the providers available in this module.
69 *
70 * @returns {ProviderSymbol[]}
71 *
72 * @memberOf ProjectSymbols
73 */
74 getProviders(): ProviderSymbol[];
75 /**
76 * Returns directive based on `ClassDeclaration` node and a filename.
77 *
78 * @param {ts.ClassDeclaration} declaration
79 * @param {string} fileName
80 *
81 * @memberOf DirectiveSymbol
82 */
83 getDirectiveFromNode(declaration: ts.ClassDeclaration, fileName: string): DirectiveSymbol | null;
84 private extractProgramSymbols();
85 private clearCaches();
86 private init();
87}