@angular/compiler-cli 13.1.0-next.2 → 13.1.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.
Files changed (129) hide show
  1. package/bundles/{chunk-2DL256T3.js → chunk-5TY44ZS3.js} +426 -434
  2. package/bundles/chunk-5TY44ZS3.js.map +6 -0
  3. package/bundles/{chunk-EP5JHXG2.js → chunk-676MI6WZ.js} +33 -54
  4. package/bundles/chunk-676MI6WZ.js.map +6 -0
  5. package/bundles/{chunk-WOC6KEUY.js → chunk-6VRWTEQB.js} +28 -30
  6. package/bundles/chunk-6VRWTEQB.js.map +6 -0
  7. package/bundles/{chunk-S3QIIFH7.js → chunk-7PY7XEFH.js} +9 -6
  8. package/bundles/chunk-7PY7XEFH.js.map +6 -0
  9. package/bundles/{chunk-PBA67OV4.js → chunk-A5PL3TE6.js} +30 -6
  10. package/bundles/chunk-A5PL3TE6.js.map +6 -0
  11. package/bundles/{chunk-QL6ZC3U3.js → chunk-ADHVDA4A.js} +6 -6
  12. package/bundles/{chunk-QL6ZC3U3.js.map → chunk-ADHVDA4A.js.map} +1 -1
  13. package/bundles/{chunk-MIQ5UCHZ.js → chunk-FUZ3CSDO.js} +306 -389
  14. package/bundles/chunk-FUZ3CSDO.js.map +6 -0
  15. package/bundles/{chunk-BUHTODFL.js → chunk-JOLPJ2E4.js} +21 -19
  16. package/bundles/chunk-JOLPJ2E4.js.map +6 -0
  17. package/bundles/{chunk-UMUIU7TE.js → chunk-O4XVCXRT.js} +2 -2
  18. package/bundles/{chunk-UMUIU7TE.js.map → chunk-O4XVCXRT.js.map} +0 -0
  19. package/bundles/{chunk-WYO7JO2T.js → chunk-QBU7RUKB.js} +259 -85
  20. package/bundles/chunk-QBU7RUKB.js.map +6 -0
  21. package/bundles/{chunk-VKIZ4TCJ.js → chunk-TUNE6DP3.js} +6370 -10786
  22. package/bundles/chunk-TUNE6DP3.js.map +6 -0
  23. package/bundles/{chunk-JNWO3JB2.js → chunk-UESD6FVI.js} +13 -15
  24. package/bundles/chunk-UESD6FVI.js.map +6 -0
  25. package/bundles/{chunk-XA5IZLLC.js → chunk-WQ3TNYTD.js} +6 -6
  26. package/bundles/{chunk-XA5IZLLC.js.map → chunk-WQ3TNYTD.js.map} +0 -0
  27. package/bundles/index.js +9 -73
  28. package/bundles/index.js.map +2 -2
  29. package/bundles/linker/babel/index.js +77 -77
  30. package/bundles/linker/babel/index.js.map +1 -1
  31. package/bundles/linker/index.js +5 -5
  32. package/bundles/ngcc/index.js +9 -10
  33. package/bundles/ngcc/index.js.map +1 -1
  34. package/bundles/ngcc/main-ngcc.js +10 -11
  35. package/bundles/ngcc/main-ngcc.js.map +1 -1
  36. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +9 -10
  37. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
  38. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +2 -2
  39. package/bundles/private/bazel.js +1 -1
  40. package/bundles/private/localize.js +3 -3
  41. package/bundles/private/migrations.js +5 -5
  42. package/bundles/private/tooling.js +3 -4
  43. package/bundles/src/bin/ng_xi18n.js +7 -8
  44. package/bundles/src/bin/ng_xi18n.js.map +1 -1
  45. package/bundles/src/bin/ngc.js +9 -10
  46. package/bundles/src/bin/ngc.js.map +1 -1
  47. package/bundles_metadata.json +1 -1
  48. package/index.d.ts +2 -3
  49. package/ngcc/src/host/delegating_host.d.ts +1 -2
  50. package/ngcc/src/host/esm2015_host.d.ts +1 -8
  51. package/ngcc/src/host/ngcc_host.d.ts +0 -13
  52. package/ngcc/src/host/umd_host.d.ts +3 -0
  53. package/ngcc/src/packages/build_marker.d.ts +1 -1
  54. package/ngcc/src/packages/transformer.d.ts +0 -2
  55. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -5
  56. package/ngcc/src/rendering/renderer.d.ts +2 -3
  57. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -2
  58. package/ngcc/src/utils.d.ts +0 -7
  59. package/package.json +3 -3
  60. package/src/main.d.ts +3 -3
  61. package/src/ngtsc/annotations/src/util.d.ts +1 -1
  62. package/src/ngtsc/core/api/src/options.d.ts +3 -2
  63. package/src/ngtsc/core/api/src/public_options.d.ts +38 -0
  64. package/src/ngtsc/core/src/host.d.ts +2 -1
  65. package/src/ngtsc/diagnostics/index.d.ts +2 -1
  66. package/src/ngtsc/diagnostics/src/error.d.ts +1 -0
  67. package/src/ngtsc/diagnostics/src/error_code.d.ts +7 -0
  68. package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +1 -1
  69. package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +21 -0
  70. package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -0
  71. package/src/ngtsc/imports/index.d.ts +1 -1
  72. package/src/ngtsc/imports/src/emitter.d.ts +40 -8
  73. package/src/ngtsc/partial_evaluator/src/builtin.d.ts +5 -0
  74. package/src/ngtsc/program.d.ts +3 -6
  75. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
  76. package/src/ngtsc/reflection/src/host.d.ts +1 -1
  77. package/src/ngtsc/translator/src/translator.d.ts +0 -5
  78. package/src/ngtsc/translator/src/type_translator.d.ts +0 -2
  79. package/src/ngtsc/typecheck/extended/api/api.d.ts +30 -10
  80. package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +3 -14
  81. package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +3 -15
  82. package/src/ngtsc/typecheck/extended/index.d.ts +3 -0
  83. package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +5 -4
  84. package/src/ngtsc/typecheck/src/environment.d.ts +3 -1
  85. package/src/ngtsc/typecheck/src/tcb_util.d.ts +10 -2
  86. package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -2
  87. package/src/ngtsc/typecheck/src/type_emitter.d.ts +7 -21
  88. package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +2 -2
  89. package/src/ngtsc/util/src/typescript.d.ts +5 -0
  90. package/src/perform_compile.d.ts +5 -10
  91. package/src/perform_watch.d.ts +4 -4
  92. package/src/transformers/api.d.ts +3 -30
  93. package/src/transformers/compiler_host.d.ts +1 -97
  94. package/src/transformers/program.d.ts +0 -19
  95. package/src/transformers/util.d.ts +1 -20
  96. package/src/{diagnostics/typescript_version.d.ts → version_helpers.d.ts} +1 -1
  97. package/bundles/chunk-2DL256T3.js.map +0 -6
  98. package/bundles/chunk-ACINBTQB.js +0 -43
  99. package/bundles/chunk-ACINBTQB.js.map +0 -6
  100. package/bundles/chunk-BUHTODFL.js.map +0 -6
  101. package/bundles/chunk-EP5JHXG2.js.map +0 -6
  102. package/bundles/chunk-JNWO3JB2.js.map +0 -6
  103. package/bundles/chunk-MIQ5UCHZ.js.map +0 -6
  104. package/bundles/chunk-PBA67OV4.js.map +0 -6
  105. package/bundles/chunk-S3QIIFH7.js.map +0 -6
  106. package/bundles/chunk-VKIZ4TCJ.js.map +0 -6
  107. package/bundles/chunk-WOC6KEUY.js.map +0 -6
  108. package/bundles/chunk-WYO7JO2T.js.map +0 -6
  109. package/ngcc/src/analysis/switch_marker_analyzer.d.ts +0 -35
  110. package/src/diagnostics/translate_diagnostics.d.ts +0 -18
  111. package/src/language_services.d.ts +0 -11
  112. package/src/metadata/bundle_index_host.d.ts +0 -16
  113. package/src/metadata/bundler.d.ts +0 -66
  114. package/src/metadata/collector.d.ts +0 -44
  115. package/src/metadata/evaluator.d.ts +0 -58
  116. package/src/metadata/index.d.ts +0 -11
  117. package/src/metadata/index_writer.d.ts +0 -10
  118. package/src/metadata/schema.d.ts +0 -182
  119. package/src/metadata/symbols.d.ts +0 -22
  120. package/src/ngtsc/switch/index.d.ts +0 -9
  121. package/src/ngtsc/switch/src/switch.d.ts +0 -10
  122. package/src/transformers/inline_resources.d.ts +0 -26
  123. package/src/transformers/lower_expressions.d.ts +0 -30
  124. package/src/transformers/metadata_cache.d.ts +0 -27
  125. package/src/transformers/metadata_reader.d.ts +0 -19
  126. package/src/transformers/node_emitter.d.ts +0 -105
  127. package/src/transformers/node_emitter_transform.d.ts +0 -19
  128. package/src/transformers/r3_metadata_transform.d.ts +0 -16
  129. package/src/transformers/r3_transform.d.ts +0 -16
package/index.d.ts CHANGED
@@ -1,15 +1,14 @@
1
1
  /// <amd-module name="@angular/compiler-cli" />
2
- export { AotCompilerHost, AotCompilerHost as StaticReflectorHost, StaticReflector, StaticSymbol } from '@angular/compiler';
3
2
  export { VERSION } from './src/version';
4
- export * from './src/metadata';
5
3
  export * from './src/transformers/api';
6
4
  export * from './src/transformers/entry_points';
7
5
  export * from './src/perform_compile';
8
6
  export { CompilerOptions as AngularCompilerOptions } from './src/transformers/api';
9
- export { ngToTsDiagnostic } from './src/transformers/util';
10
7
  export * from './private/tooling';
11
8
  export * from './src/ngtsc/logging';
12
9
  export * from './src/ngtsc/file_system';
13
10
  export { NgTscPlugin } from './src/ngtsc/tsc_plugin';
14
11
  export { NgtscProgram } from './src/ngtsc/program';
15
12
  export { OptimizeFor } from './src/ngtsc/typecheck/api';
13
+ export { ConsoleLogger, Logger, LogLevel } from './src/ngtsc/logging';
14
+ export { NodeJSFileSystem } from './src/ngtsc/file_system';
@@ -8,7 +8,7 @@
8
8
  /// <amd-module name="@angular/compiler-cli/ngcc/src/host/delegating_host" />
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, ClassMember, CtorParameter, Declaration, DeclarationNode, Decorator, FunctionDefinition, Import, ReflectionHost } from '../../../src/ngtsc/reflection';
11
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
11
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
12
12
  /**
13
13
  * A reflection host implementation that delegates reflector queries depending on whether they
14
14
  * reflect on declaration files (for dependent libraries) or source files within the entry-point
@@ -38,7 +38,6 @@ export declare class DelegatingReflectionHost implements NgccReflectionHost {
38
38
  findClassSymbols(sourceFile: ts.SourceFile): NgccClassSymbol[];
39
39
  getClassSymbol(node: ts.Node): NgccClassSymbol | undefined;
40
40
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
41
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
42
41
  getEndOfClass(classSymbol: NgccClassSymbol): ts.Node;
43
42
  detectKnownDeclaration<T extends Declaration>(decl: T): T;
44
43
  isStaticallyExported(decl: ts.Node): boolean;
@@ -10,7 +10,7 @@ import ts from 'typescript';
10
10
  import { Logger } from '../../../src/ngtsc/logging';
11
11
  import { ClassDeclaration, ClassMember, ClassMemberKind, CtorParameter, Declaration, DeclarationNode, Decorator, EnumMember, TypeScriptReflectionHost } from '../../../src/ngtsc/reflection';
12
12
  import { BundleProgram } from '../packages/bundle_program';
13
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
13
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
14
14
  export declare const DECORATORS: ts.__String;
15
15
  export declare const PROP_DECORATORS: ts.__String;
16
16
  export declare const CONSTRUCTOR: ts.__String;
@@ -186,13 +186,6 @@ export declare class Esm2015ReflectionHost extends TypeScriptReflectionHost impl
186
186
  * injected by a migration will not be present in the returned collection.
187
187
  */
188
188
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
189
- /**
190
- * Search the given module for variable declarations in which the initializer
191
- * is an identifier marked with the `PRE_R3_MARKER`.
192
- * @param module the module in which to search for switchable declarations.
193
- * @returns an array of variable declarations that match.
194
- */
195
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
196
189
  getVariableValue(declaration: ts.VariableDeclaration): ts.Expression | null;
197
190
  /**
198
191
  * Find all top-level class symbols in the given file.
@@ -9,12 +9,6 @@
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, Declaration, Decorator, ReflectionHost } from '../../../src/ngtsc/reflection';
11
11
  import { SymbolWithValueDeclaration } from '../../../src/ngtsc/util/src/typescript';
12
- export declare const PRE_R3_MARKER = "__PRE_R3__";
13
- export declare const POST_R3_MARKER = "__POST_R3__";
14
- export declare type SwitchableVariableDeclaration = ts.VariableDeclaration & {
15
- initializer: ts.Identifier;
16
- };
17
- export declare function isSwitchableVariableDeclaration(node: ts.Node): node is SwitchableVariableDeclaration;
18
12
  /**
19
13
  * The symbol corresponding to a "class" declaration. I.e. a `ts.Symbol` whose `valueDeclaration` is
20
14
  * a `ClassDeclaration`.
@@ -60,13 +54,6 @@ export interface NgccReflectionHost extends ReflectionHost {
60
54
  * a "class" or has no symbol.
61
55
  */
62
56
  getClassSymbol(declaration: ts.Node): NgccClassSymbol | undefined;
63
- /**
64
- * Search the given module for variable declarations in which the initializer
65
- * is an identifier marked with the `PRE_R3_MARKER`.
66
- * @param module The module in which to search for switchable declarations.
67
- * @returns An array of variable declarations that match.
68
- */
69
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
70
57
  /**
71
58
  * Retrieves all decorators of a given class symbol.
72
59
  * @param symbol Class symbol that can refer to a declaration which can hold decorators.
@@ -79,5 +79,8 @@ export declare function getImportsOfUmdModule(umdModule: UmdModule): {
79
79
  interface UmdModule {
80
80
  wrapperFn: ts.FunctionExpression;
81
81
  factoryFn: ts.FunctionExpression;
82
+ factoryCalls: Record<'amdDefine' | 'commonJs' | 'commonJs2' | 'global', ts.CallExpression | null> & {
83
+ cjsCallForImports: ts.CallExpression;
84
+ };
82
85
  }
83
86
  export {};
@@ -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 = "13.1.0-next.2";
12
+ export declare const NGCC_VERSION = "13.1.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.
@@ -12,7 +12,6 @@ import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
12
12
  import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ModuleWithProvidersAnalyses } from '../analysis/module_with_providers_analyzer';
14
14
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
15
- import { SwitchMarkerAnalyses } from '../analysis/switch_marker_analyzer';
16
15
  import { CompiledFile } from '../analysis/types';
17
16
  import { NgccReflectionHost } from '../host/ngcc_host';
18
17
  import { RenderingFormatter } from '../rendering/rendering_formatter';
@@ -65,7 +64,6 @@ export declare class Transformer {
65
64
  export declare function hasErrors(diagnostics: ts.Diagnostic[]): boolean;
66
65
  interface ProgramAnalyses {
67
66
  decorationAnalyses: Map<ts.SourceFile, CompiledFile>;
68
- switchMarkerAnalyses: SwitchMarkerAnalyses;
69
67
  privateDeclarationsAnalyses: ExportInfo[];
70
68
  moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null;
71
69
  diagnostics: ts.Diagnostic[];
@@ -15,7 +15,7 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
15
15
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
16
16
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
17
17
  import { CompiledClass } from '../analysis/types';
18
- import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
18
+ import { NgccReflectionHost } from '../host/ngcc_host';
19
19
  import { RedundantDecoratorMap, RenderingFormatter } from './rendering_formatter';
20
20
  /**
21
21
  * A RenderingFormatter that works with ECMAScript Module import and export statements.
@@ -57,10 +57,6 @@ export declare class EsmRenderingFormatter implements RenderingFormatter {
57
57
  * Remove static decorator properties from classes.
58
58
  */
59
59
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
60
- /**
61
- * Rewrite the IVY switch markers to indicate we are in IVY mode.
62
- */
63
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
64
60
  /**
65
61
  * Add the type parameters to the appropriate functions that return `ModuleWithProviders`
66
62
  * structures.
@@ -13,7 +13,6 @@ import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ParsedConfiguration } from '../../../src/perform_compile';
15
15
  import { PrivateDeclarationsAnalyses } from '../analysis/private_declarations_analyzer';
16
- import { SwitchMarkerAnalyses, SwitchMarkerAnalysis } from '../analysis/switch_marker_analyzer';
17
16
  import { CompiledFile, DecorationAnalyses } from '../analysis/types';
18
17
  import { NgccReflectionHost } from '../host/ngcc_host';
19
18
  import { EntryPointBundle } from '../packages/entry_point_bundle';
@@ -33,13 +32,13 @@ export declare class Renderer {
33
32
  private bundle;
34
33
  private tsConfig;
35
34
  constructor(host: NgccReflectionHost, srcFormatter: RenderingFormatter, fs: ReadonlyFileSystem, logger: Logger, bundle: EntryPointBundle, tsConfig?: ParsedConfiguration | null);
36
- renderProgram(decorationAnalyses: DecorationAnalyses, switchMarkerAnalyses: SwitchMarkerAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
35
+ renderProgram(decorationAnalyses: DecorationAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
37
36
  /**
38
37
  * Render the source code and source-map for an Analyzed file.
39
38
  * @param compiledFile The analyzed file to render.
40
39
  * @param targetPath The absolute path where the rendered file will be written.
41
40
  */
42
- renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, switchMarkerAnalysis: SwitchMarkerAnalysis | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
41
+ renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
43
42
  /**
44
43
  * From the given list of classes, computes a map of decorators that should be removed.
45
44
  * The decorators to remove are keyed by their container node, such that we can tell if
@@ -14,7 +14,6 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
15
15
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
16
16
  import { CompiledClass } from '../analysis/types';
17
- import { SwitchableVariableDeclaration } from '../host/ngcc_host';
18
17
  /**
19
18
  * The collected decorators that have become redundant after the compilation
20
19
  * of Ivy static fields. The map is keyed by the container node, such that we
@@ -34,7 +33,6 @@ export interface RenderingFormatter {
34
33
  addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
35
34
  addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
36
35
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
37
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
38
36
  addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
39
37
  printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
40
38
  }
@@ -31,13 +31,6 @@ export interface PartiallyOrderedList<T> extends Array<T> {
31
31
  export declare function getOriginalSymbol(checker: ts.TypeChecker): (symbol: ts.Symbol) => ts.Symbol;
32
32
  export declare function isDefined<T>(value: T | undefined | null): value is T;
33
33
  export declare function getNameText(name: ts.PropertyName | ts.BindingName): string;
34
- /**
35
- * Parse down the AST and capture all the nodes that satisfy the test.
36
- * @param node The start node.
37
- * @param test The function that tests whether a node should be included.
38
- * @returns a collection of nodes that satisfy the test.
39
- */
40
- export declare function findAll<T>(node: ts.Node, test: (node: ts.Node) => node is ts.Node & T): T[];
41
34
  /**
42
35
  * Does the given declaration have a name which is an identifier?
43
36
  * @param declaration The declaration to test.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "13.1.0-next.2",
3
+ "version": "13.1.2",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -66,8 +66,8 @@
66
66
  "yargs": "^17.2.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "@angular/compiler": "13.1.0-next.2",
70
- "typescript": ">=4.4.2 <4.5"
69
+ "@angular/compiler": "13.1.2",
70
+ "typescript": ">=4.4.2 <4.6"
71
71
  },
72
72
  "repository": {
73
73
  "type": "git",
package/src/main.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/main" />
9
9
  import ts from 'typescript';
10
- import { Diagnostics, ParsedConfiguration } from './perform_compile';
10
+ import { ParsedConfiguration } from './perform_compile';
11
11
  import * as api from './transformers/api';
12
12
  declare type TsickleModule = typeof import('tsickle');
13
13
  export declare function main(args: string[], consoleError?: (s: string) => void, config?: NgcParsedConfiguration, customTransformers?: api.CustomTransformers, programReuse?: {
@@ -17,7 +17,7 @@ export declare function mainDiagnosticsForTest(args: string[], config?: NgcParse
17
17
  program: api.Program | undefined;
18
18
  }, modifiedResourceFiles?: Set<string> | null, tsickle?: TsickleModule): {
19
19
  exitCode: number;
20
- diagnostics: ReadonlyArray<ts.Diagnostic | api.Diagnostic>;
20
+ diagnostics: ReadonlyArray<ts.Diagnostic>;
21
21
  };
22
22
  export interface NgcParsedConfiguration extends ParsedConfiguration {
23
23
  watch?: boolean;
@@ -27,6 +27,6 @@ export declare function readCommandLineAndConfiguration(args: string[], existing
27
27
  export declare function watchMode(project: string, options: api.CompilerOptions, consoleError: (s: string) => void): {
28
28
  close: () => void;
29
29
  ready: (cb: () => void) => void;
30
- firstCompileResult: Diagnostics;
30
+ firstCompileResult: readonly ts.Diagnostic[];
31
31
  };
32
32
  export {};
@@ -50,7 +50,7 @@ export declare function getValidConstructorDependencies(clazz: ClassDeclaration,
50
50
  * deps.
51
51
  */
52
52
  export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;
53
- export declare function toR3Reference(valueRef: Reference, typeRef: Reference, valueContext: ts.SourceFile, typeContext: ts.SourceFile, refEmitter: ReferenceEmitter): R3Reference;
53
+ export declare function toR3Reference(origin: ts.Node, valueRef: Reference, typeRef: Reference, valueContext: ts.SourceFile, typeContext: ts.SourceFile, refEmitter: ReferenceEmitter): R3Reference;
54
54
  export declare function isAngularCore(decorator: Decorator): decorator is Decorator & {
55
55
  import: Import;
56
56
  };
@@ -7,7 +7,7 @@
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/core/api/src/options" />
9
9
  import ts from 'typescript';
10
- import { BazelAndG3Options, I18nOptions, LegacyNgcOptions, MiscOptions, NgcCompatibilityOptions, StrictTemplateOptions, TargetOptions } from './public_options';
10
+ import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, MiscOptions, NgcCompatibilityOptions, StrictTemplateOptions, TargetOptions } from './public_options';
11
11
  /**
12
12
  * Non-public options which are useful during testing of the compiler.
13
13
  */
@@ -37,5 +37,6 @@ export interface InternalOptions {
37
37
  *
38
38
  * Also includes a few miscellaneous options.
39
39
  */
40
- export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, NgcCompatibilityOptions, StrictTemplateOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {
40
+ export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions, NgcCompatibilityOptions, StrictTemplateOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {
41
+ [prop: string]: any;
41
42
  }
@@ -6,6 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/core/api/src/public_options" />
9
+ import { ExtendedTemplateDiagnosticName } from '../../../../ngtsc/diagnostics';
9
10
  /**
10
11
  * Options supported by the legacy View Engine compiler, which are still consumed by the Angular Ivy
11
12
  * compiler for backwards compatibility.
@@ -237,6 +238,43 @@ export interface StrictTemplateOptions {
237
238
  */
238
239
  strictLiteralTypes?: boolean;
239
240
  }
241
+ /**
242
+ * A label referring to a `ts.DiagnosticCategory` or `'suppress'`, meaning the associated diagnostic
243
+ * should not be displayed at all.
244
+ *
245
+ * @publicApi
246
+ */
247
+ export declare enum DiagnosticCategoryLabel {
248
+ /** Treat the diagnostic as a warning, don't fail the compilation. */
249
+ Warning = "warning",
250
+ /** Treat the diagnostic as a hard error, fail the compilation. */
251
+ Error = "error",
252
+ /** Ignore the diagnostic altogether. */
253
+ Suppress = "suppress"
254
+ }
255
+ /**
256
+ * Options which control how diagnostics are emitted from the compiler.
257
+ *
258
+ * @publicApi
259
+ */
260
+ export interface DiagnosticOptions {
261
+ /** Options which control how diagnostics are emitted from the compiler. */
262
+ extendedDiagnostics?: {
263
+ /**
264
+ * The category to use for configurable diagnostics which are not overridden by `checks`. Uses
265
+ * `warning` by default.
266
+ */
267
+ defaultCategory?: DiagnosticCategoryLabel;
268
+ /**
269
+ * A map of each extended template diagnostic's name to its category. This can be expanded in
270
+ * the future with more information for each check or for additional diagnostics not part of the
271
+ * extended template diagnostics system.
272
+ */
273
+ checks?: {
274
+ [Name in ExtendedTemplateDiagnosticName]?: DiagnosticCategoryLabel;
275
+ };
276
+ };
277
+ }
240
278
  /**
241
279
  * Options which control behavior useful for "monorepo" build cases using Bazel (such as the
242
280
  * internal Google monorepo, g3).
@@ -42,12 +42,13 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
42
42
  readResource: ((fileName: string) => string | Promise<string>) | undefined;
43
43
  transformResource: ((data: string, context: import("@angular/compiler-cli/src/ngtsc/core/api/index").ResourceHostContext) => Promise<import("@angular/compiler-cli/src/ngtsc/core/api/index").TransformResourceResult | null>) | undefined;
44
44
  realpath: ((path: string) => string) | undefined;
45
- resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedModule | undefined)[]) | undefined;
45
+ resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
46
46
  resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
47
47
  resourceNameToFileName: ((resourceName: string, containingFilePath: string, fallbackResolve?: ((url: string, fromFile: string) => string | null) | undefined) => string | null) | undefined;
48
48
  trace: ((s: string) => void) | undefined;
49
49
  useCaseSensitiveFileNames: () => boolean;
50
50
  writeFile: ts.WriteFileCallback;
51
+ getModuleResolutionCache: (() => ts.ModuleResolutionCache | undefined) | undefined;
51
52
  }
52
53
  /**
53
54
  * A wrapper around `ts.CompilerHost` (plus any extension methods from `ExtendedTsCompilerHost`).
@@ -7,7 +7,8 @@
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/diagnostics" />
9
9
  export { COMPILER_ERRORS_WITH_GUIDES } from './src/docs';
10
- export { FatalDiagnosticError, isFatalDiagnosticError, makeDiagnostic, makeRelatedInformation } from './src/error';
10
+ export { FatalDiagnosticError, isFatalDiagnosticError, makeDiagnostic, makeDiagnosticChain, makeRelatedInformation } from './src/error';
11
11
  export { ErrorCode } from './src/error_code';
12
12
  export { ERROR_DETAILS_PAGE_BASE_URL } from './src/error_details_base_url';
13
+ export { ExtendedTemplateDiagnosticName } from './src/extended_template_diagnostic_name';
13
14
  export { ngErrorCode, replaceTsWithNgInErrors } from './src/util';
@@ -17,5 +17,6 @@ export declare class FatalDiagnosticError {
17
17
  toDiagnostic(): ts.DiagnosticWithLocation;
18
18
  }
19
19
  export declare function makeDiagnostic(code: ErrorCode, node: ts.Node, messageText: string | ts.DiagnosticMessageChain, relatedInformation?: ts.DiagnosticRelatedInformation[]): ts.DiagnosticWithLocation;
20
+ export declare function makeDiagnosticChain(messageText: string, next?: ts.DiagnosticMessageChain[]): ts.DiagnosticMessageChain;
20
21
  export declare function makeRelatedInformation(node: ts.Node, messageText: string): ts.DiagnosticRelatedInformation;
21
22
  export declare function isFatalDiagnosticError(err: any): err is FatalDiagnosticError;
@@ -54,8 +54,15 @@ export declare enum ErrorCode {
54
54
  * created that cannot be handled, such as in partial compilation mode.
55
55
  */
56
56
  IMPORT_CYCLE_DETECTED = 3003,
57
+ /**
58
+ * Raised when the compiler is unable to generate an import statement for a reference.
59
+ */
60
+ IMPORT_GENERATION_FAILURE = 3004,
57
61
  CONFIG_FLAT_MODULE_NO_INDEX = 4001,
58
62
  CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK = 4002,
63
+ CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES = 4003,
64
+ CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL = 4004,
65
+ CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK = 4005,
59
66
  /**
60
67
  * Raised when a host expression has a parse error, such as a host listener or host binding
61
68
  * expression containing a pipe.
@@ -11,6 +11,6 @@
11
11
  *
12
12
  * Keep the files below in full sync:
13
13
  * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
14
- * - packages/core/src/render3/error_details_base_url.ts
14
+ * - packages/core/src/error_details_base_url.ts
15
15
  */
16
16
  export declare const ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
@@ -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
+ /// <amd-module name="@angular/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name" />
9
+ /**
10
+ * Enum holding the name of each extended template diagnostic. The name is used as a user-meaningful
11
+ * value for configuring the diagnostic in the project's options.
12
+ *
13
+ * See the corresponding `ErrorCode` for documentation about each specific error.
14
+ * packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts
15
+ *
16
+ * @publicApi
17
+ */
18
+ export declare enum ExtendedTemplateDiagnosticName {
19
+ INVALID_BANANA_IN_BOX = "invalidBananaInBox",
20
+ NULLISH_COALESCING_NOT_NULLABLE = "nullishCoalescingNotNullable"
21
+ }
@@ -22,4 +22,5 @@ export declare class NgtscCompilerHost implements ts.CompilerHost {
22
22
  getNewLine(): string;
23
23
  fileExists(fileName: string): boolean;
24
24
  readFile(fileName: string): string | undefined;
25
+ realpath(path: string): string;
25
26
  }
@@ -9,7 +9,7 @@
9
9
  export { AliasingHost, AliasStrategy, PrivateExportAliasingHost, UnifiedModulesAliasingHost } from './src/alias';
10
10
  export { ImportRewriter, NoopImportRewriter, R3SymbolsImportRewriter, validateAndRewriteCoreSymbol } from './src/core';
11
11
  export { DefaultImportTracker } from './src/default';
12
- export { AbsoluteModuleStrategy, EmittedReference, ImportedFile, ImportFlags, LocalIdentifierStrategy, LogicalProjectStrategy, ReferenceEmitStrategy, ReferenceEmitter, RelativePathStrategy, UnifiedModulesStrategy } from './src/emitter';
12
+ export { AbsoluteModuleStrategy, assertSuccessfulReferenceEmit, EmittedReference, FailedEmitResult, ImportedFile, ImportFlags, LocalIdentifierStrategy, LogicalProjectStrategy, ReferenceEmitKind, ReferenceEmitResult, ReferenceEmitStrategy, ReferenceEmitter, RelativePathStrategy, UnifiedModulesStrategy } from './src/emitter';
13
13
  export { Reexport } from './src/reexport';
14
14
  export { OwningModule, Reference } from './src/references';
15
15
  export { ModuleResolver } from './src/resolver';
@@ -51,11 +51,16 @@ export declare enum ImportFlags {
51
51
  * an import then `null` should be used.
52
52
  */
53
53
  export declare type ImportedFile = ts.SourceFile | 'unknown' | null;
54
+ export declare const enum ReferenceEmitKind {
55
+ Success = 0,
56
+ Failed = 1
57
+ }
54
58
  /**
55
59
  * Represents the emitted expression of a `Reference` that is valid in the source file it was
56
60
  * emitted from.
57
61
  */
58
62
  export interface EmittedReference {
63
+ kind: ReferenceEmitKind.Success;
59
64
  /**
60
65
  * The expression that refers to `Reference`.
61
66
  */
@@ -68,6 +73,33 @@ export interface EmittedReference {
68
73
  */
69
74
  importedFile: ImportedFile;
70
75
  }
76
+ /**
77
+ * Represents a failure to emit a `Reference` into a different source file.
78
+ */
79
+ export interface FailedEmitResult {
80
+ kind: ReferenceEmitKind.Failed;
81
+ /**
82
+ * The reference that could not be emitted.
83
+ */
84
+ ref: Reference;
85
+ /**
86
+ * The source file into which the reference was requested to be emitted.
87
+ */
88
+ context: ts.SourceFile;
89
+ /**
90
+ * Describes why the reference could not be emitted. This may be shown in a diagnostic.
91
+ */
92
+ reason: string;
93
+ }
94
+ export declare type ReferenceEmitResult = EmittedReference | FailedEmitResult;
95
+ /**
96
+ * Verifies that a reference was emitted successfully, or raises a `FatalDiagnosticError` otherwise.
97
+ * @param result The emit result that should have been successful.
98
+ * @param origin The node that is used to report the failure diagnostic.
99
+ * @param typeKind The kind of the symbol that the reference represents, e.g. 'component' or
100
+ * 'class'.
101
+ */
102
+ export declare function assertSuccessfulReferenceEmit(result: ReferenceEmitResult, origin: ts.Node, typeKind: string): asserts result is EmittedReference;
71
103
  /**
72
104
  * A particular strategy for generating an expression which refers to a `Reference`.
73
105
  *
@@ -91,7 +123,7 @@ export interface ReferenceEmitStrategy {
91
123
  * @returns an `EmittedReference` which refers to the `Reference`, or `null` if none can be
92
124
  * generated
93
125
  */
94
- emit(ref: Reference, context: ts.SourceFile, importFlags: ImportFlags): EmittedReference | null;
126
+ emit(ref: Reference, context: ts.SourceFile, importFlags: ImportFlags): ReferenceEmitResult | null;
95
127
  }
96
128
  /**
97
129
  * Generates `Expression`s which refer to `Reference`s in a given context.
@@ -102,7 +134,7 @@ export interface ReferenceEmitStrategy {
102
134
  export declare class ReferenceEmitter {
103
135
  private strategies;
104
136
  constructor(strategies: ReferenceEmitStrategy[]);
105
- emit(ref: Reference, context: ts.SourceFile, importFlags?: ImportFlags): EmittedReference;
137
+ emit(ref: Reference, context: ts.SourceFile, importFlags?: ImportFlags): ReferenceEmitResult;
106
138
  }
107
139
  /**
108
140
  * A `ReferenceEmitStrategy` which will refer to declarations by any local `ts.Identifier`s, if
@@ -118,11 +150,11 @@ interface ModuleExports {
118
150
  /**
119
151
  * The source file of the module.
120
152
  */
121
- module: ts.SourceFile;
153
+ module: ts.SourceFile | null;
122
154
  /**
123
155
  * The map of declarations to their exported name.
124
156
  */
125
- exportMap: Map<DeclarationNode, string>;
157
+ exportMap: Map<DeclarationNode, string> | null;
126
158
  }
127
159
  /**
128
160
  * A `ReferenceEmitStrategy` which will refer to declarations that come from `node_modules` using
@@ -144,9 +176,9 @@ export declare class AbsoluteModuleStrategy implements ReferenceEmitStrategy {
144
176
  */
145
177
  private moduleExportsCache;
146
178
  constructor(program: ts.Program, checker: ts.TypeChecker, moduleResolver: ModuleResolver, reflectionHost: ReflectionHost);
147
- emit(ref: Reference, context: ts.SourceFile, importFlags: ImportFlags): EmittedReference | null;
179
+ emit(ref: Reference, context: ts.SourceFile, importFlags: ImportFlags): ReferenceEmitResult | null;
148
180
  private getExportsOfModule;
149
- protected enumerateExportsOfModule(specifier: string, fromFile: string): ModuleExports | null;
181
+ protected enumerateExportsOfModule(specifier: string, fromFile: string): ModuleExports;
150
182
  }
151
183
  /**
152
184
  * A `ReferenceEmitStrategy` which will refer to declarations via relative paths, provided they're
@@ -160,7 +192,7 @@ export declare class LogicalProjectStrategy implements ReferenceEmitStrategy {
160
192
  private reflector;
161
193
  private logicalFs;
162
194
  constructor(reflector: ReflectionHost, logicalFs: LogicalFileSystem);
163
- emit(ref: Reference, context: ts.SourceFile): EmittedReference | null;
195
+ emit(ref: Reference, context: ts.SourceFile): ReferenceEmitResult | null;
164
196
  }
165
197
  /**
166
198
  * A `ReferenceEmitStrategy` which constructs relatives paths between `ts.SourceFile`s.
@@ -171,7 +203,7 @@ export declare class LogicalProjectStrategy implements ReferenceEmitStrategy {
171
203
  export declare class RelativePathStrategy implements ReferenceEmitStrategy {
172
204
  private reflector;
173
205
  constructor(reflector: ReflectionHost);
174
- emit(ref: Reference, context: ts.SourceFile): EmittedReference | null;
206
+ emit(ref: Reference, context: ts.SourceFile): ReferenceEmitResult | null;
175
207
  }
176
208
  /**
177
209
  * A `ReferenceEmitStrategy` which uses a `UnifiedModulesHost` to generate absolute import
@@ -18,6 +18,11 @@ export declare class ArrayConcatBuiltinFn extends KnownFn {
18
18
  constructor(lhs: ResolvedValueArray);
19
19
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
20
20
  }
21
+ export declare class StringConcatBuiltinFn extends KnownFn {
22
+ private lhs;
23
+ constructor(lhs: string);
24
+ evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
25
+ }
21
26
  export declare class ObjectAssignBuiltinFn extends KnownFn {
22
27
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
23
28
  }
@@ -6,7 +6,6 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/ngtsc/program" />
9
- import { GeneratedFile } from '@angular/compiler';
10
9
  import ts from 'typescript';
11
10
  import * as api from '../transformers/api';
12
11
  import { NgCompiler } from './core';
@@ -33,9 +32,9 @@ export declare class NgtscProgram implements api.Program {
33
32
  getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
34
33
  getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
35
34
  getTsSemanticDiagnostics(sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
36
- getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly (ts.Diagnostic | api.Diagnostic)[];
37
- getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly api.Diagnostic[];
38
- getNgSemanticDiagnostics(fileName?: string | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly (ts.Diagnostic | api.Diagnostic)[];
35
+ getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
36
+ getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
37
+ getNgSemanticDiagnostics(fileName?: string | undefined, cancellationToken?: ts.CancellationToken | undefined): readonly ts.Diagnostic[];
39
38
  /**
40
39
  * Ensure that the `NgCompiler` has properly analyzed the program, and allow for the asynchronous
41
40
  * loading of any resources during the process.
@@ -54,7 +53,5 @@ export declare class NgtscProgram implements api.Program {
54
53
  mergeEmitResultsCallback?: api.TsMergeEmitResultsCallback | undefined;
55
54
  } | undefined): ts.EmitResult;
56
55
  getIndexedComponents(): Map<DeclarationNode, IndexedComponent>;
57
- getLibrarySummaries(): Map<string, api.LibrarySummary>;
58
- getEmittedGeneratedFiles(): Map<string, GeneratedFile>;
59
56
  getEmittedSourceFiles(): Map<string, ts.SourceFile>;
60
57
  }
@@ -36,10 +36,11 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
36
36
  readDirectory: ((rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number | undefined) => string[]) | undefined;
37
37
  readFile: (fileName: string) => string | undefined;
38
38
  realpath: ((path: string) => string) | undefined;
39
- resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedModule | undefined)[]) | undefined;
39
+ resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
40
40
  resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
41
41
  trace: ((s: string) => void) | undefined;
42
42
  useCaseSensitiveFileNames: () => boolean;
43
+ getModuleResolutionCache: (() => ts.ModuleResolutionCache | undefined) | undefined;
43
44
  }
44
45
  /**
45
46
  * Updates a `ts.Program` instance with a new one that incorporates specific changes, using the
@@ -290,7 +290,7 @@ export interface NoValueDeclaration {
290
290
  export interface TypeOnlyImport {
291
291
  kind: ValueUnavailableKind.TYPE_ONLY_IMPORT;
292
292
  typeNode: ts.TypeNode;
293
- importClause: ts.ImportClause;
293
+ node: ts.ImportClause | ts.ImportSpecifier;
294
294
  }
295
295
  export interface NamespaceImport {
296
296
  kind: ValueUnavailableKind.NAMESPACE;
@@ -28,10 +28,7 @@ export declare class ExpressionTranslatorVisitor<TStatement, TExpression> implem
28
28
  visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, context: Context): TStatement;
29
29
  visitExpressionStmt(stmt: o.ExpressionStatement, context: Context): TStatement;
30
30
  visitReturnStmt(stmt: o.ReturnStatement, context: Context): TStatement;
31
- visitDeclareClassStmt(_stmt: o.ClassStmt, _context: Context): never;
32
31
  visitIfStmt(stmt: o.IfStmt, context: Context): TStatement;
33
- visitTryCatchStmt(_stmt: o.TryCatchStmt, _context: Context): never;
34
- visitThrowStmt(stmt: o.ThrowStmt, context: Context): TStatement;
35
32
  visitReadVarExpr(ast: o.ReadVarExpr, _context: Context): TExpression;
36
33
  visitWriteVarExpr(expr: o.WriteVarExpr, context: Context): TExpression;
37
34
  visitWriteKeyExpr(expr: o.WriteKeyExpr, context: Context): TExpression;
@@ -50,8 +47,6 @@ export declare class ExpressionTranslatorVisitor<TStatement, TExpression> implem
50
47
  visitExternalExpr(ast: o.ExternalExpr, _context: Context): TExpression;
51
48
  visitConditionalExpr(ast: o.ConditionalExpr, context: Context): TExpression;
52
49
  visitNotExpr(ast: o.NotExpr, context: Context): TExpression;
53
- visitAssertNotNullExpr(ast: o.AssertNotNull, context: Context): TExpression;
54
- visitCastExpr(ast: o.CastExpr, context: Context): TExpression;
55
50
  visitFunctionExpr(ast: o.FunctionExpr, context: Context): TExpression;
56
51
  visitBinaryOperatorExpr(ast: o.BinaryOperatorExpr, context: Context): TExpression;
57
52
  visitReadPropExpr(ast: o.ReadPropExpr, context: Context): TExpression;