@angular/compiler-cli 17.0.0-next.4 → 17.0.0-next.5
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-EJSJTIHK.js → chunk-7QICZXP3.js} +8 -8
- package/bundles/{chunk-VISOZQNG.js → chunk-7QTF7U4J.js} +4 -4
- package/bundles/{chunk-PCMLSPQF.js → chunk-CSOLWS7O.js} +7 -7
- package/bundles/{chunk-EKTJ7622.js → chunk-GYHDNUIK.js} +7 -7
- package/bundles/{chunk-7PCPPTTO.js → chunk-HJOPJLIM.js} +5 -5
- package/bundles/{chunk-AIIYON4K.js → chunk-KV7WQARZ.js} +31 -31
- package/bundles/{chunk-WPCCXY7F.js → chunk-OADA63HC.js} +5 -5
- package/bundles/{chunk-UYFEPQRA.js → chunk-RVITQ7TS.js} +1026 -491
- package/bundles/chunk-RVITQ7TS.js.map +6 -0
- package/bundles/{chunk-LYJKWJUC.js → chunk-SBDNBITT.js} +3 -3
- package/bundles/{chunk-T6QD5I2A.js → chunk-TX6LIB73.js} +28 -27
- package/bundles/{chunk-T6QD5I2A.js.map → chunk-TX6LIB73.js.map} +1 -1
- package/bundles/{chunk-JZC4T2RR.js → chunk-UHYH6BYB.js} +1 -1
- package/bundles/{chunk-KC52PQKJ.js → chunk-YWV5CDS7.js} +89 -83
- package/bundles/{chunk-KC52PQKJ.js.map → chunk-YWV5CDS7.js.map} +2 -2
- package/bundles/index.js +19 -13
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +13 -13
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +1 -1
- 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 +4 -4
- package/bundles/src/bin/ng_xi18n.js +11 -11
- package/bundles/src/bin/ngc.js +9 -9
- package/bundles_metadata.json +1 -1
- package/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/ngtsc/core/src/compiler.d.ts +10 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +11 -0
- package/src/ngtsc/docs/index.d.ts +9 -0
- package/src/ngtsc/docs/src/class_extractor.d.ts +13 -0
- package/src/ngtsc/docs/src/constant_extractor.d.ts +13 -0
- package/src/ngtsc/docs/src/entities.d.ts +107 -0
- package/src/ngtsc/docs/src/enum_extractor.d.ts +11 -0
- package/src/ngtsc/docs/src/extractor.d.ts +26 -0
- package/src/ngtsc/docs/src/function_extractor.d.ts +16 -0
- package/src/ngtsc/docs/src/jsdoc_extractor.d.ts +21 -0
- package/src/ngtsc/docs/src/type_extractor.d.ts +10 -0
- package/src/ngtsc/program.d.ts +10 -0
- package/src/ngtsc/typecheck/src/oob.d.ts +6 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +5 -3
- package/bundles/chunk-UYFEPQRA.js.map +0 -6
- /package/bundles/{chunk-EJSJTIHK.js.map → chunk-7QICZXP3.js.map} +0 -0
- /package/bundles/{chunk-VISOZQNG.js.map → chunk-7QTF7U4J.js.map} +0 -0
- /package/bundles/{chunk-PCMLSPQF.js.map → chunk-CSOLWS7O.js.map} +0 -0
- /package/bundles/{chunk-EKTJ7622.js.map → chunk-GYHDNUIK.js.map} +0 -0
- /package/bundles/{chunk-7PCPPTTO.js.map → chunk-HJOPJLIM.js.map} +0 -0
- /package/bundles/{chunk-AIIYON4K.js.map → chunk-KV7WQARZ.js.map} +0 -0
- /package/bundles/{chunk-WPCCXY7F.js.map → chunk-OADA63HC.js.map} +0 -0
- /package/bundles/{chunk-LYJKWJUC.js.map → chunk-SBDNBITT.js.map} +0 -0
- /package/bundles/{chunk-JZC4T2RR.js.map → chunk-UHYH6BYB.js.map} +0 -0
package/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export { NgtscProgram } from './src/ngtsc/program';
|
|
|
11
11
|
export { OptimizeFor } from './src/ngtsc/typecheck/api';
|
|
12
12
|
export { ConsoleLogger, Logger, LogLevel } from './src/ngtsc/logging';
|
|
13
13
|
export { NodeJSFileSystem } from './src/ngtsc/file_system';
|
|
14
|
+
export * from './src/ngtsc/docs/src/entities';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "17.0.0-next.
|
|
3
|
+
"version": "17.0.0-next.5",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/core": "7.22.
|
|
46
|
+
"@babel/core": "7.22.19",
|
|
47
47
|
"@jridgewell/sourcemap-codec": "^1.4.14",
|
|
48
48
|
"reflect-metadata": "^0.1.2",
|
|
49
49
|
"chokidar": "^3.0.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"yargs": "^17.2.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@angular/compiler": "17.0.0-next.
|
|
57
|
-
"typescript": ">=
|
|
56
|
+
"@angular/compiler": "17.0.0-next.5",
|
|
57
|
+
"typescript": ">=5.2 <5.3"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
60
60
|
"type": "git",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
],
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"engines": {
|
|
70
|
-
"node": "
|
|
70
|
+
"node": ">=18.13.0"
|
|
71
71
|
},
|
|
72
72
|
"bugs": {
|
|
73
73
|
"url": "https://github.com/angular/angular/issues"
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
+
import { DocEntry } from '../../docs';
|
|
9
10
|
import { AbsoluteFsPath } from '../../file_system';
|
|
10
11
|
import { IncrementalBuildStrategy, IncrementalCompilation, IncrementalState } from '../../incremental';
|
|
11
12
|
import { IndexedComponent } from '../../indexer';
|
|
@@ -230,6 +231,15 @@ export declare class NgCompiler {
|
|
|
230
231
|
* See the `indexing` package for more details.
|
|
231
232
|
*/
|
|
232
233
|
getIndexedComponents(): Map<DeclarationNode, IndexedComponent>;
|
|
234
|
+
/**
|
|
235
|
+
* Gets information for the current program that may be used to generate API
|
|
236
|
+
* reference documentation. This includes Angular-specific information, such
|
|
237
|
+
* as component inputs and outputs.
|
|
238
|
+
*
|
|
239
|
+
* @param entryPoint Path to the entry point for the package for which API
|
|
240
|
+
* docs should be extracted.
|
|
241
|
+
*/
|
|
242
|
+
getApiDocumentation(entryPoint: string): DocEntry[];
|
|
233
243
|
/**
|
|
234
244
|
* Collect i18n messages into the `Xi18nContext`.
|
|
235
245
|
*/
|
|
@@ -214,6 +214,17 @@ export declare enum ErrorCode {
|
|
|
214
214
|
* A directive usage isn't binding to one or more required inputs.
|
|
215
215
|
*/
|
|
216
216
|
MISSING_REQUIRED_INPUTS = 8008,
|
|
217
|
+
/**
|
|
218
|
+
* The tracking expression of a `for` loop block is accessing a variable that is unavailable,
|
|
219
|
+
* for example:
|
|
220
|
+
*
|
|
221
|
+
* ```
|
|
222
|
+
* <ng-template let-ref>
|
|
223
|
+
* {#for item of items; track ref}{/for}
|
|
224
|
+
* </ng-template>
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
ILLEGAL_FOR_LOOP_TRACK_ACCESS = 8009,
|
|
217
228
|
/**
|
|
218
229
|
* A two way binding in a template has an incorrect syntax,
|
|
219
230
|
* parentheses outside brackets. For example:
|
|
@@ -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
|
+
export { DocEntry } from './src/entities';
|
|
9
|
+
export { DocsExtractor } from './src/extractor';
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
import ts from 'typescript';
|
|
9
|
+
import { MetadataReader } from '../../metadata';
|
|
10
|
+
import { ClassDeclaration } from '../../reflection';
|
|
11
|
+
import { ClassEntry } from './entities';
|
|
12
|
+
/** Extracts documentation info for a class, potentially including Angular-specific info. */
|
|
13
|
+
export declare function extractClass(classDeclaration: ClassDeclaration & ts.ClassDeclaration, metadataReader: MetadataReader, typeChecker: ts.TypeChecker): ClassEntry;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
import ts from 'typescript';
|
|
9
|
+
import { ConstantEntry } from './entities';
|
|
10
|
+
/** Extracts documentation entry for a constant. */
|
|
11
|
+
export declare function extractConstant(declaration: ts.VariableDeclaration, typeChecker: ts.TypeChecker): ConstantEntry;
|
|
12
|
+
/** Gets whether a given constant is an Angular-added const that should be ignored for docs. */
|
|
13
|
+
export declare function isSyntheticAngularConstant(declaration: ts.VariableDeclaration): boolean;
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
/** Type of top-level documentation entry. */
|
|
9
|
+
export declare enum EntryType {
|
|
10
|
+
Block = "Block",
|
|
11
|
+
Component = "component",
|
|
12
|
+
Constant = "constant",
|
|
13
|
+
Decorator = "decorator",
|
|
14
|
+
Directive = "directive",
|
|
15
|
+
Element = "element",
|
|
16
|
+
Enum = "enum",
|
|
17
|
+
Function = "function",
|
|
18
|
+
Interface = "interface",
|
|
19
|
+
NgModule = "ng_module",
|
|
20
|
+
Pipe = "pipe",
|
|
21
|
+
TypeAlias = "type_alias",
|
|
22
|
+
UndecoratedClass = "undecorated_class"
|
|
23
|
+
}
|
|
24
|
+
/** Types of class members */
|
|
25
|
+
export declare enum MemberType {
|
|
26
|
+
Property = "property",
|
|
27
|
+
Method = "method",
|
|
28
|
+
Getter = "getter",
|
|
29
|
+
Setter = "setter",
|
|
30
|
+
EnumItem = "enum_item"
|
|
31
|
+
}
|
|
32
|
+
/** Informational tags applicable to class members. */
|
|
33
|
+
export declare enum MemberTags {
|
|
34
|
+
Static = "static",
|
|
35
|
+
Readonly = "readonly",
|
|
36
|
+
Protected = "protected",
|
|
37
|
+
Optional = "optional",
|
|
38
|
+
Input = "input",
|
|
39
|
+
Output = "output"
|
|
40
|
+
}
|
|
41
|
+
export interface JsDocTagEntry {
|
|
42
|
+
name: string;
|
|
43
|
+
comment: string;
|
|
44
|
+
}
|
|
45
|
+
/** Base type for all documentation entities. */
|
|
46
|
+
export interface DocEntry {
|
|
47
|
+
entryType: EntryType;
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
rawComment: string;
|
|
51
|
+
jsdocTags: JsDocTagEntry[];
|
|
52
|
+
}
|
|
53
|
+
/** Documentation entity for a constant. */
|
|
54
|
+
export interface ConstantEntry extends DocEntry {
|
|
55
|
+
type: string;
|
|
56
|
+
}
|
|
57
|
+
/** Documentation entity for a TypeScript class. */
|
|
58
|
+
export interface ClassEntry extends DocEntry {
|
|
59
|
+
members: MemberEntry[];
|
|
60
|
+
}
|
|
61
|
+
/** Documentation entity for a TypeScript enum. */
|
|
62
|
+
export interface EnumEntry extends DocEntry {
|
|
63
|
+
members: EnumMemberEntry[];
|
|
64
|
+
}
|
|
65
|
+
/** Documentation entity for an Angular directives and components. */
|
|
66
|
+
export interface DirectiveEntry extends ClassEntry {
|
|
67
|
+
selector: string;
|
|
68
|
+
exportAs: string[];
|
|
69
|
+
isStandalone: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface PipeEntry extends ClassEntry {
|
|
72
|
+
pipeName: string;
|
|
73
|
+
isStandalone: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface FunctionEntry extends DocEntry {
|
|
76
|
+
params: ParameterEntry[];
|
|
77
|
+
returnType: string;
|
|
78
|
+
}
|
|
79
|
+
/** Sub-entry for a single class or enum member. */
|
|
80
|
+
export interface MemberEntry {
|
|
81
|
+
name: string;
|
|
82
|
+
memberType: MemberType;
|
|
83
|
+
memberTags: MemberTags[];
|
|
84
|
+
description: string;
|
|
85
|
+
jsdocTags: JsDocTagEntry[];
|
|
86
|
+
}
|
|
87
|
+
/** Sub-entry for an enum member. */
|
|
88
|
+
export interface EnumMemberEntry extends MemberEntry {
|
|
89
|
+
type: string;
|
|
90
|
+
value: string;
|
|
91
|
+
}
|
|
92
|
+
/** Sub-entry for a class property. */
|
|
93
|
+
export interface PropertyEntry extends MemberEntry {
|
|
94
|
+
type: string;
|
|
95
|
+
inputAlias?: string;
|
|
96
|
+
outputAlias?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Sub-entry for a class method. */
|
|
99
|
+
export type MethodEntry = MemberEntry & FunctionEntry;
|
|
100
|
+
/** Sub-entry for a single function parameter. */
|
|
101
|
+
export interface ParameterEntry {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
type: string;
|
|
105
|
+
isOptional: boolean;
|
|
106
|
+
isRestParam: boolean;
|
|
107
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
import { EnumEntry } from '@angular/compiler-cli/src/ngtsc/docs/src/entities';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
/** Extracts documentation entry for an enum. */
|
|
11
|
+
export declare function extractEnum(declaration: ts.EnumDeclaration, typeChecker: ts.TypeChecker): EnumEntry;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import ts from 'typescript';
|
|
9
|
+
import { MetadataReader } from '../../metadata';
|
|
10
|
+
import { DocEntry } from './entities';
|
|
11
|
+
/**
|
|
12
|
+
* Extracts all information from a source file that may be relevant for generating
|
|
13
|
+
* public API documentation.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DocsExtractor {
|
|
16
|
+
private typeChecker;
|
|
17
|
+
private metadataReader;
|
|
18
|
+
constructor(typeChecker: ts.TypeChecker, metadataReader: MetadataReader);
|
|
19
|
+
/**
|
|
20
|
+
* Gets the set of all documentable entries from a source file, including
|
|
21
|
+
* declarations that are re-exported from this file as an entry-point.
|
|
22
|
+
*
|
|
23
|
+
* @param sourceFile The file from which to extract documentable entries.
|
|
24
|
+
*/
|
|
25
|
+
extractAll(sourceFile: ts.SourceFile): DocEntry[];
|
|
26
|
+
}
|
|
@@ -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
|
+
import { FunctionEntry } from '@angular/compiler-cli/src/ngtsc/docs/src/entities';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
export declare class FunctionExtractor {
|
|
11
|
+
private declaration;
|
|
12
|
+
private typeChecker;
|
|
13
|
+
constructor(declaration: ts.FunctionDeclaration | ts.MethodDeclaration, typeChecker: ts.TypeChecker);
|
|
14
|
+
extract(): FunctionEntry;
|
|
15
|
+
private extractAllParams;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
import ts from 'typescript';
|
|
9
|
+
import { JsDocTagEntry } from './entities';
|
|
10
|
+
/** Gets the set of JsDoc tags applied to a node. */
|
|
11
|
+
export declare function extractJsDocTags(node: ts.HasJSDoc): JsDocTagEntry[];
|
|
12
|
+
/**
|
|
13
|
+
* Gets the JsDoc description for a node. If the node does not have
|
|
14
|
+
* a description, returns the empty string.
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractJsDocDescription(node: ts.HasJSDoc): string;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the raw JsDoc applied to a node. If the node does not have a JsDoc block,
|
|
19
|
+
* returns the empty string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractRawJsDoc(node: ts.HasJSDoc): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import ts from 'typescript';
|
|
9
|
+
/** Gets the string representation of a node's resolved type. */
|
|
10
|
+
export declare function extractResolvedTypeString(node: ts.Node, checker: ts.TypeChecker): string;
|
package/src/ngtsc/program.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import ts from 'typescript';
|
|
|
9
9
|
import * as api from '../transformers/api';
|
|
10
10
|
import { NgCompiler } from './core';
|
|
11
11
|
import { NgCompilerOptions } from './core/api';
|
|
12
|
+
import { DocEntry } from './docs';
|
|
12
13
|
import { IndexedComponent } from './indexer';
|
|
13
14
|
import { DeclarationNode } from './reflection';
|
|
14
15
|
/**
|
|
@@ -46,5 +47,14 @@ export declare class NgtscProgram implements api.Program {
|
|
|
46
47
|
private emitXi18n;
|
|
47
48
|
emit<CbEmitRes extends ts.EmitResult>(opts?: api.EmitOptions<CbEmitRes> | undefined): ts.EmitResult;
|
|
48
49
|
getIndexedComponents(): Map<DeclarationNode, IndexedComponent>;
|
|
50
|
+
/**
|
|
51
|
+
* Gets information for the current program that may be used to generate API
|
|
52
|
+
* reference documentation. This includes Angular-specific information, such
|
|
53
|
+
* as component inputs and outputs.
|
|
54
|
+
*
|
|
55
|
+
* @param entryPoint Path to the entry point for the package for which API
|
|
56
|
+
* docs should be extracted.
|
|
57
|
+
*/
|
|
58
|
+
getApiDocumentation(entryPoint: string): DocEntry[];
|
|
49
59
|
getEmittedSourceFiles(): Map<string, ts.SourceFile>;
|
|
50
60
|
}
|
|
@@ -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
|
-
import { BindingPipe, PropertyWrite, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { BindingPipe, PropertyRead, PropertyWrite, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import { ClassDeclaration } from '../../reflection';
|
|
10
10
|
import { TemplateDiagnostic, TemplateId } from '../api';
|
|
11
11
|
import { TemplateSourceResolver } from './tcb_util';
|
|
@@ -61,6 +61,10 @@ export interface OutOfBandDiagnosticRecorder {
|
|
|
61
61
|
splitTwoWayBinding(templateId: TemplateId, input: TmplAstBoundAttribute, output: TmplAstBoundEvent, inputConsumer: ClassDeclaration, outputConsumer: ClassDeclaration | TmplAstElement): void;
|
|
62
62
|
/** Reports required inputs that haven't been bound. */
|
|
63
63
|
missingRequiredInputs(templateId: TemplateId, element: TmplAstElement | TmplAstTemplate, directiveName: string, isComponent: boolean, inputAliases: string[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Reports accesses of properties that aren't available in a `for` block's tracking expression.
|
|
66
|
+
*/
|
|
67
|
+
illegalForLoopTrackAccess(templateId: TemplateId, block: TmplAstForLoopBlock, access: PropertyRead): void;
|
|
64
68
|
}
|
|
65
69
|
export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnosticRecorder {
|
|
66
70
|
private resolver;
|
|
@@ -81,4 +85,5 @@ export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnos
|
|
|
81
85
|
suboptimalTypeInference(templateId: TemplateId, variables: TmplAstVariable[]): void;
|
|
82
86
|
splitTwoWayBinding(templateId: TemplateId, input: TmplAstBoundAttribute, output: TmplAstBoundEvent, inputConsumer: ClassDeclaration, outputConsumer: ClassDeclaration | TmplAstElement): void;
|
|
83
87
|
missingRequiredInputs(templateId: TemplateId, element: TmplAstElement | TmplAstTemplate, directiveName: string, isComponent: boolean, inputAliases: string[]): void;
|
|
88
|
+
illegalForLoopTrackAccess(templateId: TemplateId, block: TmplAstForLoopBlock, access: PropertyRead): void;
|
|
84
89
|
}
|
|
@@ -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
|
-
import { BoundTarget, SchemaMetadata, TmplAstElement, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { BoundTarget, SchemaMetadata, TmplAstElement, TmplAstForLoopBlock, TmplAstIfBlockBranch, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { Reference } from '../../imports';
|
|
11
11
|
import { ClassDeclaration } from '../../reflection';
|
|
@@ -207,11 +207,13 @@ declare class Scope {
|
|
|
207
207
|
* @param tcb the overall context of TCB generation.
|
|
208
208
|
* @param parent the `Scope` of the parent template (if any) or `null` if this is the root
|
|
209
209
|
* `Scope`.
|
|
210
|
-
* @param
|
|
210
|
+
* @param blockOrNodes either a `TmplAstTemplate` representing the template for which to
|
|
211
211
|
* calculate the `Scope`, or a list of nodes if no outer template object is available.
|
|
212
212
|
* @param guard an expression that is applied to this scope for type narrowing purposes.
|
|
213
213
|
*/
|
|
214
|
-
static forNodes(tcb: Context, parent: Scope | null,
|
|
214
|
+
static forNodes(tcb: Context, parent: Scope | null, blockOrNodes: TmplAstTemplate | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstNode[], guard: ts.Expression | null): Scope;
|
|
215
|
+
/** Registers a local variable with a scope. */
|
|
216
|
+
private static registerVariable;
|
|
215
217
|
/**
|
|
216
218
|
* Look up a `ts.Expression` representing the value of some operation in the current `Scope`,
|
|
217
219
|
* including any parent scope(s). This method always returns a mutable clone of the
|