@angular/compiler-cli 15.0.0-next.4 → 15.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-RCXOJZDO.js → chunk-2HPI44CB.js} +5 -5
- package/bundles/{chunk-RCXOJZDO.js.map → chunk-2HPI44CB.js.map} +0 -0
- package/bundles/{chunk-TC3DKEFP.js → chunk-2LFNJ4YC.js} +196 -140
- package/bundles/chunk-2LFNJ4YC.js.map +6 -0
- package/bundles/{chunk-56O2PTWU.js → chunk-CYVTLM4Z.js} +7 -7
- package/bundles/{chunk-56O2PTWU.js.map → chunk-CYVTLM4Z.js.map} +0 -0
- package/bundles/{chunk-5FZBUSFV.js → chunk-E7NQQTT7.js} +3 -3
- package/bundles/{chunk-5FZBUSFV.js.map → chunk-E7NQQTT7.js.map} +0 -0
- package/bundles/{chunk-FPKAMI6D.js → chunk-EQ7NIVSK.js} +27 -26
- package/bundles/chunk-EQ7NIVSK.js.map +6 -0
- package/bundles/{chunk-DM4TYSFG.js → chunk-F526PAOI.js} +2 -5
- package/bundles/chunk-F526PAOI.js.map +6 -0
- package/bundles/{chunk-ICPLY7FO.js → chunk-FM6NPN5V.js} +4 -4
- package/bundles/{chunk-ICPLY7FO.js.map → chunk-FM6NPN5V.js.map} +0 -0
- package/bundles/{chunk-JN4TT3OU.js → chunk-GQT3DC2W.js} +7 -7
- package/bundles/{chunk-JN4TT3OU.js.map → chunk-GQT3DC2W.js.map} +0 -0
- package/bundles/{chunk-ERNK3SQG.js → chunk-JH56H6IJ.js} +31 -31
- package/bundles/{chunk-ERNK3SQG.js.map → chunk-JH56H6IJ.js.map} +0 -0
- package/bundles/{chunk-V7FBNIO3.js → chunk-MYEONJ6Z.js} +40 -40
- package/bundles/{chunk-V7FBNIO3.js.map → chunk-MYEONJ6Z.js.map} +0 -0
- package/bundles/{chunk-JTAGML7U.js → chunk-OZI3NCRJ.js} +75 -75
- package/bundles/{chunk-JTAGML7U.js.map → chunk-OZI3NCRJ.js.map} +1 -1
- package/bundles/{chunk-HMWNYAAE.js → chunk-R3C7RFJ4.js} +2 -2
- package/bundles/{chunk-HMWNYAAE.js.map → chunk-R3C7RFJ4.js.map} +0 -0
- package/bundles/{chunk-A5S5H2MN.js → chunk-R4GD76QD.js} +855 -783
- package/bundles/chunk-R4GD76QD.js.map +6 -0
- package/bundles/{chunk-4NRCP3Y6.js → chunk-TOKOIIBI.js} +7 -7
- package/bundles/{chunk-4NRCP3Y6.js.map → chunk-TOKOIIBI.js.map} +0 -0
- package/bundles/{chunk-C7SYDZNO.js → chunk-XOVG7LXX.js} +5 -5
- package/bundles/{chunk-C7SYDZNO.js.map → chunk-XOVG7LXX.js.map} +0 -0
- package/bundles/{chunk-MOE5WKIA.js → chunk-ZXBCBXWY.js} +7 -7
- package/bundles/{chunk-MOE5WKIA.js.map → chunk-ZXBCBXWY.js.map} +0 -0
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +13 -13
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +13 -13
- package/bundles/ngcc/main-ngcc.js +14 -14
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -14
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +11 -11
- package/bundles/src/bin/ngc.js +9 -9
- package/bundles_metadata.json +1 -1
- package/ngcc/src/analysis/decoration_analyzer.d.ts +2 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +4 -4
- package/src/ngtsc/annotations/common/index.d.ts +1 -0
- package/src/ngtsc/annotations/common/src/diagnostics.d.ts +11 -3
- package/src/ngtsc/annotations/common/src/injectable_registry.d.ts +25 -0
- package/src/ngtsc/annotations/common/src/util.d.ts +1 -0
- package/src/ngtsc/annotations/component/src/handler.d.ts +4 -3
- package/src/ngtsc/annotations/directive/src/handler.d.ts +4 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +2 -2
- package/src/ngtsc/annotations/src/injectable.d.ts +7 -4
- package/src/ngtsc/annotations/src/pipe.d.ts +2 -1
- package/src/ngtsc/core/src/host.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +5 -0
- package/src/ngtsc/metadata/index.d.ts +2 -2
- package/src/ngtsc/metadata/src/api.d.ts +6 -0
- package/src/ngtsc/metadata/src/registry.d.ts +4 -14
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +1 -0
- package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -9
- package/src/ngtsc/typecheck/api/checker.d.ts +11 -6
- package/src/ngtsc/typecheck/api/scope.d.ts +30 -4
- package/src/ngtsc/typecheck/api/symbols.d.ts +2 -2
- package/src/ngtsc/typecheck/src/checker.d.ts +9 -6
- package/bundles/chunk-A5S5H2MN.js.map +0 -6
- package/bundles/chunk-DM4TYSFG.js.map +0 -6
- package/bundles/chunk-FPKAMI6D.js.map +0 -6
- package/bundles/chunk-TC3DKEFP.js.map +0 -6
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import ts from 'typescript';
|
|
3
3
|
import { ParsedConfiguration } from '../../..';
|
|
4
4
|
import { ReferencesRegistry, ResourceLoader } from '../../../src/ngtsc/annotations';
|
|
5
|
+
import { InjectableClassRegistry } from '../../../src/ngtsc/annotations/common';
|
|
5
6
|
import { CycleAnalyzer, ImportGraph } from '../../../src/ngtsc/cycles';
|
|
6
7
|
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
7
8
|
import { ModuleResolver, PrivateExportAliasingHost, ReferenceEmitter } from '../../../src/ngtsc/imports';
|
|
8
9
|
import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
|
|
9
|
-
import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, HostDirectivesResolver,
|
|
10
|
+
import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, HostDirectivesResolver, LocalMetadataRegistry } from '../../../src/ngtsc/metadata';
|
|
10
11
|
import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
|
|
11
12
|
import { LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver, TypeCheckScopeRegistry } from '../../../src/ngtsc/scope';
|
|
12
13
|
import { DecoratorHandler } from '../../../src/ngtsc/transform';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
|
|
10
10
|
import { PackageJsonUpdater } from '../writing/package_json_updater';
|
|
11
11
|
import { EntryPointPackageJson, PackageJsonFormatProperties } from './entry_point';
|
|
12
|
-
export declare const NGCC_VERSION = "15.0.0-next.
|
|
12
|
+
export declare const NGCC_VERSION = "15.0.0-next.6";
|
|
13
13
|
/**
|
|
14
14
|
* Returns true if there is a format in this entry-point that was compiled with an outdated version
|
|
15
15
|
* of ngcc.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "15.0.0-next.
|
|
3
|
+
"version": "15.0.0-next.6",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"yargs": "^17.2.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@angular/compiler": "15.0.0-next.
|
|
69
|
-
"typescript": ">=4.
|
|
68
|
+
"@angular/compiler": "15.0.0-next.6",
|
|
69
|
+
"typescript": ">=4.8.2 <4.9"
|
|
70
70
|
},
|
|
71
71
|
"repository": {
|
|
72
72
|
"type": "git",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
],
|
|
80
80
|
"license": "MIT",
|
|
81
81
|
"engines": {
|
|
82
|
-
"node": "^14.
|
|
82
|
+
"node": "^14.20.0 || ^16.13.0 || >=18.10.0"
|
|
83
83
|
},
|
|
84
84
|
"bugs": {
|
|
85
85
|
"url": "https://github.com/angular/angular/issues"
|
|
@@ -11,6 +11,7 @@ export * from './src/di';
|
|
|
11
11
|
export * from './src/diagnostics';
|
|
12
12
|
export * from './src/evaluation';
|
|
13
13
|
export * from './src/factory';
|
|
14
|
+
export * from './src/injectable_registry';
|
|
14
15
|
export * from './src/metadata';
|
|
15
16
|
export * from './src/references_registry';
|
|
16
17
|
export * from './src/schema';
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { FatalDiagnosticError } from '../../../diagnostics';
|
|
11
11
|
import { Reference } from '../../../imports';
|
|
12
|
-
import { HostDirectiveMeta,
|
|
12
|
+
import { HostDirectiveMeta, MetadataReader } from '../../../metadata';
|
|
13
13
|
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
|
|
14
14
|
import { ClassDeclaration, ReflectionHost } from '../../../reflection';
|
|
15
15
|
import { DeclarationData, LocalModuleScopeRegistry } from '../../../scope';
|
|
16
|
+
import { InjectableClassRegistry } from './injectable_registry';
|
|
16
17
|
/**
|
|
17
18
|
* Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
|
|
18
19
|
* more NgModules.
|
|
@@ -39,7 +40,14 @@ export declare function createValueHasWrongTypeError(node: ts.Node, value: Resol
|
|
|
39
40
|
* @param registry Registry that keeps track of the registered injectable classes.
|
|
40
41
|
*/
|
|
41
42
|
export declare function getProviderDiagnostics(providerClasses: Set<Reference<ClassDeclaration>>, providersDeclaration: ts.Expression, registry: InjectableClassRegistry): ts.Diagnostic[];
|
|
42
|
-
export declare function getDirectiveDiagnostics(node: ClassDeclaration,
|
|
43
|
+
export declare function getDirectiveDiagnostics(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, evaluator: PartialEvaluator, reflector: ReflectionHost, scopeRegistry: LocalModuleScopeRegistry, strictInjectionParameters: boolean, kind: 'Directive' | 'Component'): ts.Diagnostic[] | null;
|
|
43
44
|
export declare function validateHostDirectives(origin: ts.Expression, hostDirectives: HostDirectiveMeta[], metaReader: MetadataReader): ts.DiagnosticWithLocation[];
|
|
44
45
|
export declare function getUndecoratedClassWithAngularFeaturesDiagnostic(node: ClassDeclaration): ts.Diagnostic;
|
|
45
|
-
export declare function
|
|
46
|
+
export declare function checkInheritanceOfInjectable(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, reflector: ReflectionHost, evaluator: PartialEvaluator, strictInjectionParameters: boolean, kind: 'Directive' | 'Component' | 'Pipe' | 'Injectable'): ts.Diagnostic | null;
|
|
47
|
+
interface ClassWithCtor {
|
|
48
|
+
ref: Reference<ClassDeclaration>;
|
|
49
|
+
isCtorValid: boolean;
|
|
50
|
+
isDecorated: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function findInheritedCtor(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, reflector: ReflectionHost, evaluator: PartialEvaluator): ClassWithCtor | null;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/injectable_registry" />
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
import { R3DependencyMetadata } from '@angular/compiler';
|
|
10
|
+
import { ClassDeclaration, ReflectionHost } from '../../../reflection';
|
|
11
|
+
export interface InjectableMeta {
|
|
12
|
+
ctorDeps: R3DependencyMetadata[] | 'invalid' | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Registry that keeps track of classes that can be constructed via dependency injection (e.g.
|
|
16
|
+
* injectables, directives, pipes).
|
|
17
|
+
*/
|
|
18
|
+
export declare class InjectableClassRegistry {
|
|
19
|
+
private host;
|
|
20
|
+
private isCore;
|
|
21
|
+
private classes;
|
|
22
|
+
constructor(host: ReflectionHost, isCore: boolean);
|
|
23
|
+
registerInjectable(declaration: ClassDeclaration, meta: InjectableMeta): void;
|
|
24
|
+
getInjectableMeta(declaration: ClassDeclaration): InjectableMeta | null;
|
|
25
|
+
}
|
|
@@ -100,3 +100,4 @@ export declare function resolveImportedFile(moduleResolver: ModuleResolver, impo
|
|
|
100
100
|
* used.
|
|
101
101
|
*/
|
|
102
102
|
export declare function getOriginNodeForDiagnostics(expr: ts.Expression, container: ts.Expression): ts.Expression;
|
|
103
|
+
export declare function isAbstractClassDeclaration(clazz: ClassDeclaration): boolean;
|
|
@@ -13,7 +13,7 @@ import { ModuleResolver, ReferenceEmitter } from '../../../imports';
|
|
|
13
13
|
import { DependencyTracker } from '../../../incremental/api';
|
|
14
14
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
15
15
|
import { IndexingContext } from '../../../indexer';
|
|
16
|
-
import { HostDirectivesResolver,
|
|
16
|
+
import { HostDirectivesResolver, MetadataReader, MetadataRegistry, ResourceRegistry } from '../../../metadata';
|
|
17
17
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
18
18
|
import { PerfRecorder } from '../../../perf';
|
|
19
19
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
@@ -22,7 +22,7 @@ import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerF
|
|
|
22
22
|
import { TypeCheckContext } from '../../../typecheck/api';
|
|
23
23
|
import { ExtendedTemplateChecker } from '../../../typecheck/extended/api';
|
|
24
24
|
import { Xi18nContext } from '../../../xi18n';
|
|
25
|
-
import { ResourceLoader } from '../../common';
|
|
25
|
+
import { InjectableClassRegistry, ResourceLoader } from '../../common';
|
|
26
26
|
import { ComponentAnalysisData, ComponentResolutionData } from './metadata';
|
|
27
27
|
import { ComponentSymbol } from './symbol';
|
|
28
28
|
/**
|
|
@@ -39,6 +39,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
39
39
|
private typeCheckScopeRegistry;
|
|
40
40
|
private resourceRegistry;
|
|
41
41
|
private isCore;
|
|
42
|
+
private strictCtorDeps;
|
|
42
43
|
private resourceLoader;
|
|
43
44
|
private rootDirs;
|
|
44
45
|
private defaultPreserveWhitespaces;
|
|
@@ -56,7 +57,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
56
57
|
private annotateForClosureCompiler;
|
|
57
58
|
private perf;
|
|
58
59
|
private hostDirectivesResolver;
|
|
59
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver);
|
|
60
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver);
|
|
60
61
|
private literalCache;
|
|
61
62
|
private elementSchemaRegistry;
|
|
62
63
|
/**
|
|
@@ -10,12 +10,13 @@ import { ConstantPool, R3ClassMetadata, R3DirectiveMetadata } from '@angular/com
|
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
12
12
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
13
|
-
import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta,
|
|
13
|
+
import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
14
14
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
15
15
|
import { PerfRecorder } from '../../../perf';
|
|
16
16
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
17
17
|
import { LocalModuleScopeRegistry } from '../../../scope';
|
|
18
18
|
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFlags, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
19
|
+
import { InjectableClassRegistry } from '../../common';
|
|
19
20
|
import { DirectiveSymbol } from './symbol';
|
|
20
21
|
export interface DirectiveHandlerData {
|
|
21
22
|
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
|
|
@@ -40,11 +41,12 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
|
|
|
40
41
|
private injectableRegistry;
|
|
41
42
|
private refEmitter;
|
|
42
43
|
private isCore;
|
|
44
|
+
private strictCtorDeps;
|
|
43
45
|
private semanticDepGraphUpdater;
|
|
44
46
|
private annotateForClosureCompiler;
|
|
45
47
|
private compileUndecoratedClassesWithAngularFeatures;
|
|
46
48
|
private perf;
|
|
47
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, isCore: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, compileUndecoratedClassesWithAngularFeatures: boolean, perf: PerfRecorder);
|
|
49
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, compileUndecoratedClassesWithAngularFeatures: boolean, perf: PerfRecorder);
|
|
48
50
|
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
49
51
|
readonly name: string;
|
|
50
52
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
@@ -10,14 +10,14 @@ import { Expression, R3ClassMetadata, R3FactoryMetadata, R3InjectorMetadata, R3N
|
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
12
12
|
import { SemanticReference, SemanticSymbol } from '../../../incremental/semantic_graph';
|
|
13
|
-
import {
|
|
13
|
+
import { MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
14
14
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
15
15
|
import { PerfRecorder } from '../../../perf';
|
|
16
16
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
17
17
|
import { LocalModuleScopeRegistry } from '../../../scope';
|
|
18
18
|
import { FactoryTracker } from '../../../shims/api';
|
|
19
19
|
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
20
|
-
import { ReferencesRegistry } from '../../common';
|
|
20
|
+
import { InjectableClassRegistry, ReferencesRegistry } from '../../common';
|
|
21
21
|
export interface NgModuleAnalysis {
|
|
22
22
|
mod: R3NgModuleMetadata;
|
|
23
23
|
inj: Omit<R3InjectorMetadata, 'imports'>;
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/injectable" />
|
|
9
9
|
import { R3ClassMetadata, R3DependencyMetadata, R3InjectableMetadata } from '@angular/compiler';
|
|
10
|
-
import { InjectableClassRegistry } from '../../
|
|
10
|
+
import { InjectableClassRegistry } from '../../annotations/common';
|
|
11
|
+
import { PartialEvaluator } from '../../partial_evaluator';
|
|
11
12
|
import { PerfRecorder } from '../../perf';
|
|
12
13
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../reflection';
|
|
13
|
-
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence } from '../../transform';
|
|
14
|
+
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
|
|
14
15
|
export interface InjectableHandlerData {
|
|
15
16
|
meta: R3InjectableMetadata;
|
|
16
17
|
classMetadata: R3ClassMetadata | null;
|
|
@@ -22,6 +23,7 @@ export interface InjectableHandlerData {
|
|
|
22
23
|
*/
|
|
23
24
|
export declare class InjectableDecoratorHandler implements DecoratorHandler<Decorator, InjectableHandlerData, null, unknown> {
|
|
24
25
|
private reflector;
|
|
26
|
+
private evaluator;
|
|
25
27
|
private isCore;
|
|
26
28
|
private strictCtorDeps;
|
|
27
29
|
private injectableRegistry;
|
|
@@ -33,7 +35,7 @@ export declare class InjectableDecoratorHandler implements DecoratorHandler<Deco
|
|
|
33
35
|
* If false then there is no error and a new ɵprov property is not added.
|
|
34
36
|
*/
|
|
35
37
|
private errorOnDuplicateProv;
|
|
36
|
-
constructor(reflector: ReflectionHost, isCore: boolean, strictCtorDeps: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder,
|
|
38
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, strictCtorDeps: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder,
|
|
37
39
|
/**
|
|
38
40
|
* What to do if the injectable already contains a ɵprov property.
|
|
39
41
|
*
|
|
@@ -46,7 +48,8 @@ export declare class InjectableDecoratorHandler implements DecoratorHandler<Deco
|
|
|
46
48
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator> | undefined;
|
|
47
49
|
analyze(node: ClassDeclaration, decorator: Readonly<Decorator>): AnalysisOutput<InjectableHandlerData>;
|
|
48
50
|
symbol(): null;
|
|
49
|
-
register(node: ClassDeclaration): void;
|
|
51
|
+
register(node: ClassDeclaration, analysis: InjectableHandlerData): void;
|
|
52
|
+
resolve(node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>, symbol: null): ResolveResult<unknown>;
|
|
50
53
|
compileFull(node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>): CompileResult[];
|
|
51
54
|
compilePartial(node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>): CompileResult[];
|
|
52
55
|
private compile;
|
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
import { R3ClassMetadata, R3PipeMetadata } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { SemanticSymbol } from '../../incremental/semantic_graph';
|
|
12
|
-
import {
|
|
12
|
+
import { MetadataRegistry } from '../../metadata';
|
|
13
13
|
import { PartialEvaluator } from '../../partial_evaluator';
|
|
14
14
|
import { PerfRecorder } from '../../perf';
|
|
15
15
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../reflection';
|
|
16
16
|
import { LocalModuleScopeRegistry } from '../../scope';
|
|
17
17
|
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../transform';
|
|
18
|
+
import { InjectableClassRegistry } from '../common';
|
|
18
19
|
export interface PipeHandlerData {
|
|
19
20
|
meta: R3PipeMetadata;
|
|
20
21
|
classMetadata: R3ClassMetadata | null;
|
|
@@ -49,6 +49,7 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
|
|
|
49
49
|
useCaseSensitiveFileNames: () => boolean;
|
|
50
50
|
writeFile: ts.WriteFileCallback;
|
|
51
51
|
getModuleResolutionCache: (() => ts.ModuleResolutionCache | undefined) | undefined;
|
|
52
|
+
hasInvalidatedResolutions: (() => string) | ((fileName: string) => string) | ((fileName: string) => boolean) | ((fileName: string) => string | undefined) | ((s: string) => void) | ((directoryName: string) => boolean) | ((path: string) => string) | ((path: string) => string[]) | ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | (() => boolean) | (() => Set<string> | undefined) | ((fileName: string) => string | Promise<string>) | ((resourceName: string, containingFilePath: string, fallbackResolve?: ((url: string, fromFile: string) => string | null) | undefined) => string | null) | ((data: string, context: import("@angular/compiler-cli/src/ngtsc/core/api/index").ResourceHostContext) => Promise<import("@angular/compiler-cli/src/ngtsc/core/api/index").TransformResourceResult | null>) | ((importedFilePath: string, containingFilePath: string) => string) | ((fileName: string, path: ts.Path, languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined) => ts.SourceFile | undefined) | (() => ts.CancellationToken) | ((options: ts.CompilerOptions) => string) | (() => string) | ts.WriteFileCallback | (() => string) | ((rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number | undefined) => string[]) | (() => ts.ModuleResolutionCache | undefined) | ((typeReferenceDirectiveNames: string[] | readonly ts.FileReference[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingFileMode?: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | ((name: string) => string | undefined) | ((data: string) => string) | ((fileName: string) => ts.ParsedCommandLine | undefined) | ((fileName: string, languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined) => ts.SourceFile | undefined) | undefined;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
55
|
* A wrapper around `ts.CompilerHost` (plus any extension methods from `ExtendedTsCompilerHost`).
|
|
@@ -71,6 +71,11 @@ export declare enum ErrorCode {
|
|
|
71
71
|
* Raised when a host directive is a component.
|
|
72
72
|
*/
|
|
73
73
|
HOST_DIRECTIVE_COMPONENT = 2015,
|
|
74
|
+
/**
|
|
75
|
+
* Raised when a type with Angular decorator inherits its constructor from a base class
|
|
76
|
+
* which has a constructor that is incompatible with Angular DI.
|
|
77
|
+
*/
|
|
78
|
+
INJECTABLE_INHERITS_INVALID_CONSTRUCTOR = 2016,
|
|
74
79
|
SYMBOL_NOT_EXPORTED = 3001,
|
|
75
80
|
/**
|
|
76
81
|
* Raised when a relationship between directives and/or pipes would cause a cyclic import to be
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export * from './src/api';
|
|
10
10
|
export { DtsMetadataReader } from './src/dts';
|
|
11
11
|
export { flattenInheritedDirectiveMetadata } from './src/inheritance';
|
|
12
|
-
export { CompoundMetadataRegistry, LocalMetadataRegistry
|
|
12
|
+
export { CompoundMetadataRegistry, LocalMetadataRegistry } from './src/registry';
|
|
13
13
|
export { ResourceRegistry, Resource, ComponentResources, isExternalResource, ExternalResource } from './src/resource_registry';
|
|
14
|
-
export { extractDirectiveTypeCheckMeta, CompoundMetadataReader } from './src/util';
|
|
14
|
+
export { extractDirectiveTypeCheckMeta, hasInjectableFields, CompoundMetadataReader } from './src/util';
|
|
15
15
|
export { BindingPropertyName, ClassPropertyMapping, ClassPropertyName, InputOrOutput } from './src/property_mapping';
|
|
16
16
|
export { HostDirectivesResolver } from './src/host_directives_resolver';
|
|
@@ -215,6 +215,12 @@ export interface MetadataReader {
|
|
|
215
215
|
getNgModuleMetadata(node: Reference<ClassDeclaration>): NgModuleMeta | null;
|
|
216
216
|
getPipeMetadata(node: Reference<ClassDeclaration>): PipeMeta | null;
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* A MetadataReader which also allows access to the set of all known directive classes.
|
|
220
|
+
*/
|
|
221
|
+
export interface MetadataReaderWithIndex extends MetadataReader {
|
|
222
|
+
getKnownDirectives(): Iterable<ClassDeclaration>;
|
|
223
|
+
}
|
|
218
224
|
/**
|
|
219
225
|
* Registers new metadata for directives, pipes, and modules.
|
|
220
226
|
*/
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/metadata/src/registry" />
|
|
9
9
|
import { Reference } from '../../imports';
|
|
10
|
-
import { ClassDeclaration
|
|
11
|
-
import { DirectiveMeta,
|
|
10
|
+
import { ClassDeclaration } from '../../reflection';
|
|
11
|
+
import { DirectiveMeta, MetadataReaderWithIndex, MetadataRegistry, NgModuleMeta, PipeMeta } from './api';
|
|
12
12
|
/**
|
|
13
13
|
* A registry of directive, pipe, and module metadata for types defined in the current compilation
|
|
14
14
|
* unit, which supports both reading and registering.
|
|
15
15
|
*/
|
|
16
|
-
export declare class LocalMetadataRegistry implements MetadataRegistry,
|
|
16
|
+
export declare class LocalMetadataRegistry implements MetadataRegistry, MetadataReaderWithIndex {
|
|
17
17
|
private directives;
|
|
18
18
|
private ngModules;
|
|
19
19
|
private pipes;
|
|
@@ -23,6 +23,7 @@ export declare class LocalMetadataRegistry implements MetadataRegistry, Metadata
|
|
|
23
23
|
registerDirectiveMetadata(meta: DirectiveMeta): void;
|
|
24
24
|
registerNgModuleMetadata(meta: NgModuleMeta): void;
|
|
25
25
|
registerPipeMetadata(meta: PipeMeta): void;
|
|
26
|
+
getKnownDirectives(): Iterable<ClassDeclaration>;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* A `MetadataRegistry` which registers metadata with multiple delegate `MetadataRegistry`
|
|
@@ -35,14 +36,3 @@ export declare class CompoundMetadataRegistry implements MetadataRegistry {
|
|
|
35
36
|
registerNgModuleMetadata(meta: NgModuleMeta): void;
|
|
36
37
|
registerPipeMetadata(meta: PipeMeta): void;
|
|
37
38
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Registry that keeps track of classes that can be constructed via dependency injection (e.g.
|
|
40
|
-
* injectables, directives, pipes).
|
|
41
|
-
*/
|
|
42
|
-
export declare class InjectableClassRegistry {
|
|
43
|
-
private host;
|
|
44
|
-
private classes;
|
|
45
|
-
constructor(host: ReflectionHost);
|
|
46
|
-
registerInjectable(declaration: ClassDeclaration): void;
|
|
47
|
-
isInjectable(declaration: ClassDeclaration): boolean;
|
|
48
|
-
}
|
|
@@ -41,6 +41,7 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
|
|
|
41
41
|
trace: ((s: string) => void) | undefined;
|
|
42
42
|
useCaseSensitiveFileNames: () => boolean;
|
|
43
43
|
getModuleResolutionCache: (() => ts.ModuleResolutionCache | undefined) | undefined;
|
|
44
|
+
hasInvalidatedResolutions: ((fileName: string, path: ts.Path, languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined) => ts.SourceFile | undefined) | (() => ts.CancellationToken) | ((options: ts.CompilerOptions) => string) | (() => string) | (() => string) | ((fileName: string) => string) | (() => boolean) | (() => string) | ((rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number | undefined) => string[]) | ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | (() => ts.ModuleResolutionCache | undefined) | ((typeReferenceDirectiveNames: string[] | readonly ts.FileReference[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingFileMode?: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | ((name: string) => string | undefined) | ((data: string) => string) | ((fileName: string) => ts.ParsedCommandLine | undefined) | ((fileName: string) => string | undefined) | ((s: string) => void) | ((directoryName: string) => boolean) | ((path: string) => string) | ((path: string) => string[]) | ((fileName: string, languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined) => ts.SourceFile | undefined) | ((fileName: string) => boolean) | ts.WriteFileCallback | undefined;
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
47
|
* Updates a `ts.Program` instance with a new one that incorporates specific changes, using the
|
|
@@ -9,15 +9,6 @@
|
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
/** Equivalent of `ts.ModifierLike` which is only present in TS 4.8+. */
|
|
11
11
|
export declare type ModifierLike = ts.Modifier | ts.Decorator;
|
|
12
|
-
/** Type of `ts.factory.updateTypeParameterDeclaration` in TS 4.7+. */
|
|
13
|
-
declare type Ts47UpdateTypeParameterDeclarationFn = (node: ts.TypeParameterDeclaration, modifiers: readonly ts.Modifier[] | undefined, name: ts.Identifier, constraint: ts.TypeNode | undefined, defaultType: ts.TypeNode | undefined) => ts.TypeParameterDeclaration;
|
|
14
|
-
/**
|
|
15
|
-
* Updates a `ts.TypeParameter` declaration.
|
|
16
|
-
*
|
|
17
|
-
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.7.
|
|
18
|
-
* We should remove it once we have dropped support for the older versions.
|
|
19
|
-
*/
|
|
20
|
-
export declare const updateTypeParameterDeclaration: Ts47UpdateTypeParameterDeclarationFn;
|
|
21
12
|
/** Type of `ts.factory.updateParameterDeclaration` in TS 4.8+. */
|
|
22
13
|
declare type Ts48UpdateParameterDeclarationFn = (node: ts.ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: ts.DotDotDotToken | undefined, name: string | ts.BindingName, questionToken: ts.QuestionToken | undefined, type: ts.TypeNode | undefined, initializer: ts.Expression | undefined) => ts.ParameterDeclaration;
|
|
23
14
|
/**
|
|
@@ -12,7 +12,7 @@ import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
|
|
|
12
12
|
import { ErrorCode } from '../../diagnostics';
|
|
13
13
|
import { FullTemplateMapping, NgTemplateDiagnostic, TypeCheckableDirectiveMeta } from './api';
|
|
14
14
|
import { GlobalCompletion } from './completion';
|
|
15
|
-
import {
|
|
15
|
+
import { PotentialDirective, PotentialImport, PotentialPipe } from './scope';
|
|
16
16
|
import { ElementSymbol, Symbol, TcbLocation, TemplateSymbol } from './symbols';
|
|
17
17
|
/**
|
|
18
18
|
* Interface to the Angular Template Type Checker to extract diagnostics and intelligence from the
|
|
@@ -109,19 +109,24 @@ export interface TemplateTypeChecker {
|
|
|
109
109
|
*/
|
|
110
110
|
getLiteralCompletionLocation(strNode: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): TcbLocation | null;
|
|
111
111
|
/**
|
|
112
|
-
* Get basic metadata on the directives which are in scope for the given
|
|
112
|
+
* Get basic metadata on the directives which are in scope or can be imported for the given
|
|
113
|
+
* component.
|
|
113
114
|
*/
|
|
114
|
-
|
|
115
|
+
getPotentialTemplateDirectives(component: ts.ClassDeclaration): PotentialDirective[];
|
|
115
116
|
/**
|
|
116
117
|
* Get basic metadata on the pipes which are in scope for the given component.
|
|
117
118
|
*/
|
|
118
|
-
getPipesInScope(component: ts.ClassDeclaration):
|
|
119
|
+
getPipesInScope(component: ts.ClassDeclaration): PotentialPipe[] | null;
|
|
119
120
|
/**
|
|
120
|
-
* Retrieve a `Map` of potential template element tags, to either the `
|
|
121
|
+
* Retrieve a `Map` of potential template element tags, to either the `PotentialDirective` that
|
|
121
122
|
* declares them (if the tag is from a directive/component), or `null` if the tag originates from
|
|
122
123
|
* the DOM schema.
|
|
123
124
|
*/
|
|
124
|
-
getPotentialElementTags(component: ts.ClassDeclaration): Map<string,
|
|
125
|
+
getPotentialElementTags(component: ts.ClassDeclaration): Map<string, PotentialDirective | null>;
|
|
126
|
+
/**
|
|
127
|
+
* In the context of an Angular trait, generate potential imports for a directive.
|
|
128
|
+
*/
|
|
129
|
+
getPotentialImportsFor(directive: PotentialDirective, inComponent: ts.ClassDeclaration): ReadonlyArray<PotentialImport>;
|
|
125
130
|
/**
|
|
126
131
|
* Get the primary decorator for an Angular class (such as @Component). This does not work for
|
|
127
132
|
* `@Injectable`.
|
|
@@ -7,12 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/typecheck/api/scope" />
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
+
import { Reference } from '../../imports';
|
|
10
11
|
import { ClassDeclaration } from '../../reflection';
|
|
11
12
|
import { SymbolWithValueDeclaration } from '../../util/src/typescript';
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* A PotentialImport for some Angular trait has a TypeScript module specifier, which can be
|
|
15
|
+
* relative, as well as an identifier name.
|
|
14
16
|
*/
|
|
15
|
-
export interface
|
|
17
|
+
export interface PotentialImport {
|
|
18
|
+
kind: PotentialImportKind;
|
|
19
|
+
moduleSpecifier: string;
|
|
20
|
+
symbolName: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Which kind of Angular Trait the import targets.
|
|
24
|
+
*/
|
|
25
|
+
export declare enum PotentialImportKind {
|
|
26
|
+
NgModule = 0,
|
|
27
|
+
Standalone = 1
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Metadata on a directive which is available in a template.
|
|
31
|
+
*/
|
|
32
|
+
export interface PotentialDirective {
|
|
33
|
+
ref: Reference<ClassDeclaration>;
|
|
16
34
|
/**
|
|
17
35
|
* The `ts.Symbol` for the directive class.
|
|
18
36
|
*/
|
|
@@ -33,11 +51,15 @@ export interface DirectiveInScope {
|
|
|
33
51
|
* `true` if this directive is a structural directive.
|
|
34
52
|
*/
|
|
35
53
|
isStructural: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether or not this directive is in scope.
|
|
56
|
+
*/
|
|
57
|
+
isInScope: boolean;
|
|
36
58
|
}
|
|
37
59
|
/**
|
|
38
|
-
* Metadata for a pipe which is available in
|
|
60
|
+
* Metadata for a pipe which is available in a template.
|
|
39
61
|
*/
|
|
40
|
-
export interface
|
|
62
|
+
export interface PotentialPipe {
|
|
41
63
|
/**
|
|
42
64
|
* The `ts.Symbol` for the pipe class.
|
|
43
65
|
*/
|
|
@@ -46,4 +68,8 @@ export interface PipeInScope {
|
|
|
46
68
|
* Name of the pipe.
|
|
47
69
|
*/
|
|
48
70
|
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether or not this pipe is in scope.
|
|
73
|
+
*/
|
|
74
|
+
isInScope: boolean;
|
|
49
75
|
}
|
|
@@ -10,7 +10,7 @@ import { TmplAstElement, TmplAstReference, TmplAstTemplate, TmplAstVariable } fr
|
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { AbsoluteFsPath } from '../../file_system';
|
|
12
12
|
import { SymbolWithValueDeclaration } from '../../util/src/typescript';
|
|
13
|
-
import {
|
|
13
|
+
import { PotentialDirective } from './scope';
|
|
14
14
|
export declare enum SymbolKind {
|
|
15
15
|
Input = 0,
|
|
16
16
|
Output = 1,
|
|
@@ -214,7 +214,7 @@ export interface TemplateSymbol {
|
|
|
214
214
|
* A representation of a directive/component whose selector matches a node in a component
|
|
215
215
|
* template.
|
|
216
216
|
*/
|
|
217
|
-
export interface DirectiveSymbol extends
|
|
217
|
+
export interface DirectiveSymbol extends PotentialDirective {
|
|
218
218
|
kind: SymbolKind.Directive;
|
|
219
219
|
/** The `ts.Type` for the class declaration. */
|
|
220
220
|
tsType: ts.Type;
|
|
@@ -12,12 +12,12 @@ import { ErrorCode } from '../../diagnostics';
|
|
|
12
12
|
import { AbsoluteFsPath } from '../../file_system';
|
|
13
13
|
import { ReferenceEmitter } from '../../imports';
|
|
14
14
|
import { IncrementalBuild } from '../../incremental/api';
|
|
15
|
-
import { MetadataReader } from '../../metadata';
|
|
15
|
+
import { MetadataReader, MetadataReaderWithIndex } from '../../metadata';
|
|
16
16
|
import { PerfRecorder } from '../../perf';
|
|
17
17
|
import { ProgramDriver } from '../../program_driver';
|
|
18
18
|
import { ReflectionHost } from '../../reflection';
|
|
19
19
|
import { ComponentScopeReader, TypeCheckScopeRegistry } from '../../scope';
|
|
20
|
-
import {
|
|
20
|
+
import { ElementSymbol, FullTemplateMapping, GlobalCompletion, NgTemplateDiagnostic, OptimizeFor, PotentialDirective, PotentialImport, PotentialPipe, ProgramTypeCheckAdapter, TcbLocation, TemplateSymbol, TemplateTypeChecker, TypeCheckableDirectiveMeta, TypeCheckingConfig } from '../api';
|
|
21
21
|
import { ShimTypeCheckingData } from './context';
|
|
22
22
|
import { TemplateSourceManager } from './source';
|
|
23
23
|
/**
|
|
@@ -35,6 +35,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
35
35
|
private compilerHost;
|
|
36
36
|
private priorBuild;
|
|
37
37
|
private readonly metaReader;
|
|
38
|
+
private readonly localMetaReader;
|
|
38
39
|
private readonly componentScopeReader;
|
|
39
40
|
private readonly typeCheckScopeRegistry;
|
|
40
41
|
private readonly perf;
|
|
@@ -73,7 +74,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
73
74
|
*/
|
|
74
75
|
private elementTagCache;
|
|
75
76
|
private isComplete;
|
|
76
|
-
constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
|
|
77
|
+
constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, localMetaReader: MetadataReaderWithIndex, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
|
|
77
78
|
getTemplate(component: ts.ClassDeclaration): TmplAstNode[] | null;
|
|
78
79
|
private getLatestComponentState;
|
|
79
80
|
isTrackedTypeCheckFile(filePath: AbsoluteFsPath): boolean;
|
|
@@ -116,10 +117,10 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
116
117
|
getSymbolOfNode(node: TmplAstTemplate, component: ts.ClassDeclaration): TemplateSymbol | null;
|
|
117
118
|
getSymbolOfNode(node: TmplAstElement, component: ts.ClassDeclaration): ElementSymbol | null;
|
|
118
119
|
private getOrCreateSymbolBuilder;
|
|
119
|
-
|
|
120
|
-
getPipesInScope(component: ts.ClassDeclaration):
|
|
120
|
+
getPotentialTemplateDirectives(component: ts.ClassDeclaration): PotentialDirective[];
|
|
121
|
+
getPipesInScope(component: ts.ClassDeclaration): PotentialPipe[] | null;
|
|
121
122
|
getDirectiveMetadata(dir: ts.ClassDeclaration): TypeCheckableDirectiveMeta | null;
|
|
122
|
-
getPotentialElementTags(component: ts.ClassDeclaration): Map<string,
|
|
123
|
+
getPotentialElementTags(component: ts.ClassDeclaration): Map<string, PotentialDirective | null>;
|
|
123
124
|
getPotentialDomBindings(tagName: string): {
|
|
124
125
|
attribute: string;
|
|
125
126
|
property: string;
|
|
@@ -127,7 +128,9 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
127
128
|
getPotentialDomEvents(tagName: string): string[];
|
|
128
129
|
getPrimaryAngularDecorator(target: ts.ClassDeclaration): ts.Decorator | null;
|
|
129
130
|
getOwningNgModule(component: ts.ClassDeclaration): ts.ClassDeclaration | null;
|
|
131
|
+
getPotentialImportsFor(toImport: PotentialDirective, inContext: ts.ClassDeclaration): ReadonlyArray<PotentialImport>;
|
|
130
132
|
private getScopeData;
|
|
133
|
+
private scopeDataOfDirectiveMeta;
|
|
131
134
|
}
|
|
132
135
|
/**
|
|
133
136
|
* Data for template type-checking related to a specific input file in the user's program (which
|