@angular/compiler-cli 21.2.0 → 21.2.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 (43) hide show
  1. package/bundles/{chunk-IO4PSCVA.js → chunk-32EO3D75.js} +1 -1
  2. package/bundles/chunk-FLWAEX6T.js +1 -1
  3. package/bundles/{chunk-IG22BDVK.js → chunk-OECV6WLT.js} +862 -1172
  4. package/bundles/{chunk-G6DAEDUS.js → chunk-RJ3Y43GR.js} +2 -2
  5. package/bundles/{chunk-J2UUYQZ3.js → chunk-SPPRVX7S.js} +2 -2
  6. package/bundles/index.js +4 -4
  7. package/bundles/private/migrations.js +2 -2
  8. package/bundles/private/testing.js +1 -1
  9. package/bundles/private/tooling.js +1 -1
  10. package/bundles/src/bin/ng_xi18n.js +4 -4
  11. package/bundles/src/bin/ngc.js +4 -4
  12. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  13. package/package.json +2 -2
  14. package/src/ngtsc/core/src/compiler.d.ts +1 -1
  15. package/src/ngtsc/diagnostics/src/docs.d.ts +1 -1
  16. package/src/ngtsc/typecheck/src/comments.d.ts +0 -7
  17. package/src/ngtsc/typecheck/src/environment.d.ts +7 -6
  18. package/src/ngtsc/typecheck/src/expression.d.ts +3 -15
  19. package/src/ngtsc/typecheck/src/host_bindings.d.ts +1 -1
  20. package/src/ngtsc/typecheck/src/ops/base.d.ts +3 -3
  21. package/src/ngtsc/typecheck/src/ops/bindings.d.ts +8 -3
  22. package/src/ngtsc/typecheck/src/ops/codegen.d.ts +74 -0
  23. package/src/ngtsc/typecheck/src/ops/context.d.ts +1 -2
  24. package/src/ngtsc/typecheck/src/ops/directive_constructor.d.ts +3 -3
  25. package/src/ngtsc/typecheck/src/ops/directive_type.d.ts +4 -4
  26. package/src/ngtsc/typecheck/src/ops/element.d.ts +2 -2
  27. package/src/ngtsc/typecheck/src/ops/events.d.ts +2 -2
  28. package/src/ngtsc/typecheck/src/ops/expression.d.ts +5 -5
  29. package/src/ngtsc/typecheck/src/ops/for_block.d.ts +2 -2
  30. package/src/ngtsc/typecheck/src/ops/host.d.ts +2 -2
  31. package/src/ngtsc/typecheck/src/ops/inputs.d.ts +2 -2
  32. package/src/ngtsc/typecheck/src/ops/let.d.ts +2 -2
  33. package/src/ngtsc/typecheck/src/ops/references.d.ts +3 -3
  34. package/src/ngtsc/typecheck/src/ops/schema.d.ts +2 -2
  35. package/src/ngtsc/typecheck/src/ops/scope.d.ts +9 -9
  36. package/src/ngtsc/typecheck/src/ops/selectorless.d.ts +2 -2
  37. package/src/ngtsc/typecheck/src/ops/template.d.ts +2 -2
  38. package/src/ngtsc/typecheck/src/ops/variables.d.ts +6 -6
  39. package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +2 -5
  40. package/src/ngtsc/typecheck/src/ts_util.d.ts +0 -37
  41. package/src/ngtsc/typecheck/src/type_check_block.d.ts +1 -1
  42. package/src/ngtsc/typecheck/src/type_check_file.d.ts +3 -2
  43. package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -2
@@ -88,7 +88,7 @@ import {
88
88
  toUnredirectedSourceFile,
89
89
  tryParseInitializerApi,
90
90
  untagAllTsFiles
91
- } from "./chunk-IG22BDVK.js";
91
+ } from "./chunk-OECV6WLT.js";
92
92
  import {
93
93
  LogicalFileSystem,
94
94
  absoluteFromSourceFile,
@@ -4368,7 +4368,7 @@ var NgCompiler = class _NgCompiler {
4368
4368
  return this.addMessageTextDetails(diagnostics);
4369
4369
  }
4370
4370
  /**
4371
- * Add Angular.io error guide links to diagnostics for this compilation.
4371
+ * Add https://angular.dev/errors error guide links to diagnostics for this compilation.
4372
4372
  */
4373
4373
  addMessageTextDetails(diagnostics) {
4374
4374
  return diagnostics.map((diag) => {
@@ -8,7 +8,7 @@ import {
8
8
  TrackedIncrementalBuildStrategy,
9
9
  freshCompilationTicket,
10
10
  incrementalFromCompilerTicket
11
- } from "./chunk-G6DAEDUS.js";
11
+ } from "./chunk-RJ3Y43GR.js";
12
12
  import {
13
13
  ActivePerfRecorder,
14
14
  OptimizeFor,
@@ -18,7 +18,7 @@ import {
18
18
  TsCreateProgramDriver,
19
19
  replaceTsWithNgInErrors,
20
20
  retagAllTsFiles
21
- } from "./chunk-IG22BDVK.js";
21
+ } from "./chunk-OECV6WLT.js";
22
22
  import {
23
23
  absoluteFrom,
24
24
  createFileSystemTsReadDirectoryFn,
package/bundles/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  isTsDiagnostic,
18
18
  performCompilation,
19
19
  readConfiguration
20
- } from "./chunk-J2UUYQZ3.js";
20
+ } from "./chunk-SPPRVX7S.js";
21
21
  import {
22
22
  ConsoleLogger,
23
23
  LogLevel
@@ -34,7 +34,7 @@ import {
34
34
  freshCompilationTicket,
35
35
  incrementalFromStateTicket,
36
36
  isDocEntryWithSourceInfo
37
- } from "./chunk-G6DAEDUS.js";
37
+ } from "./chunk-RJ3Y43GR.js";
38
38
  import {
39
39
  ActivePerfRecorder,
40
40
  ErrorCode,
@@ -46,7 +46,7 @@ import {
46
46
  getInitializerApiJitTransform,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-IG22BDVK.js";
49
+ } from "./chunk-OECV6WLT.js";
50
50
  import "./chunk-CSUVPNMK.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("21.2.0");
80
+ var VERSION = new Version("21.2.2");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -5,7 +5,7 @@
5
5
  import {
6
6
  DiagnosticCategoryLabel,
7
7
  NgCompiler
8
- } from "../chunk-G6DAEDUS.js";
8
+ } from "../chunk-RJ3Y43GR.js";
9
9
  import {
10
10
  CompilationMode,
11
11
  DtsMetadataReader,
@@ -32,7 +32,7 @@ import {
32
32
  queryDecoratorNames,
33
33
  reflectObjectLiteral,
34
34
  unwrapExpression
35
- } from "../chunk-IG22BDVK.js";
35
+ } from "../chunk-OECV6WLT.js";
36
36
  import "../chunk-CSUVPNMK.js";
37
37
  import {
38
38
  getFileSystem,
@@ -6,7 +6,7 @@ import {
6
6
  ImportedSymbolsTracker,
7
7
  TypeScriptReflectionHost,
8
8
  getInitializerApiJitTransform
9
- } from "../chunk-IG22BDVK.js";
9
+ } from "../chunk-OECV6WLT.js";
10
10
  import "../chunk-CSUVPNMK.js";
11
11
  import {
12
12
  InvalidFileSystem,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-IG22BDVK.js";
7
+ } from "../chunk-OECV6WLT.js";
8
8
  import "../chunk-CSUVPNMK.js";
9
9
  import "../chunk-CEBE44Q5.js";
10
10
  import "../chunk-XYYEESKY.js";
@@ -6,12 +6,12 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-IO4PSCVA.js";
9
+ } from "../../chunk-32EO3D75.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-J2UUYQZ3.js";
13
- import "../../chunk-G6DAEDUS.js";
14
- import "../../chunk-IG22BDVK.js";
12
+ } from "../../chunk-SPPRVX7S.js";
13
+ import "../../chunk-RJ3Y43GR.js";
14
+ import "../../chunk-OECV6WLT.js";
15
15
  import "../../chunk-CSUVPNMK.js";
16
16
  import {
17
17
  setFileSystem
@@ -5,10 +5,10 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-IO4PSCVA.js";
9
- import "../../chunk-J2UUYQZ3.js";
10
- import "../../chunk-G6DAEDUS.js";
11
- import "../../chunk-IG22BDVK.js";
8
+ } from "../../chunk-32EO3D75.js";
9
+ import "../../chunk-SPPRVX7S.js";
10
+ import "../../chunk-RJ3Y43GR.js";
11
+ import "../../chunk-OECV6WLT.js";
12
12
  import "../../chunk-CSUVPNMK.js";
13
13
  import {
14
14
  setFileSystem
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
9
9
  import { AstObject, AstValue } from '../../ast/ast_value';
10
- export declare const PLACEHOLDER_VERSION = "21.2.0";
10
+ export declare const PLACEHOLDER_VERSION = "21.2.2";
11
11
  export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
12
12
  /**
13
13
  * Parses the value of an enum from the AST value's symbol name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "21.2.0",
3
+ "version": "21.2.2",
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
  "typescript": "5.9.3"
44
44
  },
45
45
  "peerDependencies": {
46
- "@angular/compiler": "21.2.0",
46
+ "@angular/compiler": "21.2.2",
47
47
  "typescript": ">=5.9 <6.1"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -177,7 +177,7 @@ export declare class NgCompiler {
177
177
  */
178
178
  getDiagnosticsForComponent(component: ts.ClassDeclaration): ts.Diagnostic[];
179
179
  /**
180
- * Add Angular.io error guide links to diagnostics for this compilation.
180
+ * Add https://angular.dev/errors error guide links to diagnostics for this compilation.
181
181
  */
182
182
  private addMessageTextDetails;
183
183
  /**
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { ErrorCode } from './error_code';
9
9
  /**
10
- * Contains a set of error messages that have detailed guides at angular.io.
10
+ * Contains a set of error messages that have detailed guides at angular.dev.
11
11
  * Full list of available error guides can be found at https://angular.dev/errors
12
12
  */
13
13
  export declare const COMPILER_ERRORS_WITH_GUIDES: Set<ErrorCode>;
@@ -26,13 +26,6 @@ export declare enum ExpressionIdentifier {
26
26
  EVENT_PARAMETER = "EP",
27
27
  VARIABLE_AS_EXPRESSION = "VAE"
28
28
  }
29
- /** Tags the node with the given expression identifier. */
30
- export declare function addExpressionIdentifier(node: ts.Node, identifier: ExpressionIdentifier): void;
31
- /**
32
- * Tag the `ts.Node` with an indication that any errors arising from the evaluation of the node
33
- * should be ignored.
34
- */
35
- export declare function markIgnoreDiagnostics(node: ts.Node): void;
36
29
  /** Returns true if the node has a marker that indicates diagnostics errors should be ignored. */
37
30
  export declare function hasIgnoreForDiagnosticsMarker(node: ts.Node, sourceFile: ts.SourceFile): boolean;
38
31
  export interface FindOptions<T extends ts.Node> {
@@ -11,6 +11,7 @@ import { ClassDeclaration, ReflectionHost } from '../../reflection';
11
11
  import { ImportManager } from '../../translator';
12
12
  import { TypeCheckableDirectiveMeta, TypeCheckingConfig } from '../api';
13
13
  import { ReferenceEmitEnvironment } from './reference_emit_environment';
14
+ import { TcbExpr } from './ops/codegen';
14
15
  /**
15
16
  * A context which hosts one or more Type Check Blocks (TCBs).
16
17
  *
@@ -26,9 +27,9 @@ export declare class Environment extends ReferenceEmitEnvironment {
26
27
  readonly config: TypeCheckingConfig;
27
28
  private nextIds;
28
29
  private typeCtors;
29
- protected typeCtorStatements: ts.Statement[];
30
+ protected typeCtorStatements: TcbExpr[];
30
31
  private pipeInsts;
31
- protected pipeInstStatements: ts.Statement[];
32
+ protected pipeInstStatements: TcbExpr[];
32
33
  constructor(config: TypeCheckingConfig, importManager: ImportManager, refEmitter: ReferenceEmitter, reflector: ReflectionHost, contextFile: ts.SourceFile);
33
34
  /**
34
35
  * Get an expression referring to a type constructor for the given directive.
@@ -36,14 +37,14 @@ export declare class Environment extends ReferenceEmitEnvironment {
36
37
  * Depending on the shape of the directive itself, this could be either a reference to a declared
37
38
  * type constructor, or to an inline type constructor.
38
39
  */
39
- typeCtorFor(dir: TypeCheckableDirectiveMeta): ts.Expression;
40
- pipeInst(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>): ts.Expression;
40
+ typeCtorFor(dir: TypeCheckableDirectiveMeta): TcbExpr;
41
+ pipeInst(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>): TcbExpr;
41
42
  /**
42
43
  * Generate a `ts.Expression` that references the given node.
43
44
  *
44
45
  * This may involve importing the node into the file if it's not declared there already.
45
46
  */
46
- reference(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>): ts.Expression;
47
+ reference(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>): TcbExpr;
47
48
  private emitTypeParameters;
48
- getPreludeStatements(): ts.Statement[];
49
+ getPreludeStatements(): TcbExpr[];
49
50
  }
@@ -6,22 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { AST } from '@angular/compiler';
9
- import ts from 'typescript';
9
+ import { TcbExpr } from './ops/codegen';
10
10
  import { TypeCheckingConfig } from '../api';
11
11
  /**
12
- * Gets an expression that is cast to any. Currently represented as `0 as any`.
13
- *
14
- * Historically this expression was using `null as any`, but a newly-added check in TypeScript 5.6
15
- * (https://devblogs.microsoft.com/typescript/announcing-typescript-5-6-beta/#disallowed-nullish-and-truthy-checks)
16
- * started flagging it as always being nullish. Other options that were considered:
17
- * - `NaN as any` or `Infinity as any` - not used, because they don't work if the `noLib` compiler
18
- * option is enabled. Also they require more characters.
19
- * - Some flavor of function call, like `isNan(0) as any` - requires even more characters than the
20
- * NaN option and has the same issue with `noLib`.
21
- */
22
- export declare function getAnyExpression(): ts.AsExpression;
23
- /**
24
- * Convert an `AST` to TypeScript code directly, without going through an intermediate `Expression`
12
+ * Convert an `AST` to a `TcbExpr` directly, without going through an intermediate `Expression`
25
13
  * AST.
26
14
  */
27
- export declare function astToTypescript(ast: AST, maybeResolve: (ast: AST) => ts.Expression | null, config: TypeCheckingConfig): ts.Expression;
15
+ export declare function astToTcbExpr(ast: AST, maybeResolve: (ast: AST) => TcbExpr | null, config: TypeCheckingConfig): TcbExpr;
@@ -23,7 +23,7 @@ export declare function createHostElement(type: 'component' | 'directive', selec
23
23
  * Creates an AST node that can be used as a guard in `if` statements to distinguish TypeScript
24
24
  * nodes used for checking host bindings from ones used for checking templates.
25
25
  */
26
- export declare function createHostBindingsBlockGuard(): ts.Expression;
26
+ export declare function createHostBindingsBlockGuard(): string;
27
27
  /**
28
28
  * Determines if a given node is a guard that indicates that descendant nodes are used to check
29
29
  * host bindings.
@@ -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.dev/license
7
7
  */
8
- import ts from 'typescript';
8
+ import { TcbExpr } from './codegen';
9
9
  /**
10
10
  * A code generation operation that's involved in the construction of a Type Check Block.
11
11
  *
@@ -30,7 +30,7 @@ export declare abstract class TcbOp {
30
30
  * code to generate, parse and type-check, overall positively contributing to performance.
31
31
  */
32
32
  abstract readonly optional: boolean;
33
- abstract execute(): ts.Expression | null;
33
+ abstract execute(): TcbExpr | null;
34
34
  /**
35
35
  * Replacement value or operation used while this `TcbOp` is executing (i.e. to resolve circular
36
36
  * references during its execution).
@@ -39,5 +39,5 @@ export declare abstract class TcbOp {
39
39
  * `TcbOp` can be returned in cases where additional code generation is necessary to deal with
40
40
  * circular references.
41
41
  */
42
- circularFallback(): TcbOp | ts.Expression;
42
+ circularFallback(): TcbOp | TcbExpr;
43
43
  }
@@ -11,6 +11,7 @@ import { TypeCheckableDirectiveMeta } from '../../api';
11
11
  import { ClassPropertyName } from '../../../metadata';
12
12
  import { Reference } from '../../../imports';
13
13
  import { Context } from './context';
14
+ import { TcbExpr } from './codegen';
14
15
  export interface TcbBoundAttribute {
15
16
  value: AST | string;
16
17
  sourceSpan: ParseSourceSpan;
@@ -33,9 +34,13 @@ export interface TcbDirectiveBoundInput {
33
34
  */
34
35
  field: string;
35
36
  /**
36
- * The `ts.Expression` corresponding with the input binding expression.
37
+ * The `TcbExpr` corresponding with the input binding expression.
37
38
  */
38
- expression: ts.Expression;
39
+ expression: TcbExpr;
40
+ /**
41
+ * The input's original value expression.
42
+ */
43
+ originalExpression: AST | string;
39
44
  /**
40
45
  * The source span of the full attribute binding.
41
46
  */
@@ -61,4 +66,4 @@ export declare function checkSplitTwoWayBinding(inputName: string, output: TmplA
61
66
  /**
62
67
  * Potentially widens the type of `expr` according to the type-checking configuration.
63
68
  */
64
- export declare function widenBinding(expr: ts.Expression, tcb: Context): ts.Expression;
69
+ export declare function widenBinding(expr: TcbExpr, tcb: Context, originalValue: string | AST): TcbExpr;
@@ -0,0 +1,74 @@
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.dev/license
7
+ */
8
+ import { AbsoluteSourceSpan, ParseSourceSpan } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { ExpressionIdentifier } from '../comments';
11
+ /** Represents an expression generated within a type check block. */
12
+ export declare class TcbExpr {
13
+ private source;
14
+ /** Text for the content containing the expression's location information. */
15
+ private spanComment;
16
+ /** Text for the content containing the expression's identifier. */
17
+ private identifierComment;
18
+ /**
19
+ * Text of the comment instructing the type checker to
20
+ * ignore diagnostics coming from this expression.
21
+ */
22
+ private ignoreComment;
23
+ constructor(source: string);
24
+ /**
25
+ * Converts the node's current state to a string.
26
+ * @param ignoreComments Whether the comments associated with the expression should be skipped.
27
+ */
28
+ print(ignoreComments?: boolean): string;
29
+ /**
30
+ * Adds a synthetic comment to the expression that represents the parse span of the provided node.
31
+ * This comment can later be retrieved as trivia of a node to recover original source locations.
32
+ * @param span Span from the parser containing the location information.
33
+ */
34
+ addParseSpanInfo(span: AbsoluteSourceSpan | ParseSourceSpan): this;
35
+ /** Marks the expression to be ignored for diagnostics. */
36
+ markIgnoreDiagnostics(): this;
37
+ /**
38
+ * Wraps the expression in parenthesis such that inserted
39
+ * span comments become attached to the proper node.
40
+ */
41
+ wrapForTypeChecker(): this;
42
+ /**
43
+ * Tags the expression with an identifier.
44
+ * @param identifier Identifier to apply to the expression.
45
+ */
46
+ addExpressionIdentifier(identifier: ExpressionIdentifier): this;
47
+ /**
48
+ * `toString` implementation meant to catch errors like accidentally
49
+ * writing `foo ${expr} bar` instead of `foo ${expr.print()} bar`.
50
+ */
51
+ toString(): never;
52
+ /** Format a comment string as a TypeScript comment. */
53
+ private formatComment;
54
+ }
55
+ /**
56
+ * Declares a variable with a specific type.
57
+ * @param identifier Identifier used to refer to the variable.
58
+ * @param type Type that the variable should be initialized to.
59
+ */
60
+ export declare function declareVariable(identifier: TcbExpr, type: TcbExpr): TcbExpr;
61
+ /**
62
+ * Formats an array of `TcbExpr` as a block of single statements.
63
+ * @param expressions Expressions to format.
64
+ * @param singleLine Whether to print them on a single line or across multiple. Defaults to multiple.
65
+ */
66
+ export declare function getStatementsBlock(expressions: TcbExpr[], singleLine?: boolean): string;
67
+ /** Wraps a string value in quotes and escapes relevant characters. */
68
+ export declare function quoteAndEscape(value: string): string;
69
+ /**
70
+ * Prints a TypeScript node as a string.
71
+ *
72
+ * @deprecated This is a temporary method until all code generation code has been migrated.
73
+ */
74
+ export declare function tempPrint(node: ts.Node, sourceFile: ts.SourceFile): string;
@@ -6,7 +6,6 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { BoundTarget, SchemaMetadata } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { DomSchemaChecker } from '../dom';
11
10
  import { OutOfBandDiagnosticRecorder } from '../oob';
12
11
  import { TypeCheckableDirectiveMeta, TypeCheckId } from '../../api';
@@ -62,6 +61,6 @@ export declare class Context {
62
61
  * Currently this uses a monotonically increasing counter, but in the future the variable name
63
62
  * might change depending on the type of data being stored.
64
63
  */
65
- allocateId(): ts.Identifier;
64
+ allocateId(): string;
66
65
  getPipeByName(name: string): PipeMeta | null;
67
66
  }
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { DirectiveOwner } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbOp } from './base';
10
+ import { TcbExpr } from './codegen';
11
11
  import { Context } from './context';
12
12
  import type { Scope } from './scope';
13
13
  import { TypeCheckableDirectiveMeta } from '../../api';
@@ -32,7 +32,7 @@ export declare class TcbDirectiveCtorOp extends TcbOp {
32
32
  private customFormControlType;
33
33
  constructor(tcb: Context, scope: Scope, node: DirectiveOwner, dir: TypeCheckableDirectiveMeta, customFormControlType: CustomFormControlType | null);
34
34
  get optional(): boolean;
35
- execute(): ts.Identifier;
35
+ execute(): TcbExpr;
36
36
  circularFallback(): TcbOp;
37
37
  }
38
38
  /**
@@ -55,5 +55,5 @@ export declare class TcbDirectiveCtorCircularFallbackOp extends TcbOp {
55
55
  private dir;
56
56
  constructor(tcb: Context, scope: Scope, dir: TypeCheckableDirectiveMeta);
57
57
  get optional(): boolean;
58
- execute(): ts.Identifier;
58
+ execute(): TcbExpr;
59
59
  }
@@ -6,10 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { DirectiveOwner } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import type { Context } from './context';
11
10
  import type { Scope } from './scope';
12
11
  import { TcbOp } from './base';
12
+ import { TcbExpr } from './codegen';
13
13
  import { TypeCheckableDirectiveMeta } from '../../api';
14
14
  /**
15
15
  * A `TcbOp` which constructs an instance of a directive. For generic directives, generic
@@ -22,7 +22,7 @@ export declare abstract class TcbDirectiveTypeOpBase extends TcbOp {
22
22
  protected dir: TypeCheckableDirectiveMeta;
23
23
  constructor(tcb: Context, scope: Scope, node: DirectiveOwner, dir: TypeCheckableDirectiveMeta);
24
24
  get optional(): boolean;
25
- execute(): ts.Identifier;
25
+ execute(): TcbExpr;
26
26
  }
27
27
  /**
28
28
  * A `TcbOp` which constructs an instance of a non-generic directive _without_ setting any of its
@@ -38,7 +38,7 @@ export declare class TcbNonGenericDirectiveTypeOp extends TcbDirectiveTypeOpBase
38
38
  * Creates a variable declaration for this op's directive of the argument type. Returns the id of
39
39
  * the newly created variable.
40
40
  */
41
- execute(): ts.Identifier;
41
+ execute(): TcbExpr;
42
42
  }
43
43
  /**
44
44
  * A `TcbOp` which constructs an instance of a generic directive with its generic parameters set
@@ -49,5 +49,5 @@ export declare class TcbNonGenericDirectiveTypeOp extends TcbDirectiveTypeOpBase
49
49
  * type parameters set to `any`.
50
50
  */
51
51
  export declare class TcbGenericDirectiveTypeWithAnyParamsOp extends TcbDirectiveTypeOpBase {
52
- execute(): ts.Identifier;
52
+ execute(): TcbExpr;
53
53
  }
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { TmplAstElement } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbOp } from './base';
10
+ import { TcbExpr } from './codegen';
11
11
  import type { Context } from './context';
12
12
  import type { Scope } from './scope';
13
13
  /**
@@ -22,5 +22,5 @@ export declare class TcbElementOp extends TcbOp {
22
22
  private element;
23
23
  constructor(tcb: Context, scope: Scope, element: TmplAstElement);
24
24
  get optional(): boolean;
25
- execute(): ts.Identifier;
25
+ execute(): TcbExpr;
26
26
  }
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { AST, DirectiveOwner, TmplAstBoundAttribute, TmplAstBoundEvent } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbOp } from './base';
10
+ import { TcbExpr } from './codegen';
11
11
  import type { Context } from './context';
12
12
  import type { Scope } from './scope';
13
13
  import { TypeCheckableDirectiveMeta } from '../../api';
@@ -17,7 +17,7 @@ import { LocalSymbol } from './references';
17
17
  * `ts.Expression`, with special handling of the `$event` variable that can be used within event
18
18
  * bindings.
19
19
  */
20
- export declare function tcbEventHandlerExpression(ast: AST, tcb: Context, scope: Scope): ts.Expression;
20
+ export declare function tcbEventHandlerExpression(ast: AST, tcb: Context, scope: Scope): TcbExpr;
21
21
  /**
22
22
  * A `TcbOp` which generates code to check event bindings on an element that correspond with the
23
23
  * outputs of a directive.
@@ -6,19 +6,19 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { AST, PropertyRead, TmplAstLetDeclaration } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbOp } from './base';
10
+ import { TcbExpr } from './codegen';
11
11
  import type { Context } from './context';
12
12
  import type { Scope } from './scope';
13
13
  /**
14
14
  * Process an `AST` expression and convert it into a `ts.Expression`, generating references to the
15
15
  * correct identifiers in the current scope.
16
16
  */
17
- export declare function tcbExpression(ast: AST, tcb: Context, scope: Scope): ts.Expression;
17
+ export declare function tcbExpression(ast: AST, tcb: Context, scope: Scope): TcbExpr;
18
18
  /**
19
19
  * Wraps an expression in an `unwrapSignal` call which extracts the signal's value.
20
20
  */
21
- export declare function unwrapWritableSignal(expression: ts.Expression, tcb: Context): ts.CallExpression;
21
+ export declare function unwrapWritableSignal(expression: TcbExpr, tcb: Context): TcbExpr;
22
22
  /**
23
23
  * A `TcbOp` which renders an Angular expression (e.g. `{{foo() && bar.baz}}`).
24
24
  *
@@ -51,14 +51,14 @@ export declare class TcbExpressionTranslator {
51
51
  protected tcb: Context;
52
52
  protected scope: Scope;
53
53
  constructor(tcb: Context, scope: Scope);
54
- translate(ast: AST): ts.Expression;
54
+ translate(ast: AST): TcbExpr;
55
55
  /**
56
56
  * Resolve an `AST` expression within the given scope.
57
57
  *
58
58
  * Some `AST` expressions refer to top-level concepts (references, variables, the component
59
59
  * context). This method assists in resolving those.
60
60
  */
61
- protected resolve(ast: AST): ts.Expression | null;
61
+ protected resolve(ast: AST): TcbExpr | null;
62
62
  private getTargetNodeExpression;
63
63
  protected isValidLetDeclarationAccess(target: TmplAstLetDeclaration, ast: PropertyRead): boolean;
64
64
  }
@@ -6,11 +6,11 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { AST, TmplAstForLoopBlock } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbExpressionTranslator } from './expression';
11
10
  import type { Context } from './context';
12
11
  import type { Scope } from './scope';
13
12
  import { TcbOp } from './base';
13
+ import { TcbExpr } from './codegen';
14
14
  /**
15
15
  * A `TcbOp` which renders a `for` block as a TypeScript `for...of` loop.
16
16
  *
@@ -28,5 +28,5 @@ export declare class TcbForLoopTrackTranslator extends TcbExpressionTranslator {
28
28
  private block;
29
29
  private allowedVariables;
30
30
  constructor(tcb: Context, scope: Scope, block: TmplAstForLoopBlock);
31
- protected resolve(ast: AST): ts.Expression | null;
31
+ protected resolve(ast: AST): TcbExpr | null;
32
32
  }
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { TmplAstHostElement } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { TcbOp } from './base';
10
+ import { TcbExpr } from './codegen';
11
11
  import type { Context } from './context';
12
12
  import type { Scope } from './scope';
13
13
  /**
@@ -21,5 +21,5 @@ export declare class TcbHostElementOp extends TcbOp {
21
21
  private element;
22
22
  readonly optional = true;
23
23
  constructor(tcb: Context, scope: Scope, element: TmplAstHostElement);
24
- execute(): ts.Identifier;
24
+ execute(): TcbExpr;
25
25
  }
@@ -6,17 +6,17 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { AST, TmplAstBoundAttribute, TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstTemplate } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import type { Context } from './context';
11
10
  import type { Scope } from './scope';
12
11
  import { TypeCheckableDirectiveMeta } from '../../api';
13
12
  import { TcbOp } from './base';
13
+ import { TcbExpr } from './codegen';
14
14
  import { CustomFormControlType } from './signal_forms';
15
15
  import { LocalSymbol } from './references';
16
16
  /**
17
17
  * Translates the given attribute binding to a `ts.Expression`.
18
18
  */
19
- export declare function translateInput(value: AST | string, tcb: Context, scope: Scope): ts.Expression;
19
+ export declare function translateInput(value: AST | string, tcb: Context, scope: Scope): TcbExpr;
20
20
  /**
21
21
  * A `TcbOp` which generates code to check input bindings on an element that correspond with the
22
22
  * members of a directive.
@@ -6,10 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { TmplAstLetDeclaration } from '@angular/compiler';
9
- import ts from 'typescript';
10
9
  import { Context } from './context';
11
10
  import type { Scope } from './scope';
12
11
  import { TcbOp } from './base';
12
+ import { TcbExpr } from './codegen';
13
13
  /**
14
14
  * A `TcbOp` which generates a constant for a `TmplAstLetDeclaration`.
15
15
  *
@@ -25,5 +25,5 @@ export declare class TcbLetDeclarationOp extends TcbOp {
25
25
  * should be checked even if they aren't referenced anywhere.
26
26
  */
27
27
  readonly optional = false;
28
- execute(): ts.Identifier;
28
+ execute(): TcbExpr;
29
29
  }