@angular/compiler-cli 14.0.0-next.1 → 14.0.0-next.2
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-XNYP2SFR.js → chunk-2XJJHADR.js} +30 -26
- package/bundles/chunk-2XJJHADR.js.map +6 -0
- package/bundles/{chunk-K2Z44JHH.js → chunk-3WNAIXKA.js} +7 -7
- package/bundles/{chunk-K2Z44JHH.js.map → chunk-3WNAIXKA.js.map} +0 -0
- package/bundles/{chunk-4KQK6VRA.js → chunk-4EUDG74G.js} +71 -71
- package/bundles/{chunk-4KQK6VRA.js.map → chunk-4EUDG74G.js.map} +1 -1
- package/bundles/{chunk-ALKVYGAK.js → chunk-4N4Y5TPT.js} +36 -33
- package/bundles/chunk-4N4Y5TPT.js.map +6 -0
- package/bundles/{chunk-QDWL7SZJ.js → chunk-BPCUCINV.js} +2 -2
- package/bundles/{chunk-QDWL7SZJ.js.map → chunk-BPCUCINV.js.map} +0 -0
- package/bundles/{chunk-GLCRIILX.js → chunk-J6CW3T62.js} +5 -5
- package/bundles/{chunk-GLCRIILX.js.map → chunk-J6CW3T62.js.map} +0 -0
- package/bundles/{chunk-CKFLH7L7.js → chunk-JL6TC6CB.js} +87 -87
- package/bundles/{chunk-CKFLH7L7.js.map → chunk-JL6TC6CB.js.map} +1 -1
- package/bundles/{chunk-JMLPLN5C.js → chunk-JR2JHPEZ.js} +40 -40
- package/bundles/{chunk-JMLPLN5C.js.map → chunk-JR2JHPEZ.js.map} +0 -0
- package/bundles/{chunk-SKBLJA43.js → chunk-JTYUTYS2.js} +3 -3
- package/bundles/{chunk-SKBLJA43.js.map → chunk-JTYUTYS2.js.map} +0 -0
- package/bundles/{chunk-Z2HS4HDG.js → chunk-LL4S3DRM.js} +4 -4
- package/bundles/{chunk-Z2HS4HDG.js.map → chunk-LL4S3DRM.js.map} +0 -0
- package/bundles/{chunk-C44PYKVA.js → chunk-N4EP6MZR.js} +1777 -1547
- package/bundles/chunk-N4EP6MZR.js.map +6 -0
- package/bundles/{chunk-FXU7FMZC.js → chunk-QZBA4KSX.js} +7 -7
- package/bundles/{chunk-FXU7FMZC.js.map → chunk-QZBA4KSX.js.map} +0 -0
- package/bundles/{chunk-A5PL3TE6.js → chunk-RNVIUKDY.js} +6 -6
- package/bundles/{chunk-A5PL3TE6.js.map → chunk-RNVIUKDY.js.map} +0 -0
- package/bundles/{chunk-PKOZO2VO.js → chunk-VOXD467J.js} +5 -5
- package/bundles/{chunk-PKOZO2VO.js.map → chunk-VOXD467J.js.map} +0 -0
- package/bundles/{chunk-7PY7XEFH.js → chunk-XXMNTCYN.js} +6 -6
- package/bundles/{chunk-7PY7XEFH.js.map → chunk-XXMNTCYN.js.map} +0 -0
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +12 -12
- package/bundles/ngcc/main-ngcc.js +13 -13
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13 -13
- 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 +5 -5
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/common/index.d.ts +16 -0
- package/src/ngtsc/annotations/{src → common/src}/api.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/di.d.ts +38 -0
- package/src/ngtsc/annotations/{src → common/src}/diagnostics.d.ts +15 -7
- package/src/ngtsc/annotations/common/src/evaluation.d.ts +18 -0
- package/src/ngtsc/annotations/{src → common/src}/factory.d.ts +2 -2
- package/src/ngtsc/annotations/{src → common/src}/metadata.d.ts +2 -2
- package/src/ngtsc/annotations/{src → common/src}/references_registry.d.ts +3 -3
- package/src/ngtsc/annotations/{src → common/src}/util.d.ts +7 -43
- package/src/ngtsc/annotations/component/index.d.ts +9 -0
- package/src/ngtsc/annotations/component/src/diagnostics.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/handler.d.ts +92 -0
- package/src/ngtsc/annotations/component/src/metadata.d.ts +61 -0
- package/src/ngtsc/annotations/component/src/resources.d.ts +123 -0
- package/src/ngtsc/annotations/component/src/scope.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/symbol.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/util.d.ts +24 -0
- package/src/ngtsc/annotations/directive/index.d.ts +11 -0
- package/src/ngtsc/annotations/directive/src/handler.d.ts +59 -0
- package/src/ngtsc/annotations/directive/src/shared.d.ts +30 -0
- package/src/ngtsc/annotations/directive/src/symbol.d.ts +27 -0
- package/src/ngtsc/annotations/index.d.ts +4 -6
- package/src/ngtsc/annotations/ng_module/index.d.ts +9 -0
- package/src/ngtsc/annotations/{src/ng_module.d.ts → ng_module/src/handler.d.ts} +11 -11
- package/src/ngtsc/diagnostics/src/error_code.d.ts +17 -0
- package/src/ngtsc/metadata/src/api.d.ts +5 -0
- package/bundles/chunk-ALKVYGAK.js.map +0 -6
- package/bundles/chunk-C44PYKVA.js.map +0 -6
- package/bundles/chunk-XNYP2SFR.js.map +0 -6
- package/src/ngtsc/annotations/src/component.d.ts +0 -246
- package/src/ngtsc/annotations/src/directive.d.ts +0 -99
|
@@ -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 = "14.0.0-next.
|
|
12
|
+
export declare const NGCC_VERSION = "14.0.0-next.2";
|
|
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": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.2",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"yargs": "^17.2.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@angular/compiler": "14.0.0-next.
|
|
68
|
+
"@angular/compiler": "14.0.0-next.2",
|
|
69
69
|
"typescript": ">=4.4.2 <4.6"
|
|
70
70
|
},
|
|
71
71
|
"repository": {
|
|
@@ -0,0 +1,16 @@
|
|
|
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/annotations/common" />
|
|
9
|
+
export * from './src/api';
|
|
10
|
+
export * from './src/di';
|
|
11
|
+
export * from './src/diagnostics';
|
|
12
|
+
export * from './src/evaluation';
|
|
13
|
+
export * from './src/factory';
|
|
14
|
+
export * from './src/metadata';
|
|
15
|
+
export * from './src/references_registry';
|
|
16
|
+
export * from './src/util';
|
|
@@ -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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/api" />
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/api" />
|
|
9
9
|
/**
|
|
10
10
|
* Resolves and loads resource files that are referenced in Angular metadata.
|
|
11
11
|
*
|
|
@@ -0,0 +1,38 @@
|
|
|
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/annotations/common/src/di" />
|
|
9
|
+
import { R3DependencyMetadata } from '@angular/compiler';
|
|
10
|
+
import { ClassDeclaration, CtorParameter, ReflectionHost, UnavailableValue } from '../../../reflection';
|
|
11
|
+
export declare type ConstructorDeps = {
|
|
12
|
+
deps: R3DependencyMetadata[];
|
|
13
|
+
} | {
|
|
14
|
+
deps: null;
|
|
15
|
+
errors: ConstructorDepError[];
|
|
16
|
+
};
|
|
17
|
+
export interface ConstructorDepError {
|
|
18
|
+
index: number;
|
|
19
|
+
param: CtorParameter;
|
|
20
|
+
reason: UnavailableValue;
|
|
21
|
+
}
|
|
22
|
+
export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): ConstructorDeps | null;
|
|
23
|
+
/**
|
|
24
|
+
* Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
|
|
25
|
+
* or into an `'invalid'` signal if they're not.
|
|
26
|
+
*
|
|
27
|
+
* This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
|
|
28
|
+
*/
|
|
29
|
+
export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
|
|
30
|
+
export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): R3DependencyMetadata[] | null;
|
|
31
|
+
/**
|
|
32
|
+
* Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
|
|
33
|
+
* `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
|
|
34
|
+
*
|
|
35
|
+
* This is a companion function to `unwrapConstructorDependencies` which does not accept invalid
|
|
36
|
+
* deps.
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;
|
|
@@ -5,14 +5,22 @@
|
|
|
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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/diagnostics" />
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/diagnostics" />
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
-
import { FatalDiagnosticError } from '
|
|
11
|
-
import { Reference } from '
|
|
12
|
-
import { InjectableClassRegistry, MetadataReader } from '
|
|
13
|
-
import { PartialEvaluator, ResolvedValue } from '
|
|
14
|
-
import { ClassDeclaration, ReflectionHost } from '
|
|
15
|
-
import { LocalModuleScopeRegistry } from '
|
|
10
|
+
import { FatalDiagnosticError } from '../../../diagnostics';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
import { InjectableClassRegistry, MetadataReader } from '../../../metadata';
|
|
13
|
+
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
|
|
14
|
+
import { ClassDeclaration, ReflectionHost } from '../../../reflection';
|
|
15
|
+
import { DeclarationData, LocalModuleScopeRegistry } from '../../../scope';
|
|
16
|
+
/**
|
|
17
|
+
* Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
|
|
18
|
+
* more NgModules.
|
|
19
|
+
*
|
|
20
|
+
* The resulting `ts.Diagnostic` will have a context entry for each NgModule showing the point where
|
|
21
|
+
* the directive/pipe exists in its `declarations` (if possible).
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeDuplicateDeclarationError(node: ClassDeclaration, data: DeclarationData[], kind: string): ts.Diagnostic;
|
|
16
24
|
/**
|
|
17
25
|
* Creates a `FatalDiagnosticError` for a node that did not evaluate to the expected type. The
|
|
18
26
|
* diagnostic that is created will include details on why the value is incorrect, i.e. it includes
|
|
@@ -0,0 +1,18 @@
|
|
|
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/annotations/common/src/evaluation" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
import { Reference } from '../../../imports';
|
|
11
|
+
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
|
|
12
|
+
import { ClassDeclaration, Decorator } from '../../../reflection';
|
|
13
|
+
export declare function resolveEnumValue(evaluator: PartialEvaluator, metadata: Map<string, ts.Expression>, field: string, enumSymbolName: string): number | null;
|
|
14
|
+
/** Determines if the result of an evaluation is a string array. */
|
|
15
|
+
export declare function isStringArray(resolvedValue: ResolvedValue): resolvedValue is string[];
|
|
16
|
+
export declare function isClassReferenceArray(resolvedValue: ResolvedValue): resolvedValue is Reference<ClassDeclaration>[];
|
|
17
|
+
export declare function isArray(value: ResolvedValue): value is Array<ResolvedValue>;
|
|
18
|
+
export declare function resolveLiteral(decorator: Decorator, literalCache: Map<Decorator, ts.ObjectLiteralExpression>): ts.ObjectLiteralExpression;
|
|
@@ -5,9 +5,9 @@
|
|
|
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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/factory" />
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/factory" />
|
|
9
9
|
import { R3FactoryMetadata } from '@angular/compiler';
|
|
10
|
-
import { CompileResult } from '
|
|
10
|
+
import { CompileResult } from '../../../transform';
|
|
11
11
|
export declare type CompileFactoryFn = (metadata: R3FactoryMetadata) => CompileResult;
|
|
12
12
|
export declare function compileNgFactoryDefField(metadata: R3FactoryMetadata): CompileResult;
|
|
13
13
|
export declare function compileDeclareFactory(metadata: R3FactoryMetadata): CompileResult;
|
|
@@ -5,9 +5,9 @@
|
|
|
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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/metadata" />
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/metadata" />
|
|
9
9
|
import { R3ClassMetadata } from '@angular/compiler';
|
|
10
|
-
import { DeclarationNode, Decorator, ReflectionHost } from '
|
|
10
|
+
import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
|
|
11
11
|
/**
|
|
12
12
|
* Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
|
|
13
13
|
* present on the class or its member fields. An ngDevMode guard is used to allow the call to be
|
|
@@ -5,9 +5,9 @@
|
|
|
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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/references_registry" />
|
|
9
|
-
import { Reference } from '
|
|
10
|
-
import { DeclarationNode } from '
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/references_registry" />
|
|
9
|
+
import { Reference } from '../../../imports';
|
|
10
|
+
import { DeclarationNode } from '../../../reflection';
|
|
11
11
|
/**
|
|
12
12
|
* Implement this interface if you want DecoratorHandlers to register
|
|
13
13
|
* references that they find in their analysis of the code.
|
|
@@ -5,26 +5,13 @@
|
|
|
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.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/util" />
|
|
9
|
-
import { Expression, FactoryTarget, ParseSourceSpan, R3CompiledExpression,
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/common/src/util" />
|
|
9
|
+
import { Expression, FactoryTarget, ParseSourceSpan, R3CompiledExpression, R3FactoryMetadata, R3Reference, Statement, WrappedNodeExpr } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
|
-
import { Reference, ReferenceEmitter } from '
|
|
12
|
-
import { ForeignFunctionResolver, PartialEvaluator } from '
|
|
13
|
-
import { ClassDeclaration,
|
|
14
|
-
import {
|
|
15
|
-
import { CompileResult } from '../../transform';
|
|
16
|
-
export declare type ConstructorDeps = {
|
|
17
|
-
deps: R3DependencyMetadata[];
|
|
18
|
-
} | {
|
|
19
|
-
deps: null;
|
|
20
|
-
errors: ConstructorDepError[];
|
|
21
|
-
};
|
|
22
|
-
export interface ConstructorDepError {
|
|
23
|
-
index: number;
|
|
24
|
-
param: CtorParameter;
|
|
25
|
-
reason: UnavailableValue;
|
|
26
|
-
}
|
|
27
|
-
export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): ConstructorDeps | null;
|
|
11
|
+
import { ImportedFile, ModuleResolver, Reference, ReferenceEmitter } from '../../../imports';
|
|
12
|
+
import { ForeignFunctionResolver, PartialEvaluator } from '../../../partial_evaluator';
|
|
13
|
+
import { ClassDeclaration, Decorator, Import, ImportedTypeValueReference, LocalTypeValueReference, ReflectionHost, TypeValueReference } from '../../../reflection';
|
|
14
|
+
import { CompileResult } from '../../../transform';
|
|
28
15
|
/**
|
|
29
16
|
* Convert a `TypeValueReference` to an `Expression` which refers to the type as a value.
|
|
30
17
|
*
|
|
@@ -34,22 +21,6 @@ export declare function getConstructorDependencies(clazz: ClassDeclaration, refl
|
|
|
34
21
|
*/
|
|
35
22
|
export declare function valueReferenceToExpression(valueRef: LocalTypeValueReference | ImportedTypeValueReference): Expression;
|
|
36
23
|
export declare function valueReferenceToExpression(valueRef: TypeValueReference): Expression | null;
|
|
37
|
-
/**
|
|
38
|
-
* Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
|
|
39
|
-
* or into an `'invalid'` signal if they're not.
|
|
40
|
-
*
|
|
41
|
-
* This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
|
|
42
|
-
*/
|
|
43
|
-
export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
|
|
44
|
-
export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean): R3DependencyMetadata[] | null;
|
|
45
|
-
/**
|
|
46
|
-
* Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
|
|
47
|
-
* `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
|
|
48
|
-
*
|
|
49
|
-
* This is a companion function to `unwrapConstructorDependencies` which does not accept invalid
|
|
50
|
-
* deps.
|
|
51
|
-
*/
|
|
52
|
-
export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;
|
|
53
24
|
export declare function toR3Reference(origin: ts.Node, valueRef: Reference, typeRef: Reference, valueContext: ts.SourceFile, typeContext: ts.SourceFile, refEmitter: ReferenceEmitter): R3Reference;
|
|
54
25
|
export declare function isAngularCore(decorator: Decorator): decorator is Decorator & {
|
|
55
26
|
import: Import;
|
|
@@ -102,14 +73,6 @@ export declare function readBaseClass(node: ClassDeclaration, reflector: Reflect
|
|
|
102
73
|
* @param expression Expression where functions should be wrapped in parentheses
|
|
103
74
|
*/
|
|
104
75
|
export declare function wrapFunctionExpressionsInParens(expression: ts.Expression): ts.Expression;
|
|
105
|
-
/**
|
|
106
|
-
* Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
|
|
107
|
-
* more NgModules.
|
|
108
|
-
*
|
|
109
|
-
* The resulting `ts.Diagnostic` will have a context entry for each NgModule showing the point where
|
|
110
|
-
* the directive/pipe exists in its `declarations` (if possible).
|
|
111
|
-
*/
|
|
112
|
-
export declare function makeDuplicateDeclarationError(node: ClassDeclaration, data: DeclarationData[], kind: string): ts.Diagnostic;
|
|
113
76
|
/**
|
|
114
77
|
* Resolves the given `rawProviders` into `ClassDeclarations` and returns
|
|
115
78
|
* a set containing those that are known to require a factory definition.
|
|
@@ -130,3 +93,4 @@ export declare function createSourceSpan(node: ts.Node): ParseSourceSpan;
|
|
|
130
93
|
*/
|
|
131
94
|
export declare function compileResults(fac: CompileResult, def: R3CompiledExpression, metadataStmt: Statement | null, propName: string): CompileResult[];
|
|
132
95
|
export declare function toFactoryMetadata(meta: Omit<R3FactoryMetadata, 'target'>, target: FactoryTarget): R3FactoryMetadata;
|
|
96
|
+
export declare function resolveImportedFile(moduleResolver: ModuleResolver, importedFile: ImportedFile, expr: Expression, origin: ts.SourceFile): ts.SourceFile | null;
|
|
@@ -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/annotations/component" />
|
|
9
|
+
export { ComponentDecoratorHandler } from './src/handler';
|
|
@@ -0,0 +1,20 @@
|
|
|
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/annotations/component/src/diagnostics" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
import { Cycle } from '../../../cycles';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
/**
|
|
13
|
+
* Generate a diagnostic related information object that describes a potential cyclic import path.
|
|
14
|
+
*/
|
|
15
|
+
export declare function makeCyclicImportInfo(ref: Reference, type: string, cycle: Cycle): ts.DiagnosticRelatedInformation;
|
|
16
|
+
/**
|
|
17
|
+
* Checks whether a selector is a valid custom element tag name.
|
|
18
|
+
* Based loosely on https://github.com/sindresorhus/validate-element-name.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkCustomElementSelectorForErrors(selector: string): string | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
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/annotations/component/src/handler" />
|
|
9
|
+
import { ConstantPool } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { CycleAnalyzer, CycleHandlingStrategy } from '../../../cycles';
|
|
12
|
+
import { ModuleResolver, ReferenceEmitter } from '../../../imports';
|
|
13
|
+
import { DependencyTracker } from '../../../incremental/api';
|
|
14
|
+
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
15
|
+
import { IndexingContext } from '../../../indexer';
|
|
16
|
+
import { InjectableClassRegistry, MetadataReader, MetadataRegistry, ResourceRegistry } from '../../../metadata';
|
|
17
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
18
|
+
import { PerfRecorder } from '../../../perf';
|
|
19
|
+
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
20
|
+
import { ComponentScopeReader, DtsModuleScopeResolver, LocalModuleScopeRegistry, TypeCheckScopeRegistry } from '../../../scope';
|
|
21
|
+
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFlags, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
22
|
+
import { TypeCheckContext } from '../../../typecheck/api';
|
|
23
|
+
import { ExtendedTemplateChecker } from '../../../typecheck/extended/api';
|
|
24
|
+
import { Xi18nContext } from '../../../xi18n';
|
|
25
|
+
import { ResourceLoader } from '../../common';
|
|
26
|
+
import { ComponentAnalysisData, ComponentResolutionData } from './metadata';
|
|
27
|
+
import { ComponentSymbol } from './symbol';
|
|
28
|
+
/**
|
|
29
|
+
* `DecoratorHandler` which handles the `@Component` annotation.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ComponentDecoratorHandler implements DecoratorHandler<Decorator, ComponentAnalysisData, ComponentSymbol, ComponentResolutionData> {
|
|
32
|
+
private reflector;
|
|
33
|
+
private evaluator;
|
|
34
|
+
private metaRegistry;
|
|
35
|
+
private metaReader;
|
|
36
|
+
private scopeReader;
|
|
37
|
+
private dtsScopeReader;
|
|
38
|
+
private scopeRegistry;
|
|
39
|
+
private typeCheckScopeRegistry;
|
|
40
|
+
private resourceRegistry;
|
|
41
|
+
private isCore;
|
|
42
|
+
private resourceLoader;
|
|
43
|
+
private rootDirs;
|
|
44
|
+
private defaultPreserveWhitespaces;
|
|
45
|
+
private i18nUseExternalIds;
|
|
46
|
+
private enableI18nLegacyMessageIdFormat;
|
|
47
|
+
private usePoisonedData;
|
|
48
|
+
private i18nNormalizeLineEndingsInICUs;
|
|
49
|
+
private moduleResolver;
|
|
50
|
+
private cycleAnalyzer;
|
|
51
|
+
private cycleHandlingStrategy;
|
|
52
|
+
private refEmitter;
|
|
53
|
+
private depTracker;
|
|
54
|
+
private injectableRegistry;
|
|
55
|
+
private semanticDepGraphUpdater;
|
|
56
|
+
private annotateForClosureCompiler;
|
|
57
|
+
private perf;
|
|
58
|
+
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);
|
|
59
|
+
private literalCache;
|
|
60
|
+
private elementSchemaRegistry;
|
|
61
|
+
/**
|
|
62
|
+
* During the asynchronous preanalyze phase, it's necessary to parse the template to extract
|
|
63
|
+
* any potential <link> tags which might need to be loaded. This cache ensures that work is not
|
|
64
|
+
* thrown away, and the parsed template is reused during the analyze phase.
|
|
65
|
+
*/
|
|
66
|
+
private preanalyzeTemplateCache;
|
|
67
|
+
private preanalyzeStylesCache;
|
|
68
|
+
private extractTemplateOptions;
|
|
69
|
+
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator> | undefined;
|
|
72
|
+
preanalyze(node: ClassDeclaration, decorator: Readonly<Decorator>): Promise<void> | undefined;
|
|
73
|
+
analyze(node: ClassDeclaration, decorator: Readonly<Decorator>, flags?: HandlerFlags): AnalysisOutput<ComponentAnalysisData>;
|
|
74
|
+
symbol(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): ComponentSymbol;
|
|
75
|
+
register(node: ClassDeclaration, analysis: ComponentAnalysisData): void;
|
|
76
|
+
index(context: IndexingContext, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): null | undefined;
|
|
77
|
+
typeCheck(ctx: TypeCheckContext, node: ClassDeclaration, meta: Readonly<ComponentAnalysisData>): void;
|
|
78
|
+
extendedTemplateCheck(component: ts.ClassDeclaration, extendedTemplateChecker: ExtendedTemplateChecker): ts.Diagnostic[];
|
|
79
|
+
resolve(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, symbol: ComponentSymbol): ResolveResult<ComponentResolutionData>;
|
|
80
|
+
xi18n(ctx: Xi18nContext, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): void;
|
|
81
|
+
updateResources(node: ClassDeclaration, analysis: ComponentAnalysisData): void;
|
|
82
|
+
compileFull(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, resolution: Readonly<ComponentResolutionData>, pool: ConstantPool): CompileResult[];
|
|
83
|
+
compilePartial(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, resolution: Readonly<ComponentResolutionData>): CompileResult[];
|
|
84
|
+
/**
|
|
85
|
+
* Check whether adding an import from `origin` to the source-file corresponding to `expr` would
|
|
86
|
+
* create a cyclic import.
|
|
87
|
+
*
|
|
88
|
+
* @returns a `Cycle` object if a cycle would be created, otherwise `null`.
|
|
89
|
+
*/
|
|
90
|
+
private _checkForCyclicImport;
|
|
91
|
+
private _recordSyntheticImport;
|
|
92
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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/annotations/component/src/metadata" />
|
|
9
|
+
import { AnimationTriggerNames, R3ClassMetadata, R3ComponentMetadata } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
import { ClassPropertyMapping, ComponentResources, DirectiveTypeCheckMeta } from '../../../metadata';
|
|
13
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
14
|
+
import { SubsetOfKeys } from '../../../util/src/typescript';
|
|
15
|
+
import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
|
|
16
|
+
/**
|
|
17
|
+
* These fields of `R3ComponentMetadata` are updated in the `resolve` phase.
|
|
18
|
+
*
|
|
19
|
+
* The `keyof R3ComponentMetadata &` condition ensures that only fields of `R3ComponentMetadata` can
|
|
20
|
+
* be included here.
|
|
21
|
+
*/
|
|
22
|
+
export declare type ComponentMetadataResolvedFields = SubsetOfKeys<R3ComponentMetadata, 'directives' | 'pipes' | 'declarationListEmitMode'>;
|
|
23
|
+
export interface ComponentAnalysisData {
|
|
24
|
+
/**
|
|
25
|
+
* `meta` includes those fields of `R3ComponentMetadata` which are calculated at `analyze` time
|
|
26
|
+
* (not during resolve).
|
|
27
|
+
*/
|
|
28
|
+
meta: Omit<R3ComponentMetadata, ComponentMetadataResolvedFields>;
|
|
29
|
+
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
|
|
30
|
+
typeCheckMeta: DirectiveTypeCheckMeta;
|
|
31
|
+
template: ParsedTemplateWithSource;
|
|
32
|
+
classMetadata: R3ClassMetadata | null;
|
|
33
|
+
inputs: ClassPropertyMapping;
|
|
34
|
+
outputs: ClassPropertyMapping;
|
|
35
|
+
/**
|
|
36
|
+
* Providers extracted from the `providers` field of the component annotation which will require
|
|
37
|
+
* an Angular factory definition at runtime.
|
|
38
|
+
*/
|
|
39
|
+
providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Providers extracted from the `viewProviders` field of the component annotation which will
|
|
42
|
+
* require an Angular factory definition at runtime.
|
|
43
|
+
*/
|
|
44
|
+
viewProvidersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
45
|
+
resources: ComponentResources;
|
|
46
|
+
/**
|
|
47
|
+
* `styleUrls` extracted from the decorator, if present.
|
|
48
|
+
*/
|
|
49
|
+
styleUrls: StyleUrlMeta[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Inline stylesheets extracted from the decorator, if present.
|
|
52
|
+
*/
|
|
53
|
+
inlineStyles: string[] | null;
|
|
54
|
+
isPoisoned: boolean;
|
|
55
|
+
animationTriggerNames: AnimationTriggerNames | null;
|
|
56
|
+
imports: {
|
|
57
|
+
resolved: Reference<ClassDeclaration>[];
|
|
58
|
+
raw: ts.Expression;
|
|
59
|
+
} | null;
|
|
60
|
+
}
|
|
61
|
+
export declare type ComponentResolutionData = Pick<R3ComponentMetadata, ComponentMetadataResolvedFields>;
|
|
@@ -0,0 +1,123 @@
|
|
|
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/annotations/component/src/resources" />
|
|
9
|
+
import { InterpolationConfig, ParsedTemplate, ParseSourceFile, TmplAstNode } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { FatalDiagnosticError } from '../../../diagnostics';
|
|
12
|
+
import { DependencyTracker } from '../../../incremental/api';
|
|
13
|
+
import { Resource } from '../../../metadata';
|
|
14
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
15
|
+
import { ClassDeclaration, DeclarationNode, Decorator } from '../../../reflection';
|
|
16
|
+
import { TemplateSourceMapping } from '../../../typecheck/api';
|
|
17
|
+
import { ResourceLoader } from '../../common';
|
|
18
|
+
/**
|
|
19
|
+
* The literal style url extracted from the decorator, along with metadata for diagnostics.
|
|
20
|
+
*/
|
|
21
|
+
export interface StyleUrlMeta {
|
|
22
|
+
url: string;
|
|
23
|
+
nodeForError: ts.Node;
|
|
24
|
+
source: ResourceTypeForDiagnostics.StylesheetFromTemplate | ResourceTypeForDiagnostics.StylesheetFromDecorator;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Information about the origin of a resource in the application code. This is used for creating
|
|
28
|
+
* diagnostics, so we can point to the root cause of an error in the application code.
|
|
29
|
+
*
|
|
30
|
+
* A template resource comes from the `templateUrl` property on the component decorator.
|
|
31
|
+
*
|
|
32
|
+
* Stylesheets resources can come from either the `styleUrls` property on the component decorator,
|
|
33
|
+
* or from inline `style` tags and style links on the external template.
|
|
34
|
+
*/
|
|
35
|
+
export declare const enum ResourceTypeForDiagnostics {
|
|
36
|
+
Template = 0,
|
|
37
|
+
StylesheetFromTemplate = 1,
|
|
38
|
+
StylesheetFromDecorator = 2
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Information about the template which was extracted during parsing.
|
|
42
|
+
*
|
|
43
|
+
* This contains the actual parsed template as well as any metadata collected during its parsing,
|
|
44
|
+
* some of which might be useful for re-parsing the template with different options.
|
|
45
|
+
*/
|
|
46
|
+
export interface ParsedComponentTemplate extends ParsedTemplate {
|
|
47
|
+
/**
|
|
48
|
+
* The template AST, parsed in a manner which preserves source map information for diagnostics.
|
|
49
|
+
*
|
|
50
|
+
* Not useful for emit.
|
|
51
|
+
*/
|
|
52
|
+
diagNodes: TmplAstNode[];
|
|
53
|
+
/**
|
|
54
|
+
* The `ParseSourceFile` for the template.
|
|
55
|
+
*/
|
|
56
|
+
file: ParseSourceFile;
|
|
57
|
+
}
|
|
58
|
+
export interface ParsedTemplateWithSource extends ParsedComponentTemplate {
|
|
59
|
+
/** The string contents of the template. */
|
|
60
|
+
content: string;
|
|
61
|
+
sourceMapping: TemplateSourceMapping;
|
|
62
|
+
declaration: TemplateDeclaration;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Common fields extracted from the declaration of a template.
|
|
66
|
+
*/
|
|
67
|
+
interface CommonTemplateDeclaration {
|
|
68
|
+
preserveWhitespaces: boolean;
|
|
69
|
+
interpolationConfig: InterpolationConfig;
|
|
70
|
+
templateUrl: string;
|
|
71
|
+
resolvedTemplateUrl: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Information extracted from the declaration of an inline template.
|
|
75
|
+
*/
|
|
76
|
+
export interface InlineTemplateDeclaration extends CommonTemplateDeclaration {
|
|
77
|
+
isInline: true;
|
|
78
|
+
expression: ts.Expression;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Information extracted from the declaration of an external template.
|
|
82
|
+
*/
|
|
83
|
+
export interface ExternalTemplateDeclaration extends CommonTemplateDeclaration {
|
|
84
|
+
isInline: false;
|
|
85
|
+
templateUrlExpression: ts.Expression;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The declaration of a template extracted from a component decorator.
|
|
89
|
+
*
|
|
90
|
+
* This data is extracted and stored separately to facilitate re-interpreting the template
|
|
91
|
+
* declaration whenever the compiler is notified of a change to a template file. With this
|
|
92
|
+
* information, `ComponentDecoratorHandler` is able to re-read the template and update the component
|
|
93
|
+
* record without needing to parse the original decorator again.
|
|
94
|
+
*/
|
|
95
|
+
export declare type TemplateDeclaration = InlineTemplateDeclaration | ExternalTemplateDeclaration;
|
|
96
|
+
/** Determines the node to use for debugging purposes for the given TemplateDeclaration. */
|
|
97
|
+
export declare function getTemplateDeclarationNodeForError(declaration: TemplateDeclaration): ts.Node;
|
|
98
|
+
export interface ExtractTemplateOptions {
|
|
99
|
+
usePoisonedData: boolean;
|
|
100
|
+
enableI18nLegacyMessageIdFormat: boolean;
|
|
101
|
+
i18nNormalizeLineEndingsInICUs: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions): ParsedTemplateWithSource;
|
|
104
|
+
export declare function parseTemplateDeclaration(decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, evaluator: PartialEvaluator, resourceLoader: ResourceLoader, defaultPreserveWhitespaces: boolean): TemplateDeclaration;
|
|
105
|
+
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): Promise<ParsedTemplateWithSource | null>;
|
|
106
|
+
export declare function makeResourceNotFoundError(file: string, nodeForError: ts.Node, resourceType: ResourceTypeForDiagnostics): FatalDiagnosticError;
|
|
107
|
+
/**
|
|
108
|
+
* Transforms the given decorator to inline external resources. i.e. if the decorator
|
|
109
|
+
* resolves to `@Component`, the `templateUrl` and `styleUrls` metadata fields will be
|
|
110
|
+
* transformed to their semantically-equivalent inline variants.
|
|
111
|
+
*
|
|
112
|
+
* This method is used for serializing decorators into the class metadata. The emitted
|
|
113
|
+
* class metadata should not refer to external resources as this would be inconsistent
|
|
114
|
+
* with the component definitions/declarations which already inline external resources.
|
|
115
|
+
*
|
|
116
|
+
* Additionally, the references to external resources would require libraries to ship
|
|
117
|
+
* external resources exclusively for the class metadata.
|
|
118
|
+
*/
|
|
119
|
+
export declare function transformDecoratorToInlineResources(dec: Decorator, component: Map<string, ts.Expression>, styles: string[], template: ParsedTemplateWithSource): Decorator;
|
|
120
|
+
export declare function extractComponentStyleUrls(evaluator: PartialEvaluator, component: Map<string, ts.Expression>): StyleUrlMeta[];
|
|
121
|
+
export declare function extractStyleResources(resourceLoader: ResourceLoader, component: Map<string, ts.Expression>, containingFile: string): ReadonlySet<Resource>;
|
|
122
|
+
export declare function _extractTemplateStyleUrls(template: ParsedTemplateWithSource): StyleUrlMeta[];
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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/annotations/component/src/scope" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
import { DirectiveMeta, MetadataReader, PipeMeta } from '../../../metadata';
|
|
11
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
12
|
+
import { ComponentScopeReader, DtsModuleScopeResolver, LocalModuleScopeRegistry } from '../../../scope';
|
|
13
|
+
import { ComponentAnalysisData } from './metadata';
|
|
14
|
+
export interface ScopeTemplateResult {
|
|
15
|
+
directives: DirectiveMeta[];
|
|
16
|
+
pipes: PipeMeta[];
|
|
17
|
+
diagnostics: ts.Diagnostic[];
|
|
18
|
+
ngModule: ClassDeclaration | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function scopeTemplate(scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, usePoisonedData: boolean): ScopeTemplateResult | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
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/annotations/component/src/symbol" />
|
|
9
|
+
import { SemanticReference, SemanticSymbol } from '../../../incremental/semantic_graph';
|
|
10
|
+
import { DirectiveSymbol } from '../../directive';
|
|
11
|
+
/**
|
|
12
|
+
* Represents an Angular component.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ComponentSymbol extends DirectiveSymbol {
|
|
15
|
+
usedDirectives: SemanticReference[];
|
|
16
|
+
usedPipes: SemanticReference[];
|
|
17
|
+
isRemotelyScoped: boolean;
|
|
18
|
+
isEmitAffected(previousSymbol: SemanticSymbol, publicApiAffected: Set<SemanticSymbol>): boolean;
|
|
19
|
+
isTypeCheckBlockAffected(previousSymbol: SemanticSymbol, typeCheckApiAffected: Set<SemanticSymbol>): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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/annotations/component/src/util" />
|
|
9
|
+
import { AnimationTriggerNames } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
import { ResolvedValue } from '../../../partial_evaluator';
|
|
13
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
14
|
+
/**
|
|
15
|
+
* Collect the animation names from the static evaluation result.
|
|
16
|
+
* @param value the static evaluation result of the animations
|
|
17
|
+
* @param animationTriggerNames the animation names collected and whether some names could not be
|
|
18
|
+
* statically evaluated.
|
|
19
|
+
*/
|
|
20
|
+
export declare function collectAnimationNames(value: ResolvedValue, animationTriggerNames: AnimationTriggerNames): void;
|
|
21
|
+
export declare function validateAndFlattenComponentImports(imports: ResolvedValue, expr: ts.Expression): {
|
|
22
|
+
imports: Reference<ClassDeclaration>[];
|
|
23
|
+
diagnostics: ts.Diagnostic[];
|
|
24
|
+
};
|