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 { Compiler, ComponentFactory, Injector, ModuleWithComponentFactories, NgModuleFactory, Type, ɵConsole as Console } from '@angular/core';
|
9
|
import { CompilerConfig } from '../config';
|
10
|
import { CompileMetadataResolver } from '../metadata_resolver';
|
11
|
import { NgModuleCompiler } from '../ng_module_compiler';
|
12
|
import { StyleCompiler } from '../style_compiler';
|
13
|
import { SummaryResolver } from '../summary_resolver';
|
14
|
import { TemplateParser } from '../template_parser/template_parser';
|
15
|
import { ViewCompiler } from '../view_compiler/view_compiler';
|
16
|
/**
|
17
|
* An internal module of the Angular compiler that begins with component types,
|
18
|
* extracts templates, and eventually produces a compiled version of the component
|
19
|
* ready for linking into an application.
|
20
|
*
|
21
|
* @security When compiling templates at runtime, you must ensure that the entire template comes
|
22
|
* from a trusted source. Attacker-controlled data introduced by a template could expose your
|
23
|
* application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
|
24
|
*/
|
25
|
export declare class JitCompiler implements Compiler {
|
26
|
private _injector;
|
27
|
private _metadataResolver;
|
28
|
private _templateParser;
|
29
|
private _styleCompiler;
|
30
|
private _viewCompiler;
|
31
|
private _ngModuleCompiler;
|
32
|
private _summaryResolver;
|
33
|
private _compilerConfig;
|
34
|
private _console;
|
35
|
private _compiledTemplateCache;
|
36
|
private _compiledHostTemplateCache;
|
37
|
private _compiledDirectiveWrapperCache;
|
38
|
private _compiledNgModuleCache;
|
39
|
private _sharedStylesheetCount;
|
40
|
constructor(_injector: Injector, _metadataResolver: CompileMetadataResolver, _templateParser: TemplateParser, _styleCompiler: StyleCompiler, _viewCompiler: ViewCompiler, _ngModuleCompiler: NgModuleCompiler, _summaryResolver: SummaryResolver<Type<any>>, _compilerConfig: CompilerConfig, _console: Console);
|
41
|
readonly injector: Injector;
|
42
|
compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T>;
|
43
|
compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>>;
|
44
|
compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T>;
|
45
|
compileModuleAndAllComponentsAsync<T>(moduleType: Type<T>): Promise<ModuleWithComponentFactories<T>>;
|
46
|
getNgContentSelectors(component: Type<any>): string[];
|
47
|
getComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
|
48
|
loadAotSummaries(summaries: () => any[]): void;
|
49
|
hasAotSummary(ref: Type<any>): boolean;
|
50
|
private _filterJitIdentifiers(ids);
|
51
|
private _compileModuleAndComponents<T>(moduleType, isSync);
|
52
|
private _compileModuleAndAllComponents<T>(moduleType, isSync);
|
53
|
private _loadModules(mainModule, isSync);
|
54
|
private _compileModule<T>(moduleType);
|
55
|
clearCacheFor(type: Type<any>): void;
|
56
|
clearCache(): void;
|
57
|
private _createCompiledHostTemplate(compType, ngModule);
|
58
|
private _createCompiledTemplate(compMeta, ngModule);
|
59
|
private _compileTemplate(template);
|
60
|
private _resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);
|
61
|
private _resolveAndEvalStylesCompileResult(result, externalStylesheetsByModuleUrl);
|
62
|
}
|