@angular/compiler-cli 14.0.0-next.1 → 14.0.0-next.12

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.
Files changed (130) hide show
  1. package/bundles/{chunk-7PY7XEFH.js → chunk-5K2JLFXT.js} +7 -7
  2. package/bundles/chunk-5K2JLFXT.js.map +6 -0
  3. package/bundles/{chunk-XNYP2SFR.js → chunk-6356XFP6.js} +98 -91
  4. package/bundles/chunk-6356XFP6.js.map +6 -0
  5. package/bundles/{chunk-Z2HS4HDG.js → chunk-BRHP6XKM.js} +4 -4
  6. package/bundles/chunk-BRHP6XKM.js.map +6 -0
  7. package/bundles/{chunk-JMLPLN5C.js → chunk-GAGUQCGV.js} +41 -41
  8. package/bundles/chunk-GAGUQCGV.js.map +6 -0
  9. package/bundles/{chunk-C44PYKVA.js → chunk-GMECRI4A.js} +2638 -1880
  10. package/bundles/chunk-GMECRI4A.js.map +6 -0
  11. package/bundles/{chunk-WQ3TNYTD.js → chunk-GMSUYBZP.js} +8 -11
  12. package/bundles/{chunk-WQ3TNYTD.js.map → chunk-GMSUYBZP.js.map} +0 -0
  13. package/bundles/{chunk-GLCRIILX.js → chunk-LC26KH5A.js} +5 -5
  14. package/bundles/chunk-LC26KH5A.js.map +6 -0
  15. package/bundles/{chunk-4KQK6VRA.js → chunk-LV3S6HFU.js} +80 -80
  16. package/bundles/chunk-LV3S6HFU.js.map +6 -0
  17. package/bundles/{chunk-CKFLH7L7.js → chunk-MGNOHKS6.js} +522 -934
  18. package/bundles/chunk-MGNOHKS6.js.map +6 -0
  19. package/bundles/{chunk-QDWL7SZJ.js → chunk-SJL5HBUW.js} +2 -2
  20. package/bundles/chunk-SJL5HBUW.js.map +6 -0
  21. package/bundles/{chunk-ALKVYGAK.js → chunk-T7KW7P7D.js} +74 -67
  22. package/bundles/chunk-T7KW7P7D.js.map +6 -0
  23. package/bundles/{chunk-FXU7FMZC.js → chunk-TD64C4QJ.js} +9 -9
  24. package/bundles/chunk-TD64C4QJ.js.map +6 -0
  25. package/bundles/{chunk-A5PL3TE6.js → chunk-TV7VZNWL.js} +36 -36
  26. package/bundles/chunk-TV7VZNWL.js.map +6 -0
  27. package/bundles/{chunk-PKOZO2VO.js → chunk-TXPPTZTK.js} +6 -6
  28. package/bundles/chunk-TXPPTZTK.js.map +6 -0
  29. package/bundles/{chunk-K2Z44JHH.js → chunk-WH4QSABR.js} +9 -9
  30. package/bundles/chunk-WH4QSABR.js.map +6 -0
  31. package/bundles/{chunk-SKBLJA43.js → chunk-ZCDB56AX.js} +7 -7
  32. package/bundles/chunk-ZCDB56AX.js.map +6 -0
  33. package/bundles/index.js +13 -13
  34. package/bundles/index.js.map +1 -1
  35. package/bundles/linker/babel/index.js +19 -19
  36. package/bundles/linker/babel/index.js.map +1 -1
  37. package/bundles/linker/index.js +5 -5
  38. package/bundles/ngcc/index.js +13 -13
  39. package/bundles/ngcc/index.js.map +1 -1
  40. package/bundles/ngcc/main-ngcc.js +14 -14
  41. package/bundles/ngcc/main-ngcc.js.map +1 -1
  42. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +14 -14
  43. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
  44. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +5 -5
  45. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +1 -1
  46. package/bundles/private/bazel.js +2 -2
  47. package/bundles/private/localize.js +4 -4
  48. package/bundles/private/migrations.js +6 -6
  49. package/bundles/private/tooling.js +3 -3
  50. package/bundles/src/bin/ng_xi18n.js +11 -11
  51. package/bundles/src/bin/ng_xi18n.js.map +1 -1
  52. package/bundles/src/bin/ngc.js +9 -9
  53. package/bundles/src/bin/ngc.js.map +1 -1
  54. package/bundles_metadata.json +1 -1
  55. package/linker/babel/src/babel_core.d.ts +1 -0
  56. package/linker/babel/src/babel_declaration_scope.d.ts +1 -1
  57. package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +7 -3
  58. package/linker/src/file_linker/emit_scopes/{iife_emit_scope.d.ts → local_emit_scope.d.ts} +7 -11
  59. package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.d.ts +3 -3
  60. package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +3 -3
  61. package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +3 -3
  62. package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.d.ts +3 -3
  63. package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.d.ts +3 -3
  64. package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.d.ts +3 -3
  65. package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +8 -1
  66. package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.d.ts +4 -4
  67. package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.d.ts +3 -3
  68. package/ngcc/src/packages/build_marker.d.ts +1 -1
  69. package/package.json +6 -6
  70. package/private/babel.d.ts +42 -0
  71. package/src/ngtsc/annotations/common/index.d.ts +16 -0
  72. package/src/ngtsc/annotations/{src → common/src}/api.d.ts +1 -1
  73. package/src/ngtsc/annotations/common/src/di.d.ts +38 -0
  74. package/src/ngtsc/annotations/{src → common/src}/diagnostics.d.ts +15 -7
  75. package/src/ngtsc/annotations/common/src/evaluation.d.ts +18 -0
  76. package/src/ngtsc/annotations/{src → common/src}/factory.d.ts +2 -2
  77. package/src/ngtsc/annotations/{src → common/src}/metadata.d.ts +2 -2
  78. package/src/ngtsc/annotations/{src → common/src}/references_registry.d.ts +3 -3
  79. package/src/ngtsc/annotations/{src → common/src}/util.d.ts +7 -43
  80. package/src/ngtsc/annotations/component/index.d.ts +9 -0
  81. package/src/ngtsc/annotations/component/src/diagnostics.d.ts +20 -0
  82. package/src/ngtsc/annotations/component/src/handler.d.ts +92 -0
  83. package/src/ngtsc/annotations/component/src/metadata.d.ts +61 -0
  84. package/src/ngtsc/annotations/component/src/resources.d.ts +123 -0
  85. package/src/ngtsc/annotations/component/src/scope.d.ts +20 -0
  86. package/src/ngtsc/annotations/component/src/symbol.d.ts +20 -0
  87. package/src/ngtsc/annotations/component/src/util.d.ts +26 -0
  88. package/src/ngtsc/annotations/directive/index.d.ts +11 -0
  89. package/src/ngtsc/annotations/directive/src/handler.d.ts +59 -0
  90. package/src/ngtsc/annotations/directive/src/shared.d.ts +30 -0
  91. package/src/ngtsc/annotations/directive/src/symbol.d.ts +27 -0
  92. package/src/ngtsc/annotations/index.d.ts +4 -6
  93. package/src/ngtsc/annotations/ng_module/index.d.ts +9 -0
  94. package/src/ngtsc/annotations/{src/ng_module.d.ts → ng_module/src/handler.d.ts} +13 -11
  95. package/src/ngtsc/diagnostics/src/error_code.d.ts +23 -0
  96. package/src/ngtsc/metadata/src/api.d.ts +19 -0
  97. package/src/ngtsc/scope/index.d.ts +4 -3
  98. package/src/ngtsc/scope/src/api.d.ts +21 -5
  99. package/src/ngtsc/scope/src/component_scope.d.ts +1 -15
  100. package/src/ngtsc/scope/src/local.d.ts +4 -11
  101. package/src/ngtsc/scope/src/typecheck.d.ts +1 -1
  102. package/src/ngtsc/scope/src/util.d.ts +14 -0
  103. package/src/ngtsc/shims/api.d.ts +0 -1
  104. package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -4
  105. package/src/ngtsc/tsc_plugin.d.ts +1 -1
  106. package/src/ngtsc/typecheck/api/checker.d.ts +6 -6
  107. package/src/ngtsc/typecheck/api/completion.d.ts +3 -3
  108. package/src/ngtsc/typecheck/api/symbols.d.ts +23 -16
  109. package/src/ngtsc/typecheck/src/checker.d.ts +5 -4
  110. package/src/ngtsc/typecheck/src/completion.d.ts +6 -5
  111. package/src/ngtsc/typecheck/src/diagnostics.d.ts +6 -5
  112. package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +4 -3
  113. package/src/ngtsc/util/src/typescript.d.ts +0 -5
  114. package/bundles/chunk-4KQK6VRA.js.map +0 -6
  115. package/bundles/chunk-7PY7XEFH.js.map +0 -6
  116. package/bundles/chunk-A5PL3TE6.js.map +0 -6
  117. package/bundles/chunk-ALKVYGAK.js.map +0 -6
  118. package/bundles/chunk-C44PYKVA.js.map +0 -6
  119. package/bundles/chunk-CKFLH7L7.js.map +0 -6
  120. package/bundles/chunk-FXU7FMZC.js.map +0 -6
  121. package/bundles/chunk-GLCRIILX.js.map +0 -6
  122. package/bundles/chunk-JMLPLN5C.js.map +0 -6
  123. package/bundles/chunk-K2Z44JHH.js.map +0 -6
  124. package/bundles/chunk-PKOZO2VO.js.map +0 -6
  125. package/bundles/chunk-QDWL7SZJ.js.map +0 -6
  126. package/bundles/chunk-SKBLJA43.js.map +0 -6
  127. package/bundles/chunk-XNYP2SFR.js.map +0 -6
  128. package/bundles/chunk-Z2HS4HDG.js.map +0 -6
  129. package/src/ngtsc/annotations/src/component.d.ts +0 -246
  130. package/src/ngtsc/annotations/src/directive.d.ts +0 -99
@@ -27,6 +27,20 @@ export interface NgModuleMeta {
27
27
  * because the module came from a .d.ts file).
28
28
  */
29
29
  rawDeclarations: ts.Expression | null;
30
+ /**
31
+ * The raw `ts.Expression` which gave rise to `imports`, if one exists.
32
+ *
33
+ * If this is `null`, then either no imports exist, or no expression was available (likely
34
+ * because the module came from a .d.ts file).
35
+ */
36
+ rawImports: ts.Expression | null;
37
+ /**
38
+ * The raw `ts.Expression` which gave rise to `exports`, if one exists.
39
+ *
40
+ * If this is `null`, then either no exports exist, or no expression was available (likely
41
+ * because the module came from a .d.ts file).
42
+ */
43
+ rawExports: ts.Expression | null;
30
44
  }
31
45
  /**
32
46
  * Typing metadata collected for a directive within an NgModule's scope.
@@ -106,6 +120,10 @@ export interface DirectiveMeta extends T2DirectiveMeta, DirectiveTypeCheckMeta {
106
120
  * Whether the directive is likely a structural directive (injects `TemplateRef`).
107
121
  */
108
122
  isStructural: boolean;
123
+ /**
124
+ * Whether the directive is a standalone entity.
125
+ */
126
+ isStandalone: boolean;
109
127
  }
110
128
  /**
111
129
  * Metadata that describes a template guard for one of the directive's inputs.
@@ -132,6 +150,7 @@ export interface PipeMeta {
132
150
  ref: Reference<ClassDeclaration>;
133
151
  name: string;
134
152
  nameExpr: ts.Expression | null;
153
+ isStandalone: boolean;
135
154
  }
136
155
  /**
137
156
  * Reads metadata for directives, pipes, and modules from a particular source, such as .d.ts files
@@ -6,8 +6,9 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/scope" />
9
- export { ExportScope, ScopeData } from './src/api';
10
- export { ComponentScopeReader, CompoundComponentScopeReader } from './src/component_scope';
9
+ export { ComponentScopeReader, ExportScope, LocalModuleScope, ScopeData } from './src/api';
10
+ export { CompoundComponentScopeReader } from './src/component_scope';
11
11
  export { DtsModuleScopeResolver, MetadataDtsModuleScopeResolver } from './src/dependency';
12
- export { DeclarationData, LocalModuleScope, LocalModuleScopeRegistry, LocalNgModuleData } from './src/local';
12
+ export { DeclarationData, LocalModuleScopeRegistry, LocalNgModuleData } from './src/local';
13
13
  export { TypeCheckScope, TypeCheckScopeRegistry } from './src/typecheck';
14
+ export { makeNotStandaloneDiagnostic } from './src/util';
@@ -6,7 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/scope/src/api" />
9
- import { Reference } from '../../imports';
9
+ import { SchemaMetadata } from '@angular/compiler';
10
+ import { Reexport, Reference } from '../../imports';
10
11
  import { DirectiveMeta, PipeMeta } from '../../metadata';
11
12
  import { ClassDeclaration } from '../../reflection';
12
13
  /**
@@ -21,10 +22,6 @@ export interface ScopeData {
21
22
  * Pipes in the exported scope of the module.
22
23
  */
23
24
  pipes: PipeMeta[];
24
- /**
25
- * NgModules which contributed to the scope of the module.
26
- */
27
- ngModules: ClassDeclaration[];
28
25
  /**
29
26
  * Whether some module or component in this scope contains errors and is thus semantically
30
27
  * unreliable.
@@ -55,3 +52,22 @@ export interface RemoteScope {
55
52
  */
56
53
  pipes: Reference[];
57
54
  }
55
+ export interface LocalModuleScope extends ExportScope {
56
+ ngModule: ClassDeclaration;
57
+ compilation: ScopeData;
58
+ reexports: Reexport[] | null;
59
+ schemas: SchemaMetadata[];
60
+ }
61
+ /**
62
+ * Read information about the compilation scope of components.
63
+ */
64
+ export interface ComponentScopeReader {
65
+ getScopeForComponent(clazz: ClassDeclaration): LocalModuleScope | null;
66
+ /**
67
+ * Get the `RemoteScope` required for this component, if any.
68
+ *
69
+ * If the component requires remote scoping, then retrieve the directives/pipes registered for
70
+ * that component. If remote scoping is not required (the common case), returns `null`.
71
+ */
72
+ getRemoteScope(clazz: ClassDeclaration): RemoteScope | null;
73
+ }
@@ -7,21 +7,7 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  import { ClassDeclaration } from '../../reflection';
10
- import { RemoteScope } from './api';
11
- import { LocalModuleScope } from './local';
12
- /**
13
- * Read information about the compilation scope of components.
14
- */
15
- export interface ComponentScopeReader {
16
- getScopeForComponent(clazz: ClassDeclaration): LocalModuleScope | null;
17
- /**
18
- * Get the `RemoteScope` required for this component, if any.
19
- *
20
- * If the component requires remote scoping, then retrieve the directives/pipes registered for
21
- * that component. If remote scoping is not required (the common case), returns `null`.
22
- */
23
- getRemoteScope(clazz: ClassDeclaration): RemoteScope | null;
24
- }
10
+ import { ComponentScopeReader, LocalModuleScope, RemoteScope } from './api';
25
11
  /**
26
12
  * A `ComponentScopeReader` that reads from an ordered set of child readers until it obtains the
27
13
  * requested scope.
@@ -6,25 +6,17 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/scope/src/local" />
9
- import { SchemaMetadata } from '@angular/compiler';
10
9
  import ts from 'typescript';
11
- import { AliasingHost, Reexport, Reference, ReferenceEmitter } from '../../imports';
10
+ import { AliasingHost, Reference, ReferenceEmitter } from '../../imports';
12
11
  import { DirectiveMeta, MetadataReader, MetadataRegistry, NgModuleMeta, PipeMeta } from '../../metadata';
13
12
  import { ClassDeclaration } from '../../reflection';
14
- import { ExportScope, RemoteScope, ScopeData } from './api';
15
- import { ComponentScopeReader } from './component_scope';
13
+ import { ComponentScopeReader, LocalModuleScope, RemoteScope } from './api';
16
14
  import { DtsModuleScopeResolver } from './dependency';
17
15
  export interface LocalNgModuleData {
18
16
  declarations: Reference<ClassDeclaration>[];
19
17
  imports: Reference<ClassDeclaration>[];
20
18
  exports: Reference<ClassDeclaration>[];
21
19
  }
22
- export interface LocalModuleScope extends ExportScope {
23
- ngModule: ClassDeclaration;
24
- compilation: ScopeData;
25
- reexports: Reexport[] | null;
26
- schemas: SchemaMetadata[];
27
- }
28
20
  /**
29
21
  * A registry which collects information about NgModules, Directives, Components, and Pipes which
30
22
  * are local (declared in the ts.Program being compiled), and can produce `LocalModuleScope`s
@@ -46,6 +38,7 @@ export interface LocalModuleScope extends ExportScope {
46
38
  */
47
39
  export declare class LocalModuleScopeRegistry implements MetadataRegistry, ComponentScopeReader {
48
40
  private localReader;
41
+ private fullReader;
49
42
  private dependencyScopeReader;
50
43
  private refEmitter;
51
44
  private aliasingHost;
@@ -91,7 +84,7 @@ export declare class LocalModuleScopeRegistry implements MetadataRegistry, Compo
91
84
  * Tracks which NgModules have directives/pipes that are declared in more than one module.
92
85
  */
93
86
  private modulesWithStructuralErrors;
94
- constructor(localReader: MetadataReader, dependencyScopeReader: DtsModuleScopeResolver, refEmitter: ReferenceEmitter, aliasingHost: AliasingHost | null);
87
+ constructor(localReader: MetadataReader, fullReader: MetadataReader, dependencyScopeReader: DtsModuleScopeResolver, refEmitter: ReferenceEmitter, aliasingHost: AliasingHost | null);
95
88
  /**
96
89
  * Add an NgModule's data to the registry.
97
90
  */
@@ -11,7 +11,7 @@ import ts from 'typescript';
11
11
  import { Reference } from '../../imports';
12
12
  import { DirectiveMeta, MetadataReader } from '../../metadata';
13
13
  import { ClassDeclaration } from '../../reflection';
14
- import { ComponentScopeReader } from './component_scope';
14
+ import { ComponentScopeReader } from './api';
15
15
  /**
16
16
  * The scope that is used for type-check code generation of a component template.
17
17
  */
@@ -0,0 +1,14 @@
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/scope/src/util" />
9
+ import ts from 'typescript';
10
+ import { Reference } from '../../imports';
11
+ import { ClassDeclaration } from '../../reflection';
12
+ import { ComponentScopeReader } from './api';
13
+ export declare function getDiagnosticNode(ref: Reference<ClassDeclaration>, rawExpr: ts.Expression | null): ts.Expression;
14
+ export declare function makeNotStandaloneDiagnostic(scopeReader: ComponentScopeReader, ref: Reference<ClassDeclaration>, rawExpr: ts.Expression | null, kind: 'component' | 'directive' | 'pipe'): ts.Diagnostic;
@@ -61,5 +61,4 @@ export interface FactoryInfo {
61
61
  }
62
62
  export interface ModuleInfo {
63
63
  name: string;
64
- hasId: boolean;
65
64
  }
@@ -21,10 +21,7 @@ export declare class TypeScriptAstFactory implements AstFactory<ts.Statement, ts
21
21
  createBinaryExpression(leftOperand: ts.Expression, operator: BinaryOperator, rightOperand: ts.Expression): ts.Expression;
22
22
  createBlock(body: ts.Statement[]): ts.Statement;
23
23
  createCallExpression(callee: ts.Expression, args: ts.Expression[], pure: boolean): ts.Expression;
24
- createConditional: {
25
- (condition: ts.Expression, whenTrue: ts.Expression, whenFalse: ts.Expression): ts.ConditionalExpression;
26
- (condition: ts.Expression, questionToken: ts.QuestionToken, whenTrue: ts.Expression, colonToken: ts.ColonToken, whenFalse: ts.Expression): ts.ConditionalExpression;
27
- };
24
+ createConditional(condition: ts.Expression, whenTrue: ts.Expression, whenFalse: ts.Expression): ts.Expression;
28
25
  createElementAccess: (expression: ts.Expression, index: number | ts.Expression) => ts.ElementAccessExpression;
29
26
  createExpressionStatement: (expression: ts.Expression) => ts.ExpressionStatement;
30
27
  createFunctionDeclaration(functionName: string, parameters: string[], body: ts.Statement): ts.Statement;
@@ -13,7 +13,7 @@ import { UnifiedModulesHost } from './core/api';
13
13
  * A `ts.CompilerHost` which also returns a list of input files, out of which the `ts.Program`
14
14
  * should be created.
15
15
  *
16
- * Currently mirrored from @bazel/typescript/internal/tsc_wrapped/plugin_api (with the naming of
16
+ * Currently mirrored from @bazel/concatjs/internal/tsc_wrapped/plugin_api (with the naming of
17
17
  * `fileNameToModuleName` corrected).
18
18
  */
19
19
  interface PluginCompilerHost extends ts.CompilerHost, Partial<UnifiedModulesHost> {
@@ -13,7 +13,7 @@ import { ErrorCode } from '../../diagnostics';
13
13
  import { FullTemplateMapping, NgTemplateDiagnostic, TypeCheckableDirectiveMeta } from './api';
14
14
  import { GlobalCompletion } from './completion';
15
15
  import { DirectiveInScope, PipeInScope } from './scope';
16
- import { ElementSymbol, ShimLocation, Symbol, TemplateSymbol } from './symbols';
16
+ import { ElementSymbol, Symbol, TcbLocation, TemplateSymbol } from './symbols';
17
17
  /**
18
18
  * Interface to the Angular Template Type Checker to extract diagnostics and intelligence from the
19
19
  * compiler's understanding of component templates.
@@ -51,7 +51,7 @@ export interface TemplateTypeChecker {
51
51
  * Given a `shim` and position within the file, returns information for mapping back to a template
52
52
  * location.
53
53
  */
54
- getTemplateMappingAtShimLocation(shimLocation: ShimLocation): FullTemplateMapping | null;
54
+ getTemplateMappingAtTcbLocation(tcbLocation: TcbLocation): FullTemplateMapping | null;
55
55
  /**
56
56
  * Get all `ts.Diagnostic`s currently available that pertain to the given component.
57
57
  *
@@ -98,16 +98,16 @@ export interface TemplateTypeChecker {
98
98
  */
99
99
  getGlobalCompletions(context: TmplAstTemplate | null, component: ts.ClassDeclaration, node: AST | TmplAstNode): GlobalCompletion | null;
100
100
  /**
101
- * For the given expression node, retrieve a `ShimLocation` that can be used to perform
101
+ * For the given expression node, retrieve a `TcbLocation` that can be used to perform
102
102
  * autocompletion at that point in the expression, if such a location exists.
103
103
  */
104
- getExpressionCompletionLocation(expr: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration): ShimLocation | null;
104
+ getExpressionCompletionLocation(expr: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration): TcbLocation | null;
105
105
  /**
106
106
  * For the given node represents a `LiteralPrimitive`(the `TextAttribute` represents a string
107
- * literal), retrieve a `ShimLocation` that can be used to perform autocompletion at that point in
107
+ * literal), retrieve a `TcbLocation` that can be used to perform autocompletion at that point in
108
108
  * the node, if such a location exists.
109
109
  */
110
- getLiteralCompletionLocation(strNode: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): ShimLocation | null;
110
+ getLiteralCompletionLocation(strNode: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): TcbLocation | null;
111
111
  /**
112
112
  * Get basic metadata on the directives which are in scope for the given component.
113
113
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/typecheck/api/completion" />
9
9
  import { TmplAstReference, TmplAstVariable } from '@angular/compiler';
10
- import { ShimLocation } from './symbols';
10
+ import { TcbLocation } from './symbols';
11
11
  /**
12
12
  * An autocompletion source of any kind.
13
13
  */
@@ -51,7 +51,7 @@ export interface GlobalCompletion {
51
51
  * A location within the type-checking shim where TypeScript's completion APIs can be used to
52
52
  * access completions for the template's component context (component class members).
53
53
  */
54
- componentContext: ShimLocation;
54
+ componentContext: TcbLocation;
55
55
  /**
56
56
  * `Map` of local references and variables that are visible at the requested level of the
57
57
  * template.
@@ -65,5 +65,5 @@ export interface GlobalCompletion {
65
65
  * A location within the type-checking shim where TypeScript's completion APIs can be used to
66
66
  * access completions for the AST node of the cursor position (primitive constants).
67
67
  */
68
- nodeContext: ShimLocation | null;
68
+ nodeContext: TcbLocation | null;
69
69
  }
@@ -32,15 +32,22 @@ export declare type Symbol = InputBindingSymbol | OutputBindingSymbol | ElementS
32
32
  * A `Symbol` which declares a new named entity in the template scope.
33
33
  */
34
34
  export declare type TemplateDeclarationSymbol = ReferenceSymbol | VariableSymbol;
35
- /** Information about where a `ts.Node` can be found in the type check block shim file. */
36
- export interface ShimLocation {
35
+ /**
36
+ * Information about where a `ts.Node` can be found in the type check file. This can either be
37
+ * a type-checking shim file, or an original source file for inline type check blocks.
38
+ */
39
+ export interface TcbLocation {
37
40
  /**
38
41
  * The fully qualified path of the file which contains the generated TypeScript type check
39
42
  * code for the component's template.
40
43
  */
41
- shimPath: AbsoluteFsPath;
42
- /** The location in the shim file where node appears. */
43
- positionInShimFile: number;
44
+ tcbPath: AbsoluteFsPath;
45
+ /**
46
+ * Whether the type check block exists in a type-checking shim file or is inline.
47
+ */
48
+ isShimFile: boolean;
49
+ /** The location in the file where node appears. */
50
+ positionInFile: number;
44
51
  }
45
52
  /**
46
53
  * A generic representation of some node in a template.
@@ -51,7 +58,7 @@ export interface TsNodeSymbolInfo {
51
58
  /** The `ts.Symbol` for the template node */
52
59
  tsSymbol: ts.Symbol | null;
53
60
  /** The position of the most relevant part of the template node. */
54
- shimLocation: ShimLocation;
61
+ tcbLocation: TcbLocation;
55
62
  }
56
63
  /**
57
64
  * A representation of an expression in a component template.
@@ -66,7 +73,7 @@ export interface ExpressionSymbol {
66
73
  */
67
74
  tsSymbol: ts.Symbol | null;
68
75
  /** The position of the most relevant part of the expression. */
69
- shimLocation: ShimLocation;
76
+ tcbLocation: TcbLocation;
70
77
  }
71
78
  /** Represents either an input or output binding in a template. */
72
79
  export interface BindingSymbol {
@@ -81,7 +88,7 @@ export interface BindingSymbol {
81
88
  */
82
89
  target: DirectiveSymbol | ElementSymbol | TemplateSymbol;
83
90
  /** The location in the shim file where the field access for the binding appears. */
84
- shimLocation: ShimLocation;
91
+ tcbLocation: TcbLocation;
85
92
  }
86
93
  /**
87
94
  * A representation of an input binding in a component template.
@@ -141,14 +148,14 @@ export interface ReferenceSymbol {
141
148
  * ```
142
149
  * This `targetLocation` is `[_t1 variable declaration].getStart()`.
143
150
  */
144
- targetLocation: ShimLocation;
151
+ targetLocation: TcbLocation;
145
152
  /**
146
153
  * The location in the TCB for the identifier node in the reference variable declaration.
147
154
  * For example, given a variable declaration statement for a template reference:
148
155
  * `var _t2 = _t1`, this location is `[_t2 node].getStart()`. This location can
149
156
  * be used to find references to the variable within the template.
150
157
  */
151
- referenceVarLocation: ShimLocation;
158
+ referenceVarLocation: TcbLocation;
152
159
  }
153
160
  /**
154
161
  * A representation of a context variable in a component template.
@@ -175,12 +182,12 @@ export interface VariableSymbol {
175
182
  /**
176
183
  * The location in the shim file for the identifier that was declared for the template variable.
177
184
  */
178
- localVarLocation: ShimLocation;
185
+ localVarLocation: TcbLocation;
179
186
  /**
180
187
  * The location in the shim file for the initializer node of the variable that represents the
181
188
  * template variable.
182
189
  */
183
- initializerLocation: ShimLocation;
190
+ initializerLocation: TcbLocation;
184
191
  }
185
192
  /**
186
193
  * A representation of an element in a component template.
@@ -194,7 +201,7 @@ export interface ElementSymbol {
194
201
  /** A list of directives applied to the element. */
195
202
  directives: DirectiveSymbol[];
196
203
  /** The location in the shim file for the variable that holds the type of the element. */
197
- shimLocation: ShimLocation;
204
+ tcbLocation: TcbLocation;
198
205
  templateNode: TmplAstElement;
199
206
  }
200
207
  export interface TemplateSymbol {
@@ -212,7 +219,7 @@ export interface DirectiveSymbol extends DirectiveInScope {
212
219
  /** The `ts.Type` for the class declaration. */
213
220
  tsType: ts.Type;
214
221
  /** The location in the shim file for the variable that holds the type of the directive. */
215
- shimLocation: ShimLocation;
222
+ tcbLocation: TcbLocation;
216
223
  }
217
224
  /**
218
225
  * A representation of an attribute on an element or template. These bindings aren't currently
@@ -237,7 +244,7 @@ export interface PipeSymbol {
237
244
  */
238
245
  tsSymbol: ts.Symbol | null;
239
246
  /** The position of the transform call in the template. */
240
- shimLocation: ShimLocation;
247
+ tcbLocation: TcbLocation;
241
248
  /** The symbol for the pipe class as an instance that appears in the TCB. */
242
249
  classSymbol: ClassSymbol;
243
250
  }
@@ -248,5 +255,5 @@ export interface ClassSymbol {
248
255
  /** The `ts.Symbol` for class. */
249
256
  tsSymbol: SymbolWithValueDeclaration;
250
257
  /** The position for the variable declaration for the class instance. */
251
- shimLocation: ShimLocation;
258
+ tcbLocation: TcbLocation;
252
259
  }
@@ -16,7 +16,7 @@ import { PerfRecorder } from '../../perf';
16
16
  import { ProgramDriver } from '../../program_driver';
17
17
  import { ReflectionHost } from '../../reflection';
18
18
  import { ComponentScopeReader, TypeCheckScopeRegistry } from '../../scope';
19
- import { DirectiveInScope, ElementSymbol, FullTemplateMapping, GlobalCompletion, NgTemplateDiagnostic, OptimizeFor, PipeInScope, ProgramTypeCheckAdapter, ShimLocation, TemplateSymbol, TemplateTypeChecker, TypeCheckableDirectiveMeta, TypeCheckingConfig } from '../api';
19
+ import { DirectiveInScope, ElementSymbol, FullTemplateMapping, GlobalCompletion, NgTemplateDiagnostic, OptimizeFor, PipeInScope, ProgramTypeCheckAdapter, TcbLocation, TemplateSymbol, TemplateTypeChecker, TypeCheckableDirectiveMeta, TypeCheckingConfig } from '../api';
20
20
  import { ShimTypeCheckingData } from './context';
21
21
  import { TemplateSourceManager } from './source';
22
22
  /**
@@ -75,8 +75,9 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
75
75
  getTemplate(component: ts.ClassDeclaration): TmplAstNode[] | null;
76
76
  private getLatestComponentState;
77
77
  isTrackedTypeCheckFile(filePath: AbsoluteFsPath): boolean;
78
+ private getFileRecordForTcbLocation;
78
79
  private getFileAndShimRecordsForPath;
79
- getTemplateMappingAtShimLocation({ shimPath, positionInShimFile }: ShimLocation): FullTemplateMapping | null;
80
+ getTemplateMappingAtTcbLocation(tcbLocation: TcbLocation): FullTemplateMapping | null;
80
81
  generateAllTypeCheckBlocks(): void;
81
82
  /**
82
83
  * Retrieve type-checking and template parse diagnostics from the given `ts.SourceFile` using the
@@ -86,8 +87,8 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
86
87
  getDiagnosticsForComponent(component: ts.ClassDeclaration): ts.Diagnostic[];
87
88
  getTypeCheckBlock(component: ts.ClassDeclaration): ts.Node | null;
88
89
  getGlobalCompletions(context: TmplAstTemplate | null, component: ts.ClassDeclaration, node: AST | TmplAstNode): GlobalCompletion | null;
89
- getExpressionCompletionLocation(ast: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration): ShimLocation | null;
90
- getLiteralCompletionLocation(node: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): ShimLocation | null;
90
+ getExpressionCompletionLocation(ast: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration): TcbLocation | null;
91
+ getLiteralCompletionLocation(node: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): TcbLocation | null;
91
92
  invalidateClass(clazz: ts.ClassDeclaration): void;
92
93
  makeTemplateDiagnostic<T extends ErrorCode>(clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory, errorCode: T, message: string, relatedInformation?: {
93
94
  text: string;
@@ -9,7 +9,7 @@
9
9
  import { AST, LiteralPrimitive, PropertyRead, PropertyWrite, SafePropertyRead, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
10
10
  import ts from 'typescript';
11
11
  import { AbsoluteFsPath } from '../../file_system';
12
- import { GlobalCompletion, ShimLocation } from '../api';
12
+ import { GlobalCompletion, TcbLocation } from '../api';
13
13
  import { TemplateData } from './context';
14
14
  /**
15
15
  * Powers autocompletion for a specific component.
@@ -20,7 +20,8 @@ import { TemplateData } from './context';
20
20
  export declare class CompletionEngine {
21
21
  private tcb;
22
22
  private data;
23
- private shimPath;
23
+ private tcbPath;
24
+ private tcbIsShim;
24
25
  private componentContext;
25
26
  /**
26
27
  * Cache of completions for various levels of the template, including the root template (`null`).
@@ -28,7 +29,7 @@ export declare class CompletionEngine {
28
29
  */
29
30
  private templateContextCache;
30
31
  private expressionCompletionCache;
31
- constructor(tcb: ts.Node, data: TemplateData, shimPath: AbsoluteFsPath);
32
+ constructor(tcb: ts.Node, data: TemplateData, tcbPath: AbsoluteFsPath, tcbIsShim: boolean);
32
33
  /**
33
34
  * Get global completions within the given template context and AST node.
34
35
  *
@@ -38,8 +39,8 @@ export declare class CompletionEngine {
38
39
  * @param node the given AST node
39
40
  */
40
41
  getGlobalCompletions(context: TmplAstTemplate | null, node: AST | TmplAstNode): GlobalCompletion | null;
41
- getExpressionCompletionLocation(expr: PropertyRead | PropertyWrite | SafePropertyRead): ShimLocation | null;
42
- getLiteralCompletionLocation(expr: LiteralPrimitive | TmplAstTextAttribute): ShimLocation | null;
42
+ getExpressionCompletionLocation(expr: PropertyRead | PropertyWrite | SafePropertyRead): TcbLocation | null;
43
+ getLiteralCompletionLocation(expr: LiteralPrimitive | TmplAstTextAttribute): TcbLocation | null;
43
44
  /**
44
45
  * Get global completions within the given template context - either a `TmplAstTemplate` embedded
45
46
  * view, or `null` for the root context.
@@ -12,8 +12,9 @@ import { TemplateDiagnostic, TemplateId } from '../api';
12
12
  import { TemplateSourceResolver } from './tcb_util';
13
13
  /**
14
14
  * Wraps the node in parenthesis such that inserted span comments become attached to the proper
15
- * node. This is an alias for `ts.createParen` with the benefit that it signifies that the
16
- * inserted parenthesis are for diagnostic purposes, not for correctness of the rendered TCB code.
15
+ * node. This is an alias for `ts.factory.createParenthesizedExpression` with the benefit that it
16
+ * signifies that the inserted parenthesis are for diagnostic purposes, not for correctness of the
17
+ * rendered TCB code.
17
18
  *
18
19
  * Note that it is important that nodes and its attached comment are not wrapped into parenthesis
19
20
  * by default, as it prevents correct translation of e.g. diagnostics produced for incorrect method
@@ -23,9 +24,9 @@ import { TemplateSourceResolver } from './tcb_util';
23
24
  export declare function wrapForDiagnostics(expr: ts.Expression): ts.Expression;
24
25
  /**
25
26
  * Wraps the node in parenthesis such that inserted span comments become attached to the proper
26
- * node. This is an alias for `ts.createParen` with the benefit that it signifies that the
27
- * inserted parenthesis are for use by the type checker, not for correctness of the rendered TCB
28
- * code.
27
+ * node. This is an alias for `ts.factory.createParenthesizedExpression` with the benefit that it
28
+ * signifies that the inserted parenthesis are for use by the type checker, not for correctness of
29
+ * the rendered TCB code.
29
30
  */
30
31
  export declare function wrapForTypeChecker(expr: ts.Expression): ts.Expression;
31
32
  /**
@@ -19,13 +19,14 @@ import { TemplateData } from './context';
19
19
  * replaced if the component's template changes.
20
20
  */
21
21
  export declare class SymbolBuilder {
22
- private readonly shimPath;
22
+ private readonly tcbPath;
23
+ private readonly tcbIsShim;
23
24
  private readonly typeCheckBlock;
24
25
  private readonly templateData;
25
26
  private readonly componentScopeReader;
26
27
  private readonly getTypeChecker;
27
28
  private symbolCache;
28
- constructor(shimPath: AbsoluteFsPath, typeCheckBlock: ts.Node, templateData: TemplateData, componentScopeReader: ComponentScopeReader, getTypeChecker: () => ts.TypeChecker);
29
+ constructor(tcbPath: AbsoluteFsPath, tcbIsShim: boolean, typeCheckBlock: ts.Node, templateData: TemplateData, componentScopeReader: ComponentScopeReader, getTypeChecker: () => ts.TypeChecker);
29
30
  getSymbol(node: TmplAstTemplate | TmplAstElement): TemplateSymbol | ElementSymbol | null;
30
31
  getSymbol(node: TmplAstReference | TmplAstVariable): ReferenceSymbol | VariableSymbol | null;
31
32
  getSymbol(node: AST | TmplAstNode): Symbol | null;
@@ -42,5 +43,5 @@ export declare class SymbolBuilder {
42
43
  private getSymbolOfPipe;
43
44
  private getSymbolOfTemplateExpression;
44
45
  private getSymbolOfTsNode;
45
- private getShimPositionForNode;
46
+ private getTcbPositionForNode;
46
47
  }
@@ -62,8 +62,3 @@ export declare type RequiredDelegations<T> = {
62
62
  * Obtains the non-redirected source file for `sf`.
63
63
  */
64
64
  export declare function toUnredirectedSourceFile(sf: ts.SourceFile): ts.SourceFile;
65
- /**
66
- * Backwards-compatible version of `ts.createExportSpecifier`
67
- * to handle a breaking change between 4.4 and 4.5.
68
- */
69
- export declare function createExportSpecifier(propertyName: string | ts.Identifier | undefined, name: string | ts.Identifier, isTypeOnly?: boolean): ts.ExportSpecifier;