UNPKG

5.22 kBTypeScriptView Raw
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 */
8import { StaticSymbol, StaticSymbolCache } from './aot/static_symbol';
9import * as cpl from './compile_metadata';
10import { CompileReflector } from './compile_reflector';
11import { CompilerConfig } from './config';
12import { Directive, Type } from './core';
13import { DirectiveNormalizer } from './directive_normalizer';
14import { DirectiveResolver } from './directive_resolver';
15import { HtmlParser } from './ml_parser/html_parser';
16import { NgModuleResolver } from './ng_module_resolver';
17import { PipeResolver } from './pipe_resolver';
18import { ElementSchemaRegistry } from './schema/element_schema_registry';
19import { SummaryResolver } from './summary_resolver';
20import { Console, SyncAsync } from './util';
21export declare type ErrorCollector = (error: any, type?: any) => void;
22export declare const ERROR_COMPONENT_TYPE = "ngComponentType";
23export declare class CompileMetadataResolver {
24 private _config;
25 private _htmlParser;
26 private _ngModuleResolver;
27 private _directiveResolver;
28 private _pipeResolver;
29 private _summaryResolver;
30 private _schemaRegistry;
31 private _directiveNormalizer;
32 private _console;
33 private _staticSymbolCache;
34 private _reflector;
35 private _errorCollector?;
36 private _nonNormalizedDirectiveCache;
37 private _directiveCache;
38 private _summaryCache;
39 private _pipeCache;
40 private _ngModuleCache;
41 private _ngModuleOfTypes;
42 private _shallowModuleCache;
43 constructor(_config: CompilerConfig, _htmlParser: HtmlParser, _ngModuleResolver: NgModuleResolver, _directiveResolver: DirectiveResolver, _pipeResolver: PipeResolver, _summaryResolver: SummaryResolver<any>, _schemaRegistry: ElementSchemaRegistry, _directiveNormalizer: DirectiveNormalizer, _console: Console, _staticSymbolCache: StaticSymbolCache, _reflector: CompileReflector, _errorCollector?: ErrorCollector | undefined);
44 getReflector(): CompileReflector;
45 clearCacheFor(type: Type): void;
46 clearCache(): void;
47 private _createProxyClass;
48 private getGeneratedClass;
49 private getComponentViewClass;
50 getHostComponentViewClass(dirType: any): StaticSymbol | cpl.ProxyClass;
51 getHostComponentType(dirType: any): StaticSymbol | cpl.ProxyClass;
52 private getRendererType;
53 private getComponentFactory;
54 private initComponentFactory;
55 private _loadSummary;
56 getHostComponentMetadata(compMeta: cpl.CompileDirectiveMetadata, hostViewType?: StaticSymbol | cpl.ProxyClass): cpl.CompileDirectiveMetadata;
57 loadDirectiveMetadata(ngModuleType: any, directiveType: any, isSync: boolean): SyncAsync<null>;
58 getNonNormalizedDirectiveMetadata(directiveType: any): {
59 annotation: Directive;
60 metadata: cpl.CompileDirectiveMetadata;
61 } | null;
62 /**
63 * Gets the metadata for the given directive.
64 * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
65 */
66 getDirectiveMetadata(directiveType: any): cpl.CompileDirectiveMetadata;
67 getDirectiveSummary(dirType: any): cpl.CompileDirectiveSummary;
68 isDirective(type: any): boolean;
69 isAbstractDirective(type: any): boolean;
70 isPipe(type: any): boolean;
71 isNgModule(type: any): boolean;
72 getNgModuleSummary(moduleType: any, alreadyCollecting?: Set<any> | null): cpl.CompileNgModuleSummary | null;
73 /**
74 * Loads the declared directives and pipes of an NgModule.
75 */
76 loadNgModuleDirectiveAndPipeMetadata(moduleType: any, isSync: boolean, throwIfNotFound?: boolean): Promise<any>;
77 getShallowModuleMetadata(moduleType: any): cpl.CompileShallowModuleMetadata | null;
78 getNgModuleMetadata(moduleType: any, throwIfNotFound?: boolean, alreadyCollecting?: Set<any> | null): cpl.CompileNgModuleMetadata | null;
79 private _checkSelfImport;
80 private _getTypeDescriptor;
81 private _addTypeToModule;
82 private _getTransitiveNgModuleMetadata;
83 private _getIdentifierMetadata;
84 isInjectable(type: any): boolean;
85 getInjectableSummary(type: any): cpl.CompileTypeSummary;
86 getInjectableMetadata(type: any, dependencies?: any[] | null, throwOnUnknownDeps?: boolean): cpl.CompileInjectableMetadata | null;
87 private _getTypeMetadata;
88 private _getFactoryMetadata;
89 /**
90 * Gets the metadata for the given pipe.
91 * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
92 */
93 getPipeMetadata(pipeType: any): cpl.CompilePipeMetadata | null;
94 getPipeSummary(pipeType: any): cpl.CompilePipeSummary;
95 getOrLoadPipeMetadata(pipeType: any): cpl.CompilePipeMetadata;
96 private _loadPipeMetadata;
97 private _getDependenciesMetadata;
98 private _getTokenMetadata;
99 private _getProvidersMetadata;
100 private _validateProvider;
101 private _getEntryComponentsFromProvider;
102 private _getEntryComponentMetadata;
103 private _getInjectableTypeMetadata;
104 getProviderMetadata(provider: cpl.ProviderMeta): cpl.CompileProviderMetadata;
105 private _getQueriesMetadata;
106 private _queryVarBindings;
107 private _getQueryMetadata;
108 private _reportError;
109}