1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ImportGenerator } from '@angular/compiler';
|
9 | import { AngularCompilerOptions, MetadataCollector, ModuleMetadata } from '@angular/tsc-wrapped';
|
10 | import * as ts from 'typescript';
|
11 | import { StaticReflectorHost, StaticSymbol } from './static_reflector';
|
12 | export interface ReflectorHostContext {
|
13 | fileExists(fileName: string): boolean;
|
14 | directoryExists(directoryName: string): boolean;
|
15 | readFile(fileName: string): string;
|
16 | assumeFileExists(fileName: string): void;
|
17 | }
|
18 | export declare class ReflectorHost implements StaticReflectorHost, ImportGenerator {
|
19 | protected program: ts.Program;
|
20 | protected compilerHost: ts.CompilerHost;
|
21 | protected options: AngularCompilerOptions;
|
22 | protected metadataCollector: MetadataCollector;
|
23 | protected context: ReflectorHostContext;
|
24 | private isGenDirChildOfRootDir;
|
25 | protected basePath: string;
|
26 | private genDir;
|
27 | constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: ReflectorHostContext);
|
28 | angularImportLocations(): {
|
29 | coreDecorators: string;
|
30 | diDecorators: string;
|
31 | diMetadata: string;
|
32 | diOpaqueToken: string;
|
33 | animationMetadata: string;
|
34 | provider: string;
|
35 | };
|
36 | getCanonicalFileName(fileName: string): string;
|
37 | protected resolve(m: string, containingFile: string): string;
|
38 | protected normalizeAssetUrl(url: string): string;
|
39 | protected resolveAssetUrl(url: string, containingFile: string): string;
|
40 | |
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | getImportPath(containingFile: string, importedFile: string): string;
|
56 | private dotRelative(from, to);
|
57 | |
58 |
|
59 |
|
60 | private rewriteGenDirPath(filepath);
|
61 | findDeclaration(module: string, symbolName: string, containingFile: string, containingModule?: string): StaticSymbol;
|
62 | private typeCache;
|
63 | private resolverCache;
|
64 | /**
|
65 | * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
|
66 | * All types passed to the StaticResolver should be pseudo-types returned by this method.
|
67 | *
|
68 | * @param declarationFile the absolute path of the file where the symbol is declared
|
69 | * @param name the name of the type.
|
70 | */
|
71 | getStaticSymbol(declarationFile: string, name: string, members?: string[]): StaticSymbol;
|
72 | getMetadataFor(filePath: string): ModuleMetadata;
|
73 | readMetadata(filePath: string): any;
|
74 | private getResolverMetadata(filePath);
|
75 | protected resolveExportedSymbol(filePath: string, symbolName: string): StaticSymbol;
|
76 | }
|
77 | export declare class NodeReflectorHostContext implements ReflectorHostContext {
|
78 | private host;
|
79 | constructor(host: ts.CompilerHost);
|
80 | private assumedExists;
|
81 | fileExists(fileName: string): boolean;
|
82 | directoryExists(directoryName: string): boolean;
|
83 | readFile(fileName: string): string;
|
84 | assumeFileExists(fileName: string): void;
|
85 | }
|