1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { CompileNgModuleMetadata } from '../compile_metadata';
|
9
|
import { CompilerConfig } from '../config';
|
10
|
import { CompileMetadataResolver } from '../metadata_resolver';
|
11
|
import { NgModuleCompiler } from '../ng_module_compiler';
|
12
|
import { OutputEmitter } from '../output/abstract_emitter';
|
13
|
import { StyleCompiler } from '../style_compiler';
|
14
|
import { SummaryResolver } from '../summary_resolver';
|
15
|
import { TemplateParser } from '../template_parser/template_parser';
|
16
|
import { ViewCompiler } from '../view_compiler/view_compiler';
|
17
|
import { AotCompilerHost } from './compiler_host';
|
18
|
import { GeneratedFile } from './generated_file';
|
19
|
import { StaticReflector } from './static_reflector';
|
20
|
import { StaticSymbol } from './static_symbol';
|
21
|
import { StaticSymbolResolver } from './static_symbol_resolver';
|
22
|
export declare class AotCompiler {
|
23
|
private _config;
|
24
|
private _host;
|
25
|
private _reflector;
|
26
|
private _metadataResolver;
|
27
|
private _templateParser;
|
28
|
private _styleCompiler;
|
29
|
private _viewCompiler;
|
30
|
private _ngModuleCompiler;
|
31
|
private _outputEmitter;
|
32
|
private _summaryResolver;
|
33
|
private _localeId;
|
34
|
private _translationFormat;
|
35
|
private _enableSummariesForJit;
|
36
|
private _symbolResolver;
|
37
|
constructor(_config: CompilerConfig, _host: AotCompilerHost, _reflector: StaticReflector, _metadataResolver: CompileMetadataResolver, _templateParser: TemplateParser, _styleCompiler: StyleCompiler, _viewCompiler: ViewCompiler, _ngModuleCompiler: NgModuleCompiler, _outputEmitter: OutputEmitter, _summaryResolver: SummaryResolver<StaticSymbol>, _localeId: string | null, _translationFormat: string | null, _enableSummariesForJit: boolean | null, _symbolResolver: StaticSymbolResolver);
|
38
|
clearCache(): void;
|
39
|
analyzeModulesSync(rootFiles: string[]): NgAnalyzedModules;
|
40
|
analyzeModulesAsync(rootFiles: string[]): Promise<NgAnalyzedModules>;
|
41
|
emitAllStubs(analyzeResult: NgAnalyzedModules): GeneratedFile[];
|
42
|
emitPartialStubs(analyzeResult: NgAnalyzedModules): GeneratedFile[];
|
43
|
emitAllImpls(analyzeResult: NgAnalyzedModules): GeneratedFile[];
|
44
|
private _compileStubFile(srcFileUrl, directives, pipes, ngModules, partial);
|
45
|
private _compileImplFile(srcFileUrl, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables);
|
46
|
private _createSummary(srcFileUrl, directives, pipes, ngModules, injectables, ngFactoryCtx);
|
47
|
private _compileModule(outputCtx, ngModuleType);
|
48
|
private _compileComponentFactory(outputCtx, compMeta, ngModule, fileSuffix);
|
49
|
private _compileComponent(outputCtx, compMeta, ngModule, directiveIdentifiers, componentStyles, fileSuffix);
|
50
|
private _createOutputContext(genFilePath);
|
51
|
private _codegenStyles(srcFileUrl, compMeta, stylesheetMetadata, fileSuffix);
|
52
|
private _codegenSourceModule(srcFileUrl, ctx);
|
53
|
}
|
54
|
export interface NgAnalyzedModules {
|
55
|
ngModules: CompileNgModuleMetadata[];
|
56
|
ngModuleByPipeOrDirective: Map<StaticSymbol, CompileNgModuleMetadata>;
|
57
|
files: Array<{
|
58
|
srcUrl: string;
|
59
|
directives: StaticSymbol[];
|
60
|
pipes: StaticSymbol[];
|
61
|
ngModules: StaticSymbol[];
|
62
|
injectables: StaticSymbol[];
|
63
|
}>;
|
64
|
symbolsMissingModule?: StaticSymbol[];
|
65
|
}
|
66
|
export interface NgAnalyzeModulesHost {
|
67
|
isSourceFile(filePath: string): boolean;
|
68
|
}
|
69
|
export declare function analyzeNgModules(programStaticSymbols: StaticSymbol[], host: NgAnalyzeModulesHost, metadataResolver: CompileMetadataResolver): NgAnalyzedModules;
|
70
|
export declare function analyzeAndValidateNgModules(programStaticSymbols: StaticSymbol[], host: NgAnalyzeModulesHost, metadataResolver: CompileMetadataResolver): NgAnalyzedModules;
|
71
|
export declare function extractProgramSymbols(staticSymbolResolver: StaticSymbolResolver, files: string[], host: NgAnalyzeModulesHost): StaticSymbol[];
|