@angular/compiler-cli 20.0.0-next.1 → 20.0.0-next.3
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-YSSSYIZJ.js → chunk-22GWKJOS.js} +5 -5
- package/bundles/{chunk-PLKJMRGZ.js → chunk-2AJMO7DE.js} +7685 -7172
- package/bundles/chunk-2AJMO7DE.js.map +6 -0
- package/bundles/{chunk-77D5CI2U.js → chunk-5UDS2TPQ.js} +7 -7
- package/bundles/{chunk-UAA7BTBW.js → chunk-ACYTOLUT.js} +31 -31
- package/bundles/{chunk-O2OVHMWL.js → chunk-BTNMUYEF.js} +213 -149
- package/bundles/chunk-BTNMUYEF.js.map +6 -0
- package/bundles/{chunk-FKXFEX7K.js → chunk-GBKXY6BH.js} +3 -3
- package/bundles/{chunk-Q2WE7ECN.js → chunk-I6R3GL3L.js} +5 -5
- package/bundles/{chunk-SNXU6YPZ.js → chunk-PQSJQCH7.js} +3 -3
- package/bundles/{chunk-QYORKQDN.js → chunk-SOZYYFP3.js} +46 -43
- package/bundles/chunk-SOZYYFP3.js.map +6 -0
- package/bundles/{chunk-37JMVF7H.js → chunk-STORTTKY.js} +8 -8
- package/bundles/{chunk-SEPXPBD2.js → chunk-V53QJA3R.js} +12 -12
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.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 +6 -6
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +3 -3
- package/private/migrations.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/evaluation.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/util.d.ts +19 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -1
- package/src/ngtsc/annotations/component/src/metadata.d.ts +5 -2
- package/src/ngtsc/annotations/component/src/resources.d.ts +3 -2
- package/src/ngtsc/annotations/directive/src/handler.d.ts +12 -3
- package/src/ngtsc/annotations/directive/src/shared.d.ts +10 -4
- package/src/ngtsc/annotations/index.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +10 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +4 -2
- package/src/ngtsc/core/src/compiler.d.ts +3 -3
- package/src/ngtsc/diagnostics/src/error_code.d.ts +4 -0
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/docs/src/function_extractor.d.ts +1 -1
- package/src/ngtsc/hmr/src/update_declaration.d.ts +3 -2
- package/src/ngtsc/metadata/index.d.ts +1 -1
- package/src/ngtsc/metadata/src/resource_registry.d.ts +13 -9
- package/src/ngtsc/typecheck/api/api.d.ts +22 -24
- package/src/ngtsc/typecheck/api/checker.d.ts +8 -4
- package/src/ngtsc/typecheck/api/context.d.ts +36 -18
- package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +2 -2
- package/src/ngtsc/typecheck/diagnostics/src/id.d.ts +2 -2
- package/src/ngtsc/typecheck/extended/checks/unparenthesized_nullish_coalescing/index.d.ts +10 -0
- package/src/ngtsc/typecheck/index.d.ts +1 -0
- package/src/ngtsc/typecheck/src/checker.d.ts +8 -7
- package/src/ngtsc/typecheck/src/completion.d.ts +2 -2
- package/src/ngtsc/typecheck/src/context.d.ts +28 -26
- package/src/ngtsc/typecheck/src/diagnostics.d.ts +5 -5
- package/src/ngtsc/typecheck/src/dom.d.ts +19 -8
- package/src/ngtsc/typecheck/src/host_bindings.d.ts +31 -0
- package/src/ngtsc/typecheck/src/oob.d.ts +41 -45
- package/src/ngtsc/typecheck/src/source.d.ts +14 -22
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +23 -15
- package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +3 -3
- package/src/ngtsc/typecheck/src/ts_util.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +10 -6
- package/bundles/chunk-O2OVHMWL.js.map +0 -6
- package/bundles/chunk-PLKJMRGZ.js.map +0 -6
- package/bundles/chunk-QYORKQDN.js.map +0 -6
- /package/bundles/{chunk-YSSSYIZJ.js.map → chunk-22GWKJOS.js.map} +0 -0
- /package/bundles/{chunk-77D5CI2U.js.map → chunk-5UDS2TPQ.js.map} +0 -0
- /package/bundles/{chunk-UAA7BTBW.js.map → chunk-ACYTOLUT.js.map} +0 -0
- /package/bundles/{chunk-FKXFEX7K.js.map → chunk-GBKXY6BH.js.map} +0 -0
- /package/bundles/{chunk-Q2WE7ECN.js.map → chunk-I6R3GL3L.js.map} +0 -0
- /package/bundles/{chunk-SNXU6YPZ.js.map → chunk-PQSJQCH7.js.map} +0 -0
- /package/bundles/{chunk-37JMVF7H.js.map → chunk-STORTTKY.js.map} +0 -0
- /package/bundles/{chunk-SEPXPBD2.js.map → chunk-V53QJA3R.js.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
|
|
9
9
|
import { AstObject, AstValue } from '../../ast/ast_value';
|
|
10
|
-
export declare const PLACEHOLDER_VERSION = "20.0.0-next.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "20.0.0-next.3";
|
|
11
11
|
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
|
|
12
12
|
/**
|
|
13
13
|
* Parses the value of an enum from the AST value's symbol name.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "20.0.0-next.
|
|
3
|
+
"version": "20.0.0-next.3",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/core": "7.26.
|
|
45
|
+
"@babel/core": "7.26.10",
|
|
46
46
|
"@jridgewell/sourcemap-codec": "^1.4.14",
|
|
47
47
|
"reflect-metadata": "^0.2.0",
|
|
48
48
|
"chokidar": "^4.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"yargs": "^17.2.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@angular/compiler": "20.0.0-next.
|
|
55
|
+
"@angular/compiler": "20.0.0-next.3",
|
|
56
56
|
"typescript": ">=5.8 <5.9"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
package/private/migrations.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @fileoverview The API from compiler-cli that the `@angular/core`
|
|
10
10
|
* package requires for migration schematics.
|
|
11
11
|
*/
|
|
12
|
-
export {
|
|
12
|
+
export { createForwardRefResolver } from '../src/ngtsc/annotations';
|
|
13
13
|
export { AbsoluteFsPath } from '../src/ngtsc/file_system';
|
|
14
14
|
export { Reference } from '../src/ngtsc/imports';
|
|
15
15
|
export { DynamicValue, PartialEvaluator, ResolvedValue, ResolvedValueMap, StaticInterpreter, } from '../src/ngtsc/partial_evaluator';
|
|
@@ -9,7 +9,7 @@ import ts from 'typescript';
|
|
|
9
9
|
import { Reference } from '../../../imports';
|
|
10
10
|
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
|
|
11
11
|
import { ClassDeclaration, Decorator } from '../../../reflection';
|
|
12
|
-
export declare function resolveEnumValue(evaluator: PartialEvaluator, metadata: Map<string, ts.Expression>, field: string, enumSymbolName: string): number | null;
|
|
12
|
+
export declare function resolveEnumValue(evaluator: PartialEvaluator, metadata: Map<string, ts.Expression>, field: string, enumSymbolName: string, isCore: boolean): number | null;
|
|
13
13
|
/**
|
|
14
14
|
* Resolves a EncapsulationEnum expression locally on best effort without having to calculate the
|
|
15
15
|
* reference. This suites local compilation mode where each file is compiled individually.
|
|
@@ -26,7 +26,24 @@ export declare function toR3Reference(origin: ts.Node, ref: Reference, context:
|
|
|
26
26
|
export declare function isAngularCore(decorator: Decorator): decorator is Decorator & {
|
|
27
27
|
import: Import;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* This function is used for verifying that a given reference is declared
|
|
31
|
+
* inside `@angular/core` and corresponds to the given symbol name.
|
|
32
|
+
*
|
|
33
|
+
* In some cases, due to the compiler face duplicating many symbols as
|
|
34
|
+
* an independent bridge between core and the compiler, the dts bundler may
|
|
35
|
+
* decide to alias declarations in the `.d.ts`, to avoid conflicts.
|
|
36
|
+
*
|
|
37
|
+
* e.g.
|
|
38
|
+
*
|
|
39
|
+
* ```
|
|
40
|
+
* declare enum ViewEncapsulation {} // from the facade
|
|
41
|
+
* declare enum ViewEncapsulation$1 {} // the real one exported to users.
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* This function accounts for such potential re-namings.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isAngularCoreReferenceWithPotentialAliasing(reference: Reference, symbolName: string, isCore: boolean): boolean;
|
|
30
47
|
export declare function findAngularDecorator(decorators: Decorator[], name: string, isCore: boolean): Decorator | undefined;
|
|
31
48
|
export declare function isAngularDecorator(decorator: Decorator, name: string, isCore: boolean): boolean;
|
|
32
49
|
export declare function getAngularDecorators(decorators: Decorator[], names: readonly string[], isCore: boolean): Decorator[];
|
|
@@ -55,7 +72,7 @@ export declare function tryUnwrapForwardRef(node: ts.Expression, reflector: Refl
|
|
|
55
72
|
* @param args the arguments to the invocation of the forwardRef expression
|
|
56
73
|
* @returns an unwrapped argument if `ref` pointed to forwardRef, or null otherwise
|
|
57
74
|
*/
|
|
58
|
-
export declare
|
|
75
|
+
export declare function createForwardRefResolver(isCore: boolean): ForeignFunctionResolver;
|
|
59
76
|
/**
|
|
60
77
|
* Combines an array of resolver functions into a one.
|
|
61
78
|
* @param resolvers Resolvers to be combined.
|
|
@@ -73,7 +73,8 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
73
73
|
private readonly strictStandalone;
|
|
74
74
|
private readonly enableHmr;
|
|
75
75
|
private readonly implicitStandaloneValue;
|
|
76
|
-
|
|
76
|
+
private readonly typeCheckHostBindings;
|
|
77
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, 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, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, enableLetSyntax: boolean, externalRuntimeStyles: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, jitDeclarationRegistry: JitDeclarationRegistry, i18nPreserveSignificantWhitespace: boolean, strictStandalone: boolean, enableHmr: boolean, implicitStandaloneValue: boolean, typeCheckHostBindings: boolean);
|
|
77
78
|
private literalCache;
|
|
78
79
|
private elementSchemaRegistry;
|
|
79
80
|
/**
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
import { AnimationTriggerNames, DeclarationListEmitMode, DeferBlockDepsEmitMode, R3ClassDebugInfo, R3ClassMetadata, R3ComponentMetadata, R3DeferPerBlockDependency, R3DeferPerComponentDependency, R3TemplateDependencyMetadata, SchemaMetadata, TmplAstDeferredBlock } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { Reference } from '../../../imports';
|
|
11
|
-
import { ClassPropertyMapping,
|
|
11
|
+
import { ClassPropertyMapping, DirectiveResources, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping } from '../../../metadata';
|
|
12
12
|
import { ClassDeclaration } from '../../../reflection';
|
|
13
13
|
import { SubsetOfKeys } from '../../../util/src/typescript';
|
|
14
14
|
import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
|
|
15
|
+
import { HostBindingNodes } from '../../directive';
|
|
15
16
|
/**
|
|
16
17
|
* These fields of `R3ComponentMetadata` are updated in the `resolve` phase.
|
|
17
18
|
*
|
|
@@ -43,7 +44,7 @@ export interface ComponentAnalysisData {
|
|
|
43
44
|
* require an Angular factory definition at runtime.
|
|
44
45
|
*/
|
|
45
46
|
viewProvidersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
46
|
-
resources:
|
|
47
|
+
resources: DirectiveResources;
|
|
47
48
|
/**
|
|
48
49
|
* `styleUrls` extracted from the decorator, if present.
|
|
49
50
|
*/
|
|
@@ -68,6 +69,8 @@ export interface ComponentAnalysisData {
|
|
|
68
69
|
hostDirectives: HostDirectiveMeta[] | null;
|
|
69
70
|
/** Raw expression that defined the host directives array. Used for diagnostics. */
|
|
70
71
|
rawHostDirectives: ts.Expression | null;
|
|
72
|
+
/** Raw nodes representing the host bindings of the directive. */
|
|
73
|
+
hostBindingNodes: HostBindingNodes;
|
|
71
74
|
}
|
|
72
75
|
export interface ComponentResolutionData {
|
|
73
76
|
declarations: R3TemplateDependencyMetadata[];
|
|
@@ -13,7 +13,7 @@ import { Resource } from '../../../metadata';
|
|
|
13
13
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
14
14
|
import { ClassDeclaration, DeclarationNode, Decorator } from '../../../reflection';
|
|
15
15
|
import { CompilationMode } from '../../../transform';
|
|
16
|
-
import {
|
|
16
|
+
import { SourceMapping } from '../../../typecheck/api';
|
|
17
17
|
import { ResourceLoader } from '../../common';
|
|
18
18
|
/**
|
|
19
19
|
* The literal style url extracted from the decorator, along with metadata for diagnostics.
|
|
@@ -58,7 +58,7 @@ export interface ParsedComponentTemplate extends ParsedTemplate {
|
|
|
58
58
|
export interface ParsedTemplateWithSource extends ParsedComponentTemplate {
|
|
59
59
|
/** The string contents of the template. */
|
|
60
60
|
content: string;
|
|
61
|
-
sourceMapping:
|
|
61
|
+
sourceMapping: SourceMapping;
|
|
62
62
|
declaration: TemplateDeclaration;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
@@ -104,6 +104,7 @@ export interface ExtractTemplateOptions {
|
|
|
104
104
|
preserveSignificantWhitespace?: boolean;
|
|
105
105
|
}
|
|
106
106
|
export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions, compilationMode: CompilationMode): ParsedTemplateWithSource;
|
|
107
|
+
export declare function createEmptyTemplate(componentClass: ClassDeclaration, component: Map<string, ts.Expression>, containingFile: string): ParsedTemplateWithSource;
|
|
107
108
|
export declare function parseTemplateDeclaration(node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, defaultPreserveWhitespaces: boolean): TemplateDeclaration;
|
|
108
109
|
export declare function preloadAndParseTemplate(evaluator: PartialEvaluator, resourceLoader: ResourceLoader, depTracker: DependencyTracker | null, preanalyzeTemplateCache: Map<DeclarationNode, ParsedTemplateWithSource>, node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, defaultPreserveWhitespaces: boolean, options: ExtractTemplateOptions, compilationMode: CompilationMode): Promise<ParsedTemplateWithSource | null>;
|
|
109
110
|
export declare function makeResourceNotFoundError(file: string, nodeForError: ts.Node, resourceType: ResourceTypeForDiagnostics): FatalDiagnosticError;
|
|
@@ -9,15 +9,17 @@ import { ConstantPool, R3ClassMetadata, R3DirectiveMetadata } from '@angular/com
|
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ImportedSymbolsTracker, Reference, ReferenceEmitter } from '../../../imports';
|
|
11
11
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
12
|
-
import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
12
|
+
import { ClassPropertyMapping, DirectiveResources, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping, MetadataReader, MetadataRegistry, ResourceRegistry } from '../../../metadata';
|
|
13
13
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
14
14
|
import { PerfRecorder } from '../../../perf';
|
|
15
15
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
16
|
-
import { LocalModuleScopeRegistry } from '../../../scope';
|
|
16
|
+
import { LocalModuleScopeRegistry, TypeCheckScopeRegistry } from '../../../scope';
|
|
17
17
|
import { AnalysisOutput, CompilationMode, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
18
18
|
import { InjectableClassRegistry, ReferencesRegistry } from '../../common';
|
|
19
|
+
import { HostBindingNodes } from './shared';
|
|
19
20
|
import { DirectiveSymbol } from './symbol';
|
|
20
21
|
import { JitDeclarationRegistry } from '../../common/src/jit_declaration_registry';
|
|
22
|
+
import { TypeCheckContext } from '../../../typecheck/api';
|
|
21
23
|
export interface DirectiveHandlerData {
|
|
22
24
|
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
|
|
23
25
|
typeCheckMeta: DirectiveTypeCheckMeta;
|
|
@@ -32,6 +34,8 @@ export interface DirectiveHandlerData {
|
|
|
32
34
|
decorator: ts.Decorator | null;
|
|
33
35
|
hostDirectives: HostDirectiveMeta[] | null;
|
|
34
36
|
rawHostDirectives: ts.Expression | null;
|
|
37
|
+
hostBindingNodes: HostBindingNodes;
|
|
38
|
+
resources: DirectiveResources;
|
|
35
39
|
}
|
|
36
40
|
export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decorator | null, DirectiveHandlerData, DirectiveSymbol, unknown> {
|
|
37
41
|
private reflector;
|
|
@@ -49,17 +53,22 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
|
|
|
49
53
|
private perf;
|
|
50
54
|
private importTracker;
|
|
51
55
|
private includeClassMetadata;
|
|
56
|
+
private typeCheckScopeRegistry;
|
|
52
57
|
private readonly compilationMode;
|
|
53
58
|
private readonly jitDeclarationRegistry;
|
|
59
|
+
private readonly resourceRegistry;
|
|
54
60
|
private readonly strictStandalone;
|
|
55
61
|
private readonly implicitStandaloneValue;
|
|
56
|
-
|
|
62
|
+
private readonly usePoisonedData;
|
|
63
|
+
private readonly typeCheckHostBindings;
|
|
64
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, typeCheckScopeRegistry: TypeCheckScopeRegistry, compilationMode: CompilationMode, jitDeclarationRegistry: JitDeclarationRegistry, resourceRegistry: ResourceRegistry, strictStandalone: boolean, implicitStandaloneValue: boolean, usePoisonedData: boolean, typeCheckHostBindings: boolean);
|
|
57
65
|
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
58
66
|
readonly name = "DirectiveDecoratorHandler";
|
|
59
67
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
60
68
|
analyze(node: ClassDeclaration, decorator: Readonly<Decorator | null>): AnalysisOutput<DirectiveHandlerData>;
|
|
61
69
|
symbol(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): DirectiveSymbol;
|
|
62
70
|
register(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): void;
|
|
71
|
+
typeCheck(ctx: TypeCheckContext, node: ClassDeclaration, meta: Readonly<DirectiveHandlerData>): void;
|
|
63
72
|
resolve(node: ClassDeclaration, analysis: DirectiveHandlerData, symbol: DirectiveSymbol): ResolveResult<unknown>;
|
|
64
73
|
compileFull(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>, pool: ConstantPool): CompileResult[];
|
|
65
74
|
compilePartial(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>): CompileResult[];
|
|
@@ -5,16 +5,21 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { R3DirectiveMetadata, R3QueryMetadata } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ImportedSymbolsTracker, Reference, ReferenceEmitter } from '../../../imports';
|
|
11
|
-
import { ClassPropertyMapping, DecoratorInputTransform, HostDirectiveMeta, InputMapping } from '../../../metadata';
|
|
11
|
+
import { ClassPropertyMapping, DecoratorInputTransform, HostDirectiveMeta, InputMapping, Resource } from '../../../metadata';
|
|
12
12
|
import { DynamicValue, PartialEvaluator } from '../../../partial_evaluator';
|
|
13
|
-
import { ClassDeclaration,
|
|
13
|
+
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
14
14
|
import { CompilationMode } from '../../../transform';
|
|
15
15
|
import { ReferencesRegistry } from '../../common';
|
|
16
16
|
type QueryDecoratorName = 'ViewChild' | 'ViewChildren' | 'ContentChild' | 'ContentChildren';
|
|
17
17
|
export declare const queryDecoratorNames: QueryDecoratorName[];
|
|
18
|
+
export interface HostBindingNodes {
|
|
19
|
+
literal: ts.ObjectLiteralExpression | null;
|
|
20
|
+
bindingDecorators: Set<ts.Decorator>;
|
|
21
|
+
listenerDecorators: Set<ts.Decorator>;
|
|
22
|
+
}
|
|
18
23
|
/**
|
|
19
24
|
* Helper function to extract metadata from a `Directive` or `Component`. `Directive`s without a
|
|
20
25
|
* selector are allowed to be used for abstract base classes. These abstract directives should not
|
|
@@ -31,11 +36,11 @@ export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decora
|
|
|
31
36
|
hostDirectives: HostDirectiveMeta[] | null;
|
|
32
37
|
rawHostDirectives: ts.Expression | null;
|
|
33
38
|
inputFieldNamesFromMetadataArray: Set<string>;
|
|
39
|
+
hostBindingNodes: HostBindingNodes;
|
|
34
40
|
} | {
|
|
35
41
|
jitForced: true;
|
|
36
42
|
};
|
|
37
43
|
export declare function extractDecoratorQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
|
|
38
|
-
export declare function extractHostBindings(members: ClassMember[], evaluator: PartialEvaluator, coreModule: string | undefined, compilationMode: CompilationMode, metadata?: Map<string, ts.Expression>): ParsedHostBindings;
|
|
39
44
|
export declare function parseDirectiveStyles(directive: Map<string, ts.Expression>, evaluator: PartialEvaluator, compilationMode: CompilationMode): null | string[];
|
|
40
45
|
export declare function parseFieldStringArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
|
|
41
46
|
/**
|
|
@@ -50,4 +55,5 @@ export declare function parseFieldStringArrayValue(directive: Map<string, ts.Exp
|
|
|
50
55
|
*
|
|
51
56
|
*/
|
|
52
57
|
export declare function parseDecoratorInputTransformFunction(clazz: ClassDeclaration, classPropertyName: string, value: DynamicValue | Reference, reflector: ReflectionHost, refEmitter: ReferenceEmitter, compilationMode: CompilationMode): DecoratorInputTransform;
|
|
58
|
+
export declare function extractHostBindingResources(nodes: HostBindingNodes): ReadonlySet<Resource>;
|
|
53
59
|
export {};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
8
|
+
export { createForwardRefResolver, findAngularDecorator, getAngularDecorators, isAngularDecorator, NoopReferencesRegistry, ReferencesRegistry, ResourceLoader, ResourceLoaderContext, JitDeclarationRegistry, } from './common';
|
|
9
9
|
export { ComponentDecoratorHandler } from './component';
|
|
10
10
|
export { DirectiveDecoratorHandler, InitializerApiFunction, INPUT_INITIALIZER_FN, MODEL_INITIALIZER_FN, OUTPUT_INITIALIZER_FNS, QUERY_INITIALIZER_FNS, queryDecoratorNames, QueryFunctionName, tryParseInitializerApi, tryParseInitializerBasedOutput, tryParseSignalInputMapping, tryParseSignalModelMapping, tryParseSignalQueryFromInitializer, } from './directive';
|
|
11
11
|
export { NgModuleDecoratorHandler } from './ng_module';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
-
import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, MiscOptions,
|
|
9
|
+
import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, MiscOptions, TypeCheckingOptions, TargetOptions } from './public_options';
|
|
10
10
|
/**
|
|
11
11
|
* Non-public options which are useful during testing of the compiler.
|
|
12
12
|
*/
|
|
@@ -38,6 +38,14 @@ export interface InternalOptions {
|
|
|
38
38
|
* Whether to check the event side of two-way bindings.
|
|
39
39
|
*/
|
|
40
40
|
_checkTwoWayBoundEvents?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether this is a compilation of Angular core itself.
|
|
43
|
+
*
|
|
44
|
+
* By default, we detect this automatically based on the existence of `r3_symbols.ts`
|
|
45
|
+
* in the compilation, but there are other test targets within the `core` package that
|
|
46
|
+
* import e.g. `Component` relatively and should be detected by the compiler.
|
|
47
|
+
*/
|
|
48
|
+
_isAngularCoreCompilation?: boolean;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* A merged interface of all of the various Angular compiler options, as well as the standard
|
|
@@ -45,6 +53,6 @@ export interface InternalOptions {
|
|
|
45
53
|
*
|
|
46
54
|
* Also includes a few miscellaneous options.
|
|
47
55
|
*/
|
|
48
|
-
export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions,
|
|
56
|
+
export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions, TypeCheckingOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {
|
|
49
57
|
[prop: string]: any;
|
|
50
58
|
}
|
|
@@ -81,11 +81,13 @@ export interface LegacyNgcOptions {
|
|
|
81
81
|
preserveWhitespaces?: boolean;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Options related to
|
|
84
|
+
* Options related to Angular-specific type-checking and its strictness.
|
|
85
85
|
*
|
|
86
86
|
* @publicApi
|
|
87
87
|
*/
|
|
88
|
-
export interface
|
|
88
|
+
export interface TypeCheckingOptions {
|
|
89
|
+
/** Whether type checking of host bindings is enabled. */
|
|
90
|
+
typeCheckHostBindings?: boolean;
|
|
89
91
|
/**
|
|
90
92
|
* If `true`, implies all template strictness flags below (unless individually disabled).
|
|
91
93
|
*
|
|
@@ -10,7 +10,7 @@ import { DocEntry } from '../../docs';
|
|
|
10
10
|
import { AbsoluteFsPath } from '../../file_system';
|
|
11
11
|
import { IncrementalBuildStrategy, IncrementalCompilation, IncrementalState } from '../../incremental';
|
|
12
12
|
import { IndexedComponent } from '../../indexer';
|
|
13
|
-
import {
|
|
13
|
+
import { DirectiveResources, DirectiveMeta, PipeMeta } from '../../metadata';
|
|
14
14
|
import { ActivePerfRecorder } from '../../perf';
|
|
15
15
|
import { ProgramDriver } from '../../program_driver';
|
|
16
16
|
import { DeclarationNode } from '../../reflection';
|
|
@@ -208,9 +208,9 @@ export declare class NgCompiler {
|
|
|
208
208
|
*/
|
|
209
209
|
getComponentsWithStyleFile(styleFilePath: string): ReadonlySet<DeclarationNode>;
|
|
210
210
|
/**
|
|
211
|
-
* Retrieves external resources for the given
|
|
211
|
+
* Retrieves external resources for the given directive.
|
|
212
212
|
*/
|
|
213
|
-
|
|
213
|
+
getDirectiveResources(classDecl: DeclarationNode): DirectiveResources | null;
|
|
214
214
|
getMeta(classDecl: DeclarationNode): PipeMeta | DirectiveMeta | null;
|
|
215
215
|
/**
|
|
216
216
|
* Perform Angular's analysis step (as a precursor to `getDiagnostics` or `prepareEmit`)
|
|
@@ -444,6 +444,10 @@ export declare enum ErrorCode {
|
|
|
444
444
|
* A symbol referenced in `@Component.imports` isn't being used within the template.
|
|
445
445
|
*/
|
|
446
446
|
UNUSED_STANDALONE_IMPORTS = 8113,
|
|
447
|
+
/**
|
|
448
|
+
* An expression mixes nullish coalescing and logical and/or without parentheses.
|
|
449
|
+
*/
|
|
450
|
+
UNPARENTHESIZED_NULLISH_COALESCING = 8114,
|
|
447
451
|
/**
|
|
448
452
|
* The template type-checking engine would need to generate an inline type check block for a
|
|
449
453
|
* component, but the current type-checking environment doesn't support it.
|
|
@@ -27,5 +27,6 @@ export declare enum ExtendedTemplateDiagnosticName {
|
|
|
27
27
|
INTERPOLATED_SIGNAL_NOT_INVOKED = "interpolatedSignalNotInvoked",
|
|
28
28
|
CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = "controlFlowPreventingContentProjection",
|
|
29
29
|
UNUSED_LET_DECLARATION = "unusedLetDeclaration",
|
|
30
|
-
UNUSED_STANDALONE_IMPORTS = "unusedStandaloneImports"
|
|
30
|
+
UNUSED_STANDALONE_IMPORTS = "unusedStandaloneImports",
|
|
31
|
+
UNPARENTHESIZED_NULLISH_COALESCING = "unparenthesizedNullishCoalescing"
|
|
31
32
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
9
|
import { EntryType, FunctionEntry, ParameterEntry } from './entities';
|
|
10
|
-
export type FunctionLike = ts.FunctionDeclaration | ts.MethodDeclaration | ts.MethodSignature | ts.CallSignatureDeclaration | ts.ConstructSignatureDeclaration;
|
|
10
|
+
export type FunctionLike = ts.FunctionDeclaration | ts.MethodDeclaration | ts.MethodSignature | ts.CallSignatureDeclaration | ts.ConstructSignatureDeclaration | ts.ConstructorDeclaration;
|
|
11
11
|
export declare class FunctionExtractor {
|
|
12
12
|
private name;
|
|
13
13
|
private exportDeclaration;
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { R3HmrMetadata, outputAst as o } from '@angular/compiler';
|
|
9
9
|
import { CompileResult } from '../../transform';
|
|
10
|
+
import { ClassDeclaration } from '../../reflection';
|
|
10
11
|
import ts from 'typescript';
|
|
11
12
|
/**
|
|
12
13
|
* Gets the declaration for the function that replaces the metadata of a class during HMR.
|
|
13
14
|
* @param compilationResults Code generated for the class during compilation.
|
|
14
15
|
* @param meta HMR metadata about the class.
|
|
15
|
-
* @param
|
|
16
|
+
* @param declaration Class for which the update declaration is being generated.
|
|
16
17
|
*/
|
|
17
|
-
export declare function getHmrUpdateDeclaration(compilationResults: CompileResult[], constantStatements: o.Statement[], meta: R3HmrMetadata,
|
|
18
|
+
export declare function getHmrUpdateDeclaration(compilationResults: CompileResult[], constantStatements: o.Statement[], meta: R3HmrMetadata, declaration: ClassDeclaration): ts.FunctionDeclaration;
|
|
@@ -9,7 +9,7 @@ export * from './src/api';
|
|
|
9
9
|
export { DtsMetadataReader } from './src/dts';
|
|
10
10
|
export { flattenInheritedDirectiveMetadata } from './src/inheritance';
|
|
11
11
|
export { CompoundMetadataRegistry, LocalMetadataRegistry } from './src/registry';
|
|
12
|
-
export { ResourceRegistry, Resource,
|
|
12
|
+
export { ResourceRegistry, Resource, DirectiveResources, isExternalResource, ExternalResource, } from './src/resource_registry';
|
|
13
13
|
export { extractDirectiveTypeCheckMeta, hasInjectableFields, CompoundMetadataReader, isHostDirectiveMetaForGlobalMode, } from './src/util';
|
|
14
14
|
export { BindingPropertyName, ClassPropertyMapping, ClassPropertyName, InputOrOutput, } from './src/property_mapping';
|
|
15
15
|
export { ExportedProviderStatusResolver } from './src/providers';
|
|
@@ -17,23 +17,25 @@ import { ClassDeclaration } from '../../reflection';
|
|
|
17
17
|
*/
|
|
18
18
|
export interface Resource {
|
|
19
19
|
path: AbsoluteFsPath | null;
|
|
20
|
-
|
|
20
|
+
node: ts.Node;
|
|
21
21
|
}
|
|
22
22
|
export interface ExternalResource extends Resource {
|
|
23
23
|
path: AbsoluteFsPath;
|
|
24
24
|
}
|
|
25
25
|
export declare function isExternalResource(resource: Resource): resource is ExternalResource;
|
|
26
26
|
/**
|
|
27
|
-
* Represents the either inline or external resources of a
|
|
27
|
+
* Represents the either inline or external resources of a directive.
|
|
28
28
|
*
|
|
29
29
|
* A resource with a `path` of `null` is considered inline.
|
|
30
|
+
* The template will be present for components, but will be null for directives.
|
|
30
31
|
*/
|
|
31
|
-
export interface
|
|
32
|
-
template: Resource;
|
|
33
|
-
styles: ReadonlySet<Resource
|
|
32
|
+
export interface DirectiveResources {
|
|
33
|
+
template: Resource | null;
|
|
34
|
+
styles: ReadonlySet<Resource> | null;
|
|
35
|
+
hostBindings: ReadonlySet<Resource> | null;
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
|
-
* Tracks the mapping between external
|
|
38
|
+
* Tracks the mapping between external resources and the directives(s) which use them.
|
|
37
39
|
*
|
|
38
40
|
* This information is produced during analysis of the program and is used mainly to support
|
|
39
41
|
* external tooling, for which such a mapping is challenging to determine without compiler
|
|
@@ -44,11 +46,13 @@ export declare class ResourceRegistry {
|
|
|
44
46
|
private componentToTemplateMap;
|
|
45
47
|
private componentToStylesMap;
|
|
46
48
|
private externalStyleToComponentsMap;
|
|
49
|
+
private directiveToHostBindingsMap;
|
|
47
50
|
getComponentsWithTemplate(template: AbsoluteFsPath): ReadonlySet<ClassDeclaration>;
|
|
48
|
-
registerResources(resources:
|
|
49
|
-
registerTemplate
|
|
51
|
+
registerResources(resources: DirectiveResources, directive: ClassDeclaration): void;
|
|
52
|
+
private registerTemplate;
|
|
50
53
|
getTemplate(component: ClassDeclaration): Resource | null;
|
|
51
|
-
registerStyle
|
|
54
|
+
private registerStyle;
|
|
52
55
|
getStyles(component: ClassDeclaration): Set<Resource>;
|
|
53
56
|
getComponentsWithStyle(styleUrl: AbsoluteFsPath): ReadonlySet<ClassDeclaration>;
|
|
57
|
+
getHostBindings(directive: ClassDeclaration): ReadonlySet<Resource> | null;
|
|
54
58
|
}
|
|
@@ -28,8 +28,8 @@ export interface TypeCheckableDirectiveMeta extends DirectiveMeta, DirectiveType
|
|
|
28
28
|
imports: Reference<ClassDeclaration>[] | null;
|
|
29
29
|
rawImports: ts.Expression | null;
|
|
30
30
|
}
|
|
31
|
-
export type
|
|
32
|
-
__brand: '
|
|
31
|
+
export type TypeCheckId = string & {
|
|
32
|
+
__brand: 'TypeCheckId';
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* A `ts.Diagnostic` with additional information about the diagnostic related to template
|
|
@@ -39,11 +39,11 @@ export interface TemplateDiagnostic extends ts.Diagnostic {
|
|
|
39
39
|
/**
|
|
40
40
|
* The component with the template that resulted in this diagnostic.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
sourceFile: ts.SourceFile;
|
|
43
43
|
/**
|
|
44
|
-
* The
|
|
44
|
+
* The type check ID of the directive that resulted in this diagnostic.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
typeCheckId: TypeCheckId;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* A `TemplateDiagnostic` with a specific error code.
|
|
@@ -59,14 +59,14 @@ export interface TypeCheckBlockMetadata {
|
|
|
59
59
|
/**
|
|
60
60
|
* A unique identifier for the class which gave rise to this TCB.
|
|
61
61
|
*
|
|
62
|
-
* This can be used to map errors back to the `ts.ClassDeclaration` for the
|
|
62
|
+
* This can be used to map errors back to the `ts.ClassDeclaration` for the directive.
|
|
63
63
|
*/
|
|
64
|
-
id:
|
|
64
|
+
id: TypeCheckId;
|
|
65
65
|
/**
|
|
66
66
|
* Semantic information about the template of the component.
|
|
67
67
|
*/
|
|
68
68
|
boundTarget: BoundTarget<TypeCheckableDirectiveMeta>;
|
|
69
|
-
pipes: Map<string, PipeMeta
|
|
69
|
+
pipes: Map<string, PipeMeta> | null;
|
|
70
70
|
/**
|
|
71
71
|
* Schemas that apply to this template.
|
|
72
72
|
*/
|
|
@@ -309,26 +309,24 @@ export interface TypeCheckingConfig {
|
|
|
309
309
|
*/
|
|
310
310
|
checkTwoWayBoundEvents: boolean;
|
|
311
311
|
}
|
|
312
|
-
export type
|
|
312
|
+
export type SourceMapping = DirectSourceMapping | IndirectSourceMapping | ExternalTemplateSourceMapping;
|
|
313
313
|
/**
|
|
314
|
-
* A mapping to
|
|
314
|
+
* A mapping to a node within the same source file..
|
|
315
315
|
*
|
|
316
|
-
* `ParseSourceSpan`s for this
|
|
317
|
-
* message.
|
|
316
|
+
* `ParseSourceSpan`s for this node should be accurate for direct reporting in a TS error message.
|
|
318
317
|
*/
|
|
319
|
-
export interface
|
|
318
|
+
export interface DirectSourceMapping {
|
|
320
319
|
type: 'direct';
|
|
321
|
-
node: ts.
|
|
320
|
+
node: ts.Node;
|
|
322
321
|
}
|
|
323
322
|
/**
|
|
324
|
-
* A mapping to a
|
|
323
|
+
* A mapping to a node which is still in a TS file, but where the positions in any
|
|
325
324
|
* `ParseSourceSpan`s are not accurate for one reason or another.
|
|
326
325
|
*
|
|
327
|
-
* This can occur if the
|
|
328
|
-
* construct a contiguous mapping for the template string.
|
|
329
|
-
* expression.
|
|
326
|
+
* This can occur if the expression was interpolated in a way where the compiler could not
|
|
327
|
+
* construct a contiguous mapping for the template string.
|
|
330
328
|
*/
|
|
331
|
-
export interface
|
|
329
|
+
export interface IndirectSourceMapping {
|
|
332
330
|
type: 'indirect';
|
|
333
331
|
componentClass: ClassDeclaration;
|
|
334
332
|
node: ts.Expression;
|
|
@@ -348,18 +346,18 @@ export interface ExternalTemplateSourceMapping {
|
|
|
348
346
|
templateUrl: string;
|
|
349
347
|
}
|
|
350
348
|
/**
|
|
351
|
-
* A mapping of a TCB template id to a span in the corresponding
|
|
349
|
+
* A mapping of a TCB template id to a span in the corresponding source code.
|
|
352
350
|
*/
|
|
353
351
|
export interface SourceLocation {
|
|
354
|
-
id:
|
|
352
|
+
id: TypeCheckId;
|
|
355
353
|
span: AbsoluteSourceSpan;
|
|
356
354
|
}
|
|
357
355
|
/**
|
|
358
|
-
* A representation of all a node's
|
|
356
|
+
* A representation of all a node's type checking information we know. Useful for producing
|
|
359
357
|
* diagnostics based on a TCB node or generally mapping from a TCB node back to a template location.
|
|
360
358
|
*/
|
|
361
|
-
export interface
|
|
359
|
+
export interface FullSourceMapping {
|
|
362
360
|
sourceLocation: SourceLocation;
|
|
363
|
-
|
|
361
|
+
sourceMapping: SourceMapping;
|
|
364
362
|
span: ParseSourceSpan;
|
|
365
363
|
}
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TemplateEntity, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
|
|
8
|
+
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TemplateEntity, TmplAstElement, TmplAstHostElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
|
|
11
11
|
import { ErrorCode } from '../../diagnostics';
|
|
12
12
|
import { Reference } from '../../imports';
|
|
13
13
|
import { NgModuleMeta, PipeMeta } from '../../metadata';
|
|
14
14
|
import { ClassDeclaration } from '../../reflection';
|
|
15
|
-
import {
|
|
15
|
+
import { FullSourceMapping, NgTemplateDiagnostic, TypeCheckableDirectiveMeta } from './api';
|
|
16
16
|
import { GlobalCompletion } from './completion';
|
|
17
17
|
import { PotentialDirective, PotentialImport, PotentialImportMode, PotentialPipe } from './scope';
|
|
18
18
|
import { ElementSymbol, Symbol, TcbLocation, TemplateSymbol } from './symbols';
|
|
@@ -34,6 +34,10 @@ export interface TemplateTypeChecker {
|
|
|
34
34
|
* Retrieve the template in use for the given component.
|
|
35
35
|
*/
|
|
36
36
|
getTemplate(component: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstNode[] | null;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve the host element of the given directive.
|
|
39
|
+
*/
|
|
40
|
+
getHostElement(directive: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstHostElement | null;
|
|
37
41
|
/**
|
|
38
42
|
* Get all `ts.Diagnostic`s currently available for the given `ts.SourceFile`.
|
|
39
43
|
*
|
|
@@ -50,10 +54,10 @@ export interface TemplateTypeChecker {
|
|
|
50
54
|
*/
|
|
51
55
|
getDiagnosticsForFile(sf: ts.SourceFile, optimizeFor: OptimizeFor): ts.Diagnostic[];
|
|
52
56
|
/**
|
|
53
|
-
* Given a `shim` and position within the file, returns information for mapping back to a
|
|
57
|
+
* Given a `shim` and position within the file, returns information for mapping back to a source
|
|
54
58
|
* location.
|
|
55
59
|
*/
|
|
56
|
-
|
|
60
|
+
getSourceMappingAtTcbLocation(tcbLocation: TcbLocation): FullSourceMapping | null;
|
|
57
61
|
/**
|
|
58
62
|
* Get all `ts.Diagnostic`s currently available that pertain to the given component.
|
|
59
63
|
*
|