[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC 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 { CompileInjectableMetadata, CompileNgModuleMetadata, CompileShallowModuleMetadata } from '../compile_metadata';
|
---|
| 9 | import { CompilerConfig } from '../config';
|
---|
| 10 | import { MessageBundle } from '../i18n/message_bundle';
|
---|
| 11 | import { InjectableCompiler } from '../injectable_compiler';
|
---|
| 12 | import { CompileMetadataResolver } from '../metadata_resolver';
|
---|
| 13 | import { NgModuleCompiler } from '../ng_module_compiler';
|
---|
| 14 | import { OutputEmitter } from '../output/abstract_emitter';
|
---|
| 15 | import { StyleCompiler } from '../style_compiler';
|
---|
| 16 | import { SummaryResolver } from '../summary_resolver';
|
---|
| 17 | import { TemplateParser } from '../template_parser/template_parser';
|
---|
| 18 | import { TypeCheckCompiler } from '../view_compiler/type_check_compiler';
|
---|
| 19 | import { ViewCompiler } from '../view_compiler/view_compiler';
|
---|
| 20 | import { AotCompilerHost } from './compiler_host';
|
---|
| 21 | import { AotCompilerOptions } from './compiler_options';
|
---|
| 22 | import { GeneratedFile } from './generated_file';
|
---|
| 23 | import { LazyRoute } from './lazy_routes';
|
---|
| 24 | import { PartialModule } from './partial_module';
|
---|
| 25 | import { StaticReflector } from './static_reflector';
|
---|
| 26 | import { StaticSymbol } from './static_symbol';
|
---|
| 27 | import { StaticSymbolResolver } from './static_symbol_resolver';
|
---|
| 28 | export declare class AotCompiler {
|
---|
| 29 | private _config;
|
---|
| 30 | private _options;
|
---|
| 31 | private _host;
|
---|
| 32 | readonly reflector: StaticReflector;
|
---|
| 33 | private _metadataResolver;
|
---|
| 34 | private _templateParser;
|
---|
| 35 | private _styleCompiler;
|
---|
| 36 | private _viewCompiler;
|
---|
| 37 | private _typeCheckCompiler;
|
---|
| 38 | private _ngModuleCompiler;
|
---|
| 39 | private _injectableCompiler;
|
---|
| 40 | private _outputEmitter;
|
---|
| 41 | private _summaryResolver;
|
---|
| 42 | private _symbolResolver;
|
---|
| 43 | private _templateAstCache;
|
---|
| 44 | private _analyzedFiles;
|
---|
| 45 | private _analyzedFilesForInjectables;
|
---|
| 46 | constructor(_config: CompilerConfig, _options: AotCompilerOptions, _host: AotCompilerHost, reflector: StaticReflector, _metadataResolver: CompileMetadataResolver, _templateParser: TemplateParser, _styleCompiler: StyleCompiler, _viewCompiler: ViewCompiler, _typeCheckCompiler: TypeCheckCompiler, _ngModuleCompiler: NgModuleCompiler, _injectableCompiler: InjectableCompiler, _outputEmitter: OutputEmitter, _summaryResolver: SummaryResolver<StaticSymbol>, _symbolResolver: StaticSymbolResolver);
|
---|
| 47 | clearCache(): void;
|
---|
| 48 | analyzeModulesSync(rootFiles: string[]): NgAnalyzedModules;
|
---|
| 49 | analyzeModulesAsync(rootFiles: string[]): Promise<NgAnalyzedModules>;
|
---|
| 50 | private _analyzeFile;
|
---|
| 51 | private _analyzeFileForInjectables;
|
---|
| 52 | findGeneratedFileNames(fileName: string): string[];
|
---|
| 53 | emitBasicStub(genFileName: string, originalFileName?: string): GeneratedFile;
|
---|
| 54 | emitTypeCheckStub(genFileName: string, originalFileName: string): GeneratedFile | null;
|
---|
| 55 | loadFilesAsync(fileNames: string[], tsFiles: string[]): Promise<{
|
---|
| 56 | analyzedModules: NgAnalyzedModules;
|
---|
| 57 | analyzedInjectables: NgAnalyzedFileWithInjectables[];
|
---|
| 58 | }>;
|
---|
| 59 | loadFilesSync(fileNames: string[], tsFiles: string[]): {
|
---|
| 60 | analyzedModules: NgAnalyzedModules;
|
---|
| 61 | analyzedInjectables: NgAnalyzedFileWithInjectables[];
|
---|
| 62 | };
|
---|
| 63 | private _createNgFactoryStub;
|
---|
| 64 | private _externalIdentifierReferences;
|
---|
| 65 | private _createTypeCheckBlock;
|
---|
| 66 | emitMessageBundle(analyzeResult: NgAnalyzedModules, locale: string | null): MessageBundle;
|
---|
| 67 | emitAllPartialModules2(files: NgAnalyzedFileWithInjectables[]): PartialModule[];
|
---|
| 68 | private _emitPartialModule2;
|
---|
| 69 | emitAllImpls(analyzeResult: NgAnalyzedModules): GeneratedFile[];
|
---|
| 70 | private _compileImplFile;
|
---|
| 71 | private _createSummary;
|
---|
| 72 | private _compileModule;
|
---|
| 73 | private _compileComponentFactory;
|
---|
| 74 | private _compileComponent;
|
---|
| 75 | private _parseTemplate;
|
---|
| 76 | private _createOutputContext;
|
---|
| 77 | private _fileNameToModuleName;
|
---|
| 78 | private _codegenStyles;
|
---|
| 79 | private _codegenSourceModule;
|
---|
| 80 | listLazyRoutes(entryRoute?: string, analyzedModules?: NgAnalyzedModules): LazyRoute[];
|
---|
| 81 | }
|
---|
| 82 | export interface NgAnalyzedModules {
|
---|
| 83 | ngModules: CompileNgModuleMetadata[];
|
---|
| 84 | ngModuleByPipeOrDirective: Map<StaticSymbol, CompileNgModuleMetadata>;
|
---|
| 85 | files: NgAnalyzedFile[];
|
---|
| 86 | symbolsMissingModule?: StaticSymbol[];
|
---|
| 87 | }
|
---|
| 88 | export interface NgAnalyzedFileWithInjectables {
|
---|
| 89 | fileName: string;
|
---|
| 90 | injectables: CompileInjectableMetadata[];
|
---|
| 91 | shallowModules: CompileShallowModuleMetadata[];
|
---|
| 92 | }
|
---|
| 93 | export interface NgAnalyzedFile {
|
---|
| 94 | fileName: string;
|
---|
| 95 | directives: StaticSymbol[];
|
---|
| 96 | abstractDirectives: StaticSymbol[];
|
---|
| 97 | pipes: StaticSymbol[];
|
---|
| 98 | ngModules: CompileNgModuleMetadata[];
|
---|
| 99 | injectables: CompileInjectableMetadata[];
|
---|
| 100 | exportsNonSourceFiles: boolean;
|
---|
| 101 | }
|
---|
| 102 | export interface NgAnalyzeModulesHost {
|
---|
| 103 | isSourceFile(filePath: string): boolean;
|
---|
| 104 | }
|
---|
| 105 | export declare function analyzeNgModules(fileNames: string[], host: NgAnalyzeModulesHost, staticSymbolResolver: StaticSymbolResolver, metadataResolver: CompileMetadataResolver): NgAnalyzedModules;
|
---|
| 106 | export declare function analyzeAndValidateNgModules(fileNames: string[], host: NgAnalyzeModulesHost, staticSymbolResolver: StaticSymbolResolver, metadataResolver: CompileMetadataResolver): NgAnalyzedModules;
|
---|
| 107 | export declare function analyzeFile(host: NgAnalyzeModulesHost, staticSymbolResolver: StaticSymbolResolver, metadataResolver: CompileMetadataResolver, fileName: string): NgAnalyzedFile;
|
---|
| 108 | export declare function analyzeFileForInjectables(host: NgAnalyzeModulesHost, staticSymbolResolver: StaticSymbolResolver, metadataResolver: CompileMetadataResolver, fileName: string): NgAnalyzedFileWithInjectables;
|
---|
| 109 | export declare function mergeAnalyzedFiles(analyzedFiles: NgAnalyzedFile[]): NgAnalyzedModules;
|
---|