@angular/compiler-cli 14.2.0-next.1 → 15.0.0-next.0
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-I34YWN6W.js → chunk-4CS5WLPD.js} +184 -120
- package/bundles/chunk-4CS5WLPD.js.map +6 -0
- package/bundles/{chunk-S4JINNFN.js → chunk-4NRCP3Y6.js} +7 -7
- package/bundles/{chunk-S4JINNFN.js.map → chunk-4NRCP3Y6.js.map} +0 -0
- package/bundles/{chunk-Z57D3OKU.js → chunk-56O2PTWU.js} +7 -7
- package/bundles/{chunk-Z57D3OKU.js.map → chunk-56O2PTWU.js.map} +0 -0
- package/bundles/{chunk-4SINIALN.js → chunk-5FZBUSFV.js} +3 -3
- package/bundles/{chunk-4SINIALN.js.map → chunk-5FZBUSFV.js.map} +0 -0
- package/bundles/chunk-DM4TYSFG.js +96 -0
- package/bundles/chunk-DM4TYSFG.js.map +6 -0
- package/bundles/{chunk-SJL5HBUW.js → chunk-HMWNYAAE.js} +2 -2
- package/bundles/{chunk-SJL5HBUW.js.map → chunk-HMWNYAAE.js.map} +0 -0
- package/bundles/{chunk-N2MCMY3J.js → chunk-ICPLY7FO.js} +4 -4
- package/bundles/{chunk-N2MCMY3J.js.map → chunk-ICPLY7FO.js.map} +0 -0
- package/bundles/{chunk-AHYRDQYO.js → chunk-IKKP4LXM.js} +29 -26
- package/bundles/chunk-IKKP4LXM.js.map +6 -0
- package/bundles/{chunk-IJA2BQQH.js → chunk-JN4TT3OU.js} +44 -20
- package/bundles/chunk-JN4TT3OU.js.map +6 -0
- package/bundles/{chunk-GQHLKW4T.js → chunk-KUSEWNLW.js} +54 -32
- package/bundles/chunk-KUSEWNLW.js.map +6 -0
- package/bundles/{chunk-AMYIDAXN.js → chunk-MOE5WKIA.js} +20 -13
- package/bundles/chunk-MOE5WKIA.js.map +6 -0
- package/bundles/{chunk-ZSQCUET7.js → chunk-MQGVI6KC.js} +363 -155
- package/bundles/chunk-MQGVI6KC.js.map +6 -0
- package/bundles/{chunk-WJ34B4FT.js → chunk-MT76GVED.js} +80 -74
- package/bundles/chunk-MT76GVED.js.map +6 -0
- package/bundles/{chunk-TXUURHQE.js → chunk-PLV54QMQ.js} +40 -40
- package/bundles/{chunk-TXUURHQE.js.map → chunk-PLV54QMQ.js.map} +0 -0
- package/bundles/{chunk-CTEVZGOM.js → chunk-RCXOJZDO.js} +5 -5
- package/bundles/{chunk-CTEVZGOM.js.map → chunk-RCXOJZDO.js.map} +0 -0
- package/bundles/{chunk-HZ5F54TQ.js → chunk-TR3BZDPT.js} +5 -5
- package/bundles/{chunk-HZ5F54TQ.js.map → chunk-TR3BZDPT.js.map} +0 -0
- package/bundles/index.js +13 -12
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +13 -12
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -4
- package/bundles/ngcc/index.js +13 -12
- package/bundles/ngcc/index.js.map +1 -1
- package/bundles/ngcc/main-ngcc.js +14 -13
- package/bundles/ngcc/main-ngcc.js.map +1 -1
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -13
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
- 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 -5
- package/bundles/private/migrations.js.map +1 -1
- package/bundles/private/tooling.js +3 -2
- package/bundles/src/bin/ng_xi18n.js +11 -10
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +9 -8
- package/bundles/src/bin/ngc.js.map +1 -1
- 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 +3 -3
- package/src/ngtsc/annotations/common/src/diagnostics.d.ts +2 -1
- package/src/ngtsc/annotations/component/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/component/src/metadata.d.ts +6 -1
- package/src/ngtsc/annotations/directive/src/handler.d.ts +8 -3
- package/src/ngtsc/annotations/directive/src/shared.d.ts +5 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -0
- package/src/ngtsc/annotations/src/pipe.d.ts +1 -0
- package/src/ngtsc/core/api/src/options.d.ts +4 -0
- package/src/ngtsc/core/src/compiler.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/error_code.d.ts +12 -0
- package/src/ngtsc/metadata/index.d.ts +1 -0
- package/src/ngtsc/metadata/src/api.d.ts +41 -0
- package/src/ngtsc/metadata/src/host_directives_resolver.d.ts +28 -0
- package/src/ngtsc/metadata/src/util.d.ts +3 -2
- package/src/ngtsc/scope/src/typecheck.d.ts +4 -3
- package/src/ngtsc/ts_compatibility/index.d.ts +9 -0
- package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +161 -0
- package/src/ngtsc/typecheck/api/checker.d.ts +14 -4
- package/src/ngtsc/typecheck/src/checker.d.ts +5 -1
- package/src/ngtsc/typecheck/src/ts_util.d.ts +0 -7
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +1 -1
- package/bundles/chunk-AHYRDQYO.js.map +0 -6
- package/bundles/chunk-AMYIDAXN.js.map +0 -6
- package/bundles/chunk-GQHLKW4T.js.map +0 -6
- package/bundles/chunk-I34YWN6W.js.map +0 -6
- package/bundles/chunk-IJA2BQQH.js.map +0 -6
- package/bundles/chunk-WJ34B4FT.js.map +0 -6
- package/bundles/chunk-ZSQCUET7.js.map +0 -6
|
@@ -6,7 +6,7 @@ import { CycleAnalyzer, ImportGraph } from '../../../src/ngtsc/cycles';
|
|
|
6
6
|
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
7
7
|
import { ModuleResolver, PrivateExportAliasingHost, ReferenceEmitter } from '../../../src/ngtsc/imports';
|
|
8
8
|
import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
|
|
9
|
-
import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry } from '../../../src/ngtsc/metadata';
|
|
9
|
+
import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, HostDirectivesResolver, InjectableClassRegistry, LocalMetadataRegistry } from '../../../src/ngtsc/metadata';
|
|
10
10
|
import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
|
|
11
11
|
import { LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver, TypeCheckScopeRegistry } from '../../../src/ngtsc/scope';
|
|
12
12
|
import { DecoratorHandler } from '../../../src/ngtsc/transform';
|
|
@@ -60,6 +60,7 @@ export declare class DecorationAnalyzer {
|
|
|
60
60
|
importGraph: ImportGraph;
|
|
61
61
|
cycleAnalyzer: CycleAnalyzer;
|
|
62
62
|
injectableRegistry: InjectableClassRegistry;
|
|
63
|
+
hostDirectivesResolver: HostDirectivesResolver;
|
|
63
64
|
typeCheckScopeRegistry: TypeCheckScopeRegistry;
|
|
64
65
|
handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[];
|
|
65
66
|
compiler: NgccTraitCompiler;
|
|
@@ -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 = "
|
|
12
|
+
export declare const NGCC_VERSION = "15.0.0-next.0";
|
|
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": "
|
|
3
|
+
"version": "15.0.0-next.0",
|
|
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": "
|
|
69
|
-
"typescript": ">=4.6.2 <4.
|
|
68
|
+
"@angular/compiler": "15.0.0-next.0",
|
|
69
|
+
"typescript": ">=4.6.2 <4.9"
|
|
70
70
|
},
|
|
71
71
|
"repository": {
|
|
72
72
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { FatalDiagnosticError } from '../../../diagnostics';
|
|
11
11
|
import { Reference } from '../../../imports';
|
|
12
|
-
import { InjectableClassRegistry, MetadataReader } from '../../../metadata';
|
|
12
|
+
import { HostDirectiveMeta, InjectableClassRegistry, 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';
|
|
@@ -40,5 +40,6 @@ export declare function createValueHasWrongTypeError(node: ts.Node, value: Resol
|
|
|
40
40
|
*/
|
|
41
41
|
export declare function getProviderDiagnostics(providerClasses: Set<Reference<ClassDeclaration>>, providersDeclaration: ts.Expression, registry: InjectableClassRegistry): ts.Diagnostic[];
|
|
42
42
|
export declare function getDirectiveDiagnostics(node: ClassDeclaration, reader: MetadataReader, evaluator: PartialEvaluator, reflector: ReflectionHost, scopeRegistry: LocalModuleScopeRegistry, kind: string): ts.Diagnostic[] | null;
|
|
43
|
+
export declare function validateHostDirectives(origin: ts.Expression, hostDirectives: HostDirectiveMeta[], metaReader: MetadataReader): ts.DiagnosticWithLocation[];
|
|
43
44
|
export declare function getUndecoratedClassWithAngularFeaturesDiagnostic(node: ClassDeclaration): ts.Diagnostic;
|
|
44
45
|
export declare function checkInheritanceOfDirective(node: ClassDeclaration, reader: MetadataReader, reflector: ReflectionHost, evaluator: PartialEvaluator): ts.Diagnostic | null;
|
|
@@ -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 { InjectableClassRegistry, MetadataReader, MetadataRegistry, ResourceRegistry } from '../../../metadata';
|
|
16
|
+
import { HostDirectivesResolver, InjectableClassRegistry, 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';
|
|
@@ -55,7 +55,8 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
55
55
|
private semanticDepGraphUpdater;
|
|
56
56
|
private annotateForClosureCompiler;
|
|
57
57
|
private perf;
|
|
58
|
-
|
|
58
|
+
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);
|
|
59
60
|
private literalCache;
|
|
60
61
|
private elementSchemaRegistry;
|
|
61
62
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { AnimationTriggerNames, R3ClassMetadata, R3ComponentMetadata, R3TemplateDependencyMetadata, SchemaMetadata } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { Reference } from '../../../imports';
|
|
12
|
-
import { ClassPropertyMapping, ComponentResources, DirectiveTypeCheckMeta } from '../../../metadata';
|
|
12
|
+
import { ClassPropertyMapping, ComponentResources, DirectiveTypeCheckMeta, HostDirectiveMeta } from '../../../metadata';
|
|
13
13
|
import { ClassDeclaration } from '../../../reflection';
|
|
14
14
|
import { SubsetOfKeys } from '../../../util/src/typescript';
|
|
15
15
|
import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
|
|
@@ -56,5 +56,10 @@ export interface ComponentAnalysisData {
|
|
|
56
56
|
rawImports: ts.Expression | null;
|
|
57
57
|
resolvedImports: Reference<ClassDeclaration>[] | null;
|
|
58
58
|
schemas: SchemaMetadata[] | null;
|
|
59
|
+
decorator: ts.Decorator | null;
|
|
60
|
+
/** Additional directives applied to the component host. */
|
|
61
|
+
hostDirectives: HostDirectiveMeta[] | null;
|
|
62
|
+
/** Raw expression that defined the host directives array. Used for diagnostics. */
|
|
63
|
+
rawHostDirectives: ts.Expression | null;
|
|
59
64
|
}
|
|
60
65
|
export declare type ComponentResolutionData = Pick<R3ComponentMetadata<R3TemplateDependencyMetadata>, ComponentMetadataResolvedFields>;
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive/src/handler" />
|
|
9
9
|
import { ConstantPool, R3ClassMetadata, R3DirectiveMetadata } from '@angular/compiler';
|
|
10
|
-
import
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
11
12
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
12
|
-
import { ClassPropertyMapping, DirectiveTypeCheckMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
13
|
+
import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
13
14
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
14
15
|
import { PerfRecorder } from '../../../perf';
|
|
15
16
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
@@ -26,6 +27,9 @@ export interface DirectiveHandlerData {
|
|
|
26
27
|
outputs: ClassPropertyMapping;
|
|
27
28
|
isPoisoned: boolean;
|
|
28
29
|
isStructural: boolean;
|
|
30
|
+
decorator: ts.Decorator | null;
|
|
31
|
+
hostDirectives: HostDirectiveMeta[] | null;
|
|
32
|
+
rawHostDirectives: ts.Expression | null;
|
|
29
33
|
}
|
|
30
34
|
export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decorator | null, DirectiveHandlerData, DirectiveSymbol, unknown> {
|
|
31
35
|
private reflector;
|
|
@@ -34,12 +38,13 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
|
|
|
34
38
|
private scopeRegistry;
|
|
35
39
|
private metaReader;
|
|
36
40
|
private injectableRegistry;
|
|
41
|
+
private refEmitter;
|
|
37
42
|
private isCore;
|
|
38
43
|
private semanticDepGraphUpdater;
|
|
39
44
|
private annotateForClosureCompiler;
|
|
40
45
|
private compileUndecoratedClassesWithAngularFeatures;
|
|
41
46
|
private perf;
|
|
42
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, isCore: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, compileUndecoratedClassesWithAngularFeatures: boolean, perf: PerfRecorder);
|
|
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);
|
|
43
48
|
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
44
49
|
readonly name: string;
|
|
45
50
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive/src/shared" />
|
|
9
9
|
import { ParsedHostBindings, R3DirectiveMetadata, R3QueryMetadata } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
|
-
import {
|
|
11
|
+
import { ReferenceEmitter } from '../../../imports';
|
|
12
|
+
import { ClassPropertyMapping, HostDirectiveMeta } from '../../../metadata';
|
|
12
13
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
13
14
|
import { ClassDeclaration, ClassMember, Decorator, ReflectionHost } from '../../../reflection';
|
|
14
15
|
import { HandlerFlags } from '../../../transform';
|
|
@@ -18,12 +19,14 @@ import { HandlerFlags } from '../../../transform';
|
|
|
18
19
|
* appear in the declarations of an `NgModule` and additional verification is done when processing
|
|
19
20
|
* the module.
|
|
20
21
|
*/
|
|
21
|
-
export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, flags: HandlerFlags, annotateForClosureCompiler: boolean, defaultSelector?: string | null): {
|
|
22
|
+
export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, refEmitter: ReferenceEmitter, isCore: boolean, flags: HandlerFlags, annotateForClosureCompiler: boolean, defaultSelector?: string | null): {
|
|
22
23
|
decorator: Map<string, ts.Expression>;
|
|
23
24
|
metadata: R3DirectiveMetadata;
|
|
24
25
|
inputs: ClassPropertyMapping;
|
|
25
26
|
outputs: ClassPropertyMapping;
|
|
26
27
|
isStructural: boolean;
|
|
28
|
+
hostDirectives: HostDirectiveMeta[] | null;
|
|
29
|
+
rawHostDirectives: ts.Expression | null;
|
|
27
30
|
} | undefined;
|
|
28
31
|
export declare function extractQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
|
|
29
32
|
export declare function extractHostBindings(members: ClassMember[], evaluator: PartialEvaluator, coreModule: string | undefined, metadata?: Map<string, ts.Expression>): ParsedHostBindings;
|
|
@@ -36,6 +36,7 @@ export interface NgModuleAnalysis {
|
|
|
36
36
|
providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
37
37
|
providers: ts.Expression | null;
|
|
38
38
|
remoteScopesMayRequireCycleProtection: boolean;
|
|
39
|
+
decorator: ts.Decorator | null;
|
|
39
40
|
}
|
|
40
41
|
export interface NgModuleResolution {
|
|
41
42
|
injectorImports: Expression[];
|
|
@@ -12,6 +12,10 @@ import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, Mi
|
|
|
12
12
|
* Non-public options which are useful during testing of the compiler.
|
|
13
13
|
*/
|
|
14
14
|
export interface TestOnlyOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Enable the Language Service APIs for template type-checking for tests.
|
|
17
|
+
*/
|
|
18
|
+
_enableTemplateTypeChecker?: boolean;
|
|
15
19
|
/**
|
|
16
20
|
* An option to enable ngtsc's internal performance tracing.
|
|
17
21
|
*
|
|
@@ -100,7 +100,6 @@ export declare class NgCompiler {
|
|
|
100
100
|
readonly programDriver: ProgramDriver;
|
|
101
101
|
readonly incrementalStrategy: IncrementalBuildStrategy;
|
|
102
102
|
readonly incrementalCompilation: IncrementalCompilation;
|
|
103
|
-
readonly enableTemplateTypeChecker: boolean;
|
|
104
103
|
readonly usePoisonedData: boolean;
|
|
105
104
|
private livePerfRecorder;
|
|
106
105
|
/**
|
|
@@ -130,6 +129,7 @@ export declare class NgCompiler {
|
|
|
130
129
|
private cycleAnalyzer;
|
|
131
130
|
readonly ignoreForDiagnostics: Set<ts.SourceFile>;
|
|
132
131
|
readonly ignoreForEmit: Set<ts.SourceFile>;
|
|
132
|
+
readonly enableTemplateTypeChecker: boolean;
|
|
133
133
|
/**
|
|
134
134
|
* `NgCompiler` can be reused for multiple compilations (for resource-only changes), and each
|
|
135
135
|
* new compilation uses a fresh `PerfRecorder`. Thus, classes created with a lifespan of the
|
|
@@ -59,6 +59,18 @@ export declare enum ErrorCode {
|
|
|
59
59
|
* Raised when a type in the `imports` of a component is not a directive, pipe, or NgModule.
|
|
60
60
|
*/
|
|
61
61
|
COMPONENT_UNKNOWN_IMPORT = 2012,
|
|
62
|
+
/**
|
|
63
|
+
* Raised when the compiler wasn't able to resolve the metadata of a host directive.
|
|
64
|
+
*/
|
|
65
|
+
HOST_DIRECTIVE_INVALID = 2013,
|
|
66
|
+
/**
|
|
67
|
+
* Raised when a host directive isn't standalone.
|
|
68
|
+
*/
|
|
69
|
+
HOST_DIRECTIVE_NOT_STANDALONE = 2014,
|
|
70
|
+
/**
|
|
71
|
+
* Raised when a host directive is a component.
|
|
72
|
+
*/
|
|
73
|
+
HOST_DIRECTIVE_COMPONENT = 2015,
|
|
62
74
|
SYMBOL_NOT_EXPORTED = 3001,
|
|
63
75
|
/**
|
|
64
76
|
* Raised when a relationship between directives and/or pipes would cause a cyclic import to be
|
|
@@ -13,3 +13,4 @@ export { CompoundMetadataRegistry, LocalMetadataRegistry, InjectableClassRegistr
|
|
|
13
13
|
export { ResourceRegistry, Resource, ComponentResources, isExternalResource, ExternalResource } from './src/resource_registry';
|
|
14
14
|
export { extractDirectiveTypeCheckMeta, CompoundMetadataReader } from './src/util';
|
|
15
15
|
export { BindingPropertyName, ClassPropertyMapping, ClassPropertyName, InputOrOutput } from './src/property_mapping';
|
|
16
|
+
export { HostDirectivesResolver } from './src/host_directives_resolver';
|
|
@@ -42,6 +42,12 @@ export interface NgModuleMeta {
|
|
|
42
42
|
* because the module came from a .d.ts file).
|
|
43
43
|
*/
|
|
44
44
|
rawExports: ts.Expression | null;
|
|
45
|
+
/**
|
|
46
|
+
* The primary decorator associated with this `ngModule`.
|
|
47
|
+
*
|
|
48
|
+
* If this is `null`, no decorator exists, meaning it's probably from a .d.ts file.
|
|
49
|
+
*/
|
|
50
|
+
decorator: ts.Decorator | null;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
53
|
* Typing metadata collected for a directive within an NgModule's scope.
|
|
@@ -90,11 +96,22 @@ export declare enum MetaKind {
|
|
|
90
96
|
Pipe = 1,
|
|
91
97
|
NgModule = 2
|
|
92
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Possible ways that a directive can be matched.
|
|
101
|
+
*/
|
|
102
|
+
export declare enum MatchSource {
|
|
103
|
+
/** The directive was matched by its selector. */
|
|
104
|
+
Selector = 0,
|
|
105
|
+
/** The directive was applied as a host directive. */
|
|
106
|
+
HostDirective = 1
|
|
107
|
+
}
|
|
93
108
|
/**
|
|
94
109
|
* Metadata collected for a directive within an NgModule's scope.
|
|
95
110
|
*/
|
|
96
111
|
export interface DirectiveMeta extends T2DirectiveMeta, DirectiveTypeCheckMeta {
|
|
97
112
|
kind: MetaKind.Directive;
|
|
113
|
+
/** Way in which the directive was matched. */
|
|
114
|
+
matchSource: MatchSource;
|
|
98
115
|
ref: Reference<ClassDeclaration>;
|
|
99
116
|
/**
|
|
100
117
|
* Unparsed selector of the directive, or null if the directive does not have a selector.
|
|
@@ -137,6 +154,29 @@ export interface DirectiveMeta extends T2DirectiveMeta, DirectiveTypeCheckMeta {
|
|
|
137
154
|
* For standalone components, the list of schemas declared.
|
|
138
155
|
*/
|
|
139
156
|
schemas: SchemaMetadata[] | null;
|
|
157
|
+
/**
|
|
158
|
+
* The primary decorator associated with this directive.
|
|
159
|
+
*
|
|
160
|
+
* If this is `null`, no decorator exists, meaning it's probably from a .d.ts file.
|
|
161
|
+
*/
|
|
162
|
+
decorator: ts.Decorator | null;
|
|
163
|
+
/** Additional directives applied to the directive host. */
|
|
164
|
+
hostDirectives: HostDirectiveMeta[] | null;
|
|
165
|
+
}
|
|
166
|
+
/** Metadata collected about an additional directive that is being applied to a directive host. */
|
|
167
|
+
export interface HostDirectiveMeta {
|
|
168
|
+
/** Reference to the host directive class. */
|
|
169
|
+
directive: Reference<ClassDeclaration>;
|
|
170
|
+
/** Whether the reference to the host directive is a forward reference. */
|
|
171
|
+
isForwardReference: boolean;
|
|
172
|
+
/** Inputs from the host directive that have been exposed. */
|
|
173
|
+
inputs: {
|
|
174
|
+
[publicName: string]: string;
|
|
175
|
+
} | null;
|
|
176
|
+
/** Outputs from the host directive that have been exposed. */
|
|
177
|
+
outputs: {
|
|
178
|
+
[publicName: string]: string;
|
|
179
|
+
} | null;
|
|
140
180
|
}
|
|
141
181
|
/**
|
|
142
182
|
* Metadata that describes a template guard for one of the directive's inputs.
|
|
@@ -164,6 +204,7 @@ export interface PipeMeta {
|
|
|
164
204
|
name: string;
|
|
165
205
|
nameExpr: ts.Expression | null;
|
|
166
206
|
isStandalone: boolean;
|
|
207
|
+
decorator: ts.Decorator | null;
|
|
167
208
|
}
|
|
168
209
|
/**
|
|
169
210
|
* Reads metadata for directives, pipes, and modules from a particular source, such as .d.ts files
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/metadata/src/host_directives_resolver" />
|
|
9
|
+
import { DirectiveMeta, MetadataReader } from '../../metadata/src/api';
|
|
10
|
+
/** Resolves the host directives of a directive to a flat array of matches. */
|
|
11
|
+
export declare class HostDirectivesResolver {
|
|
12
|
+
private metaReader;
|
|
13
|
+
private cache;
|
|
14
|
+
constructor(metaReader: MetadataReader);
|
|
15
|
+
/** Resolves all of the host directives that apply to a directive. */
|
|
16
|
+
resolve(metadata: DirectiveMeta): ReadonlyArray<DirectiveMeta>;
|
|
17
|
+
/**
|
|
18
|
+
* Traverses all of the host directive chains and produces a flat array of
|
|
19
|
+
* directive metadata representing the host directives that apply to the host.
|
|
20
|
+
*/
|
|
21
|
+
private walkHostDirectives;
|
|
22
|
+
/**
|
|
23
|
+
* Filters the class property mappings so that only the allowed ones are present.
|
|
24
|
+
* @param source Property mappings that should be filtered.
|
|
25
|
+
* @param allowedProperties Property mappings that are allowed in the final results.
|
|
26
|
+
*/
|
|
27
|
+
private filterMappings;
|
|
28
|
+
}
|
|
@@ -12,10 +12,11 @@ import { ClassDeclaration, ReflectionHost } from '../../reflection';
|
|
|
12
12
|
import { DirectiveMeta, DirectiveTypeCheckMeta, MetadataReader, NgModuleMeta, PipeMeta } from './api';
|
|
13
13
|
import { ClassPropertyMapping } from './property_mapping';
|
|
14
14
|
export declare function extractReferencesFromType(checker: ts.TypeChecker, def: ts.TypeNode, bestGuessOwningModule: OwningModule | null): Reference<ClassDeclaration>[];
|
|
15
|
+
export declare function extraReferenceFromTypeQuery(checker: ts.TypeChecker, typeNode: ts.TypeQueryNode, origin: ts.TypeNode, bestGuessOwningModule: OwningModule | null): Reference<ClassDeclaration<ts.ClassDeclaration>>;
|
|
15
16
|
export declare function readBooleanType(type: ts.TypeNode): boolean | null;
|
|
16
17
|
export declare function readStringType(type: ts.TypeNode): string | null;
|
|
17
|
-
export declare function
|
|
18
|
-
[key: string]:
|
|
18
|
+
export declare function readMapType<T>(type: ts.TypeNode, valueTransform: (type: ts.TypeNode) => T | null): {
|
|
19
|
+
[key: string]: T;
|
|
19
20
|
};
|
|
20
21
|
export declare function readStringArrayType(type: ts.TypeNode): string[];
|
|
21
22
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { SchemaMetadata, SelectorMatcher } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
11
|
import { Reference } from '../../imports';
|
|
12
|
-
import { DirectiveMeta, MetadataReader } from '../../metadata';
|
|
12
|
+
import { DirectiveMeta, HostDirectivesResolver, MetadataReader } from '../../metadata';
|
|
13
13
|
import { ClassDeclaration } from '../../reflection';
|
|
14
14
|
import { ComponentScopeReader } from './api';
|
|
15
15
|
/**
|
|
@@ -20,7 +20,7 @@ export interface TypeCheckScope {
|
|
|
20
20
|
* A `SelectorMatcher` instance that contains the flattened directive metadata of all directives
|
|
21
21
|
* that are in the compilation scope of the declaring NgModule.
|
|
22
22
|
*/
|
|
23
|
-
matcher: SelectorMatcher<DirectiveMeta>;
|
|
23
|
+
matcher: SelectorMatcher<DirectiveMeta[]>;
|
|
24
24
|
/**
|
|
25
25
|
* All of the directives available in the compilation scope of the declaring NgModule.
|
|
26
26
|
*/
|
|
@@ -45,6 +45,7 @@ export interface TypeCheckScope {
|
|
|
45
45
|
export declare class TypeCheckScopeRegistry {
|
|
46
46
|
private scopeReader;
|
|
47
47
|
private metaReader;
|
|
48
|
+
private hostDirectivesResolver;
|
|
48
49
|
/**
|
|
49
50
|
* Cache of flattened directive metadata. Because flattened metadata is scope-invariant it's
|
|
50
51
|
* cached individually, such that all scopes refer to the same flattened metadata.
|
|
@@ -54,7 +55,7 @@ export declare class TypeCheckScopeRegistry {
|
|
|
54
55
|
* Cache of the computed type check scope per NgModule declaration.
|
|
55
56
|
*/
|
|
56
57
|
private scopeCache;
|
|
57
|
-
constructor(scopeReader: ComponentScopeReader, metaReader: MetadataReader);
|
|
58
|
+
constructor(scopeReader: ComponentScopeReader, metaReader: MetadataReader, hostDirectivesResolver: HostDirectivesResolver);
|
|
58
59
|
/**
|
|
59
60
|
* Computes the type-check scope information for the component declaration. If the NgModule
|
|
60
61
|
* contains an error, then 'error' is returned. If the component is not declared in any NgModule,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/ts_compatibility" />
|
|
9
|
+
export * from './src/ts_cross_version_utils';
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/ts_compatibility/src/ts_cross_version_utils" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
/** Equivalent of `ts.ModifierLike` which is only present in TS 4.8+. */
|
|
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
|
+
/** Type of `ts.factory.updateParameterDeclaration` in TS 4.8+. */
|
|
22
|
+
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
|
+
/**
|
|
24
|
+
* Updates a `ts.ParameterDeclaration` declaration.
|
|
25
|
+
*
|
|
26
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
27
|
+
* We should remove it once we have dropped support for the older versions.
|
|
28
|
+
*/
|
|
29
|
+
export declare const updateParameterDeclaration: Ts48UpdateParameterDeclarationFn;
|
|
30
|
+
/** Type of `ts.factory.updateImportDeclaration` in TS 4.8+. */
|
|
31
|
+
declare type Ts48UpdateImportDeclarationFn = (node: ts.ImportDeclaration, modifiers: readonly ts.Modifier[] | undefined, importClause: ts.ImportClause | undefined, moduleSpecifier: ts.Expression, assertClause: ts.AssertClause | undefined) => ts.ImportDeclaration;
|
|
32
|
+
/**
|
|
33
|
+
* Updates a `ts.ImportDeclaration` declaration.
|
|
34
|
+
*
|
|
35
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
36
|
+
* We should remove it once we have dropped support for the older versions.
|
|
37
|
+
*/
|
|
38
|
+
export declare const updateImportDeclaration: Ts48UpdateImportDeclarationFn;
|
|
39
|
+
/** Type of `ts.factory.updateClassDeclaration` in TS 4.8+. */
|
|
40
|
+
declare type Ts48UpdateClassDeclarationFn = (node: ts.ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ts.Identifier | undefined, typeParameters: readonly ts.TypeParameterDeclaration[] | undefined, heritageClauses: readonly ts.HeritageClause[] | undefined, members: readonly ts.ClassElement[]) => ts.ClassDeclaration;
|
|
41
|
+
/**
|
|
42
|
+
* Updates a `ts.ClassDeclaration` declaration.
|
|
43
|
+
*
|
|
44
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
45
|
+
* We should remove it once we have dropped support for the older versions.
|
|
46
|
+
*/
|
|
47
|
+
export declare const updateClassDeclaration: Ts48UpdateClassDeclarationFn;
|
|
48
|
+
/** Type of `ts.factory.createClassDeclaration` in TS 4.8+. */
|
|
49
|
+
declare type Ts48CreateClassDeclarationFn = (modifiers: readonly ModifierLike[] | undefined, name: ts.Identifier | undefined, typeParameters: readonly ts.TypeParameterDeclaration[] | undefined, heritageClauses: readonly ts.HeritageClause[] | undefined, members: readonly ts.ClassElement[]) => ts.ClassDeclaration;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a `ts.ClassDeclaration` declaration.
|
|
52
|
+
*
|
|
53
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
54
|
+
* We should remove it once we have dropped support for the older versions.
|
|
55
|
+
*/
|
|
56
|
+
export declare const createClassDeclaration: Ts48CreateClassDeclarationFn;
|
|
57
|
+
/** Type of `ts.factory.updateMethodDeclaration` in TS 4.8+. */
|
|
58
|
+
declare type Ts48UpdateMethodDeclarationFn = (node: ts.MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: ts.AsteriskToken | undefined, name: ts.PropertyName, questionToken: ts.QuestionToken | undefined, typeParameters: readonly ts.TypeParameterDeclaration[] | undefined, parameters: readonly ts.ParameterDeclaration[], type: ts.TypeNode | undefined, body: ts.Block | undefined) => ts.MethodDeclaration;
|
|
59
|
+
/**
|
|
60
|
+
* Updates a `ts.MethodDeclaration` declaration.
|
|
61
|
+
*
|
|
62
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
63
|
+
* We should remove it once we have dropped support for the older versions.
|
|
64
|
+
*/
|
|
65
|
+
export declare const updateMethodDeclaration: Ts48UpdateMethodDeclarationFn;
|
|
66
|
+
/** Type of `ts.factory.createMethodDeclaration` in TS 4.8+. */
|
|
67
|
+
declare type Ts48CreateMethodDeclarationFn = (modifiers: readonly ModifierLike[] | undefined, asteriskToken: ts.AsteriskToken | undefined, name: ts.PropertyName, questionToken: ts.QuestionToken | undefined, typeParameters: readonly ts.TypeParameterDeclaration[] | undefined, parameters: readonly ts.ParameterDeclaration[], type: ts.TypeNode | undefined, body: ts.Block | undefined) => ts.MethodDeclaration;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a `ts.MethodDeclaration` declaration.
|
|
70
|
+
*
|
|
71
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
72
|
+
* We should remove it once we have dropped support for the older versions.
|
|
73
|
+
*/
|
|
74
|
+
export declare const createMethodDeclaration: Ts48CreateMethodDeclarationFn;
|
|
75
|
+
/** Type of `ts.factory.updatePropertyDeclaration` in TS 4.8+. */
|
|
76
|
+
declare type Ts48UpdatePropertyDeclarationFn = (node: ts.PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | ts.PropertyName, questionOrExclamationToken: ts.QuestionToken | ts.ExclamationToken | undefined, type: ts.TypeNode | undefined, initializer: ts.Expression | undefined) => ts.PropertyDeclaration;
|
|
77
|
+
/**
|
|
78
|
+
* Updates a `ts.PropertyDeclaration` declaration.
|
|
79
|
+
*
|
|
80
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
81
|
+
* We should remove it once we have dropped support for the older versions.
|
|
82
|
+
*/
|
|
83
|
+
export declare const updatePropertyDeclaration: Ts48UpdatePropertyDeclarationFn;
|
|
84
|
+
/** Type of `ts.factory.createPropertyDeclaration` in TS 4.8+. */
|
|
85
|
+
declare type Ts48CreatePropertyDeclarationFn = (modifiers: readonly ModifierLike[] | undefined, name: string | ts.PropertyName, questionOrExclamationToken: ts.QuestionToken | ts.ExclamationToken | undefined, type: ts.TypeNode | undefined, initializer: ts.Expression | undefined) => ts.PropertyDeclaration;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a `ts.PropertyDeclaration` declaration.
|
|
88
|
+
*
|
|
89
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
90
|
+
* We should remove it once we have dropped support for the older versions.
|
|
91
|
+
*/
|
|
92
|
+
export declare const createPropertyDeclaration: Ts48CreatePropertyDeclarationFn;
|
|
93
|
+
/** Type of `ts.factory.updateGetAccessorDeclaration` in TS 4.8+. */
|
|
94
|
+
declare type Ts48UpdateGetAccessorDeclarationFn = (node: ts.GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ts.PropertyName, parameters: readonly ts.ParameterDeclaration[], type: ts.TypeNode | undefined, body: ts.Block | undefined) => ts.GetAccessorDeclaration;
|
|
95
|
+
/**
|
|
96
|
+
* Updates a `ts.GetAccessorDeclaration` declaration.
|
|
97
|
+
*
|
|
98
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
99
|
+
* We should remove it once we have dropped support for the older versions.
|
|
100
|
+
*/
|
|
101
|
+
export declare const updateGetAccessorDeclaration: Ts48UpdateGetAccessorDeclarationFn;
|
|
102
|
+
/** Type of `ts.factory.createGetAccessorDeclaration` in TS 4.8+. */
|
|
103
|
+
declare type Ts48CreateGetAccessorDeclarationFn = (modifiers: readonly ModifierLike[] | undefined, name: ts.PropertyName, parameters: readonly ts.ParameterDeclaration[], type: ts.TypeNode | undefined, body: ts.Block | undefined) => ts.GetAccessorDeclaration;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a `ts.GetAccessorDeclaration` declaration.
|
|
106
|
+
*
|
|
107
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
108
|
+
* We should remove it once we have dropped support for the older versions.
|
|
109
|
+
*/
|
|
110
|
+
export declare const createGetAccessorDeclaration: Ts48CreateGetAccessorDeclarationFn;
|
|
111
|
+
/** Type of `ts.factory.updateSetAccessorDeclaration` in TS 4.8+. */
|
|
112
|
+
declare type Ts48UpdateSetAccessorDeclarationFn = (node: ts.SetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ts.PropertyName, parameters: readonly ts.ParameterDeclaration[], body: ts.Block | undefined) => ts.SetAccessorDeclaration;
|
|
113
|
+
/**
|
|
114
|
+
* Updates a `ts.GetAccessorDeclaration` declaration.
|
|
115
|
+
*
|
|
116
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
117
|
+
* We should remove it once we have dropped support for the older versions.
|
|
118
|
+
*/
|
|
119
|
+
export declare const updateSetAccessorDeclaration: Ts48UpdateSetAccessorDeclarationFn;
|
|
120
|
+
/** Type of `ts.factory.createSetAccessorDeclaration` in TS 4.8+. */
|
|
121
|
+
declare type Ts48CreateSetAccessorDeclarationFn = (modifiers: readonly ModifierLike[] | undefined, name: ts.PropertyName, parameters: readonly ts.ParameterDeclaration[], body: ts.Block | undefined) => ts.SetAccessorDeclaration;
|
|
122
|
+
/**
|
|
123
|
+
* Creates a `ts.GetAccessorDeclaration` declaration.
|
|
124
|
+
*
|
|
125
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
126
|
+
* We should remove it once we have dropped support for the older versions.
|
|
127
|
+
*/
|
|
128
|
+
export declare const createSetAccessorDeclaration: Ts48CreateSetAccessorDeclarationFn;
|
|
129
|
+
/** Type of `ts.factory.updateConstructorDeclaration` in TS 4.8+. */
|
|
130
|
+
declare type Ts48UpdateConstructorDeclarationFn = (node: ts.ConstructorDeclaration, modifiers: readonly ts.Modifier[] | undefined, parameters: readonly ts.ParameterDeclaration[], body: ts.Block | undefined) => ts.ConstructorDeclaration;
|
|
131
|
+
/**
|
|
132
|
+
* Updates a `ts.ConstructorDeclaration` declaration.
|
|
133
|
+
*
|
|
134
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
135
|
+
* We should remove it once we have dropped support for the older versions.
|
|
136
|
+
*/
|
|
137
|
+
export declare const updateConstructorDeclaration: Ts48UpdateConstructorDeclarationFn;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the decorators that have been applied to a node.
|
|
140
|
+
*
|
|
141
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
142
|
+
* We should remove it once we have dropped support for the older versions.
|
|
143
|
+
*/
|
|
144
|
+
export declare const getDecorators: (node: ts.Node) => readonly ts.Decorator[] | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Gets the modifiers that have been set on a node.
|
|
147
|
+
*
|
|
148
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
149
|
+
* We should remove it once we have dropped support for the older versions.
|
|
150
|
+
*/
|
|
151
|
+
export declare const getModifiers: (node: ts.Node) => readonly ts.Modifier[] | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Combines an optional array of decorators with an optional array of modifiers into a single
|
|
154
|
+
* `ts.ModifierLike` array. Used in version of TypeScript after 4.8 where the `decorators` and
|
|
155
|
+
* `modifiers` arrays have been combined.
|
|
156
|
+
*
|
|
157
|
+
* TODO(crisbeto): this is a backwards-compatibility layer for versions of TypeScript less than 4.8.
|
|
158
|
+
* We should remove it once we have dropped support for the older versions.
|
|
159
|
+
*/
|
|
160
|
+
export declare function combineModifiers(decorators: readonly ts.Decorator[] | undefined, modifiers: readonly ModifierLike[] | undefined): readonly ModifierLike[] | undefined;
|
|
161
|
+
export {};
|
|
@@ -122,6 +122,16 @@ export interface TemplateTypeChecker {
|
|
|
122
122
|
* the DOM schema.
|
|
123
123
|
*/
|
|
124
124
|
getPotentialElementTags(component: ts.ClassDeclaration): Map<string, DirectiveInScope | null>;
|
|
125
|
+
/**
|
|
126
|
+
* Get the primary decorator for an Angular class (such as @Component). This does not work for
|
|
127
|
+
* `@Injectable`.
|
|
128
|
+
*/
|
|
129
|
+
getPrimaryAngularDecorator(target: ts.ClassDeclaration): ts.Decorator | null;
|
|
130
|
+
/**
|
|
131
|
+
* Get the class of the NgModule that owns this Angular trait. If the result is `null`, that
|
|
132
|
+
* probably means the provided component is standalone.
|
|
133
|
+
*/
|
|
134
|
+
getOwningNgModule(component: ts.ClassDeclaration): ts.ClassDeclaration | null;
|
|
125
135
|
/**
|
|
126
136
|
* Retrieve any potential DOM bindings for the given element.
|
|
127
137
|
*
|
|
@@ -161,16 +171,16 @@ export interface TemplateTypeChecker {
|
|
|
161
171
|
*/
|
|
162
172
|
export declare enum OptimizeFor {
|
|
163
173
|
/**
|
|
164
|
-
* Indicates that a consumer of a `TemplateTypeChecker` is only interested in results for a
|
|
165
|
-
* file, and wants them as fast as possible.
|
|
174
|
+
* Indicates that a consumer of a `TemplateTypeChecker` is only interested in results for a
|
|
175
|
+
* given file, and wants them as fast as possible.
|
|
166
176
|
*
|
|
167
177
|
* Calling `TemplateTypeChecker` methods successively for multiple files while specifying
|
|
168
178
|
* `OptimizeFor.SingleFile` can result in significant unnecessary overhead overall.
|
|
169
179
|
*/
|
|
170
180
|
SingleFile = 0,
|
|
171
181
|
/**
|
|
172
|
-
* Indicates that a consumer of a `TemplateTypeChecker` intends to query for results pertaining
|
|
173
|
-
* the entire user program, and so the type-checker should internally optimize for this case.
|
|
182
|
+
* Indicates that a consumer of a `TemplateTypeChecker` intends to query for results pertaining
|
|
183
|
+
* to the entire user program, and so the type-checker should internally optimize for this case.
|
|
174
184
|
*
|
|
175
185
|
* Initial calls to retrieve type-checking information may take longer, but repeated calls to
|
|
176
186
|
* gather information for the whole user program will be significantly faster with this mode of
|