@angular/compiler-cli 21.0.0-rc.2 → 21.0.0

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 (39) hide show
  1. package/bundles/{chunk-JCBKDAHA.js → chunk-3UWOVJPM.js} +1 -1
  2. package/bundles/{chunk-Y65S2AOA.js → chunk-67N3I5R2.js} +1643 -1525
  3. package/bundles/{chunk-UI6E44E7.js → chunk-EZPRBQ4S.js} +2 -2
  4. package/bundles/{chunk-Z6XYTYZD.js → chunk-IUWOX36C.js} +1 -1
  5. package/bundles/chunk-ZJZNLTWN.js +1 -1
  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/typecheck/src/ops/base.d.ts +43 -0
  15. package/src/ngtsc/typecheck/src/ops/bindings.d.ts +64 -0
  16. package/src/ngtsc/typecheck/src/ops/completions.d.ts +22 -0
  17. package/src/ngtsc/typecheck/src/ops/content_projection.d.ts +34 -0
  18. package/src/ngtsc/typecheck/src/ops/context.d.ts +67 -0
  19. package/src/ngtsc/typecheck/src/ops/directive_constructor.d.ts +59 -0
  20. package/src/ngtsc/typecheck/src/ops/directive_type.d.ts +53 -0
  21. package/src/ngtsc/typecheck/src/ops/element.d.ts +26 -0
  22. package/src/ngtsc/typecheck/src/ops/events.d.ts +55 -0
  23. package/src/ngtsc/typecheck/src/ops/expression.d.ts +49 -0
  24. package/src/ngtsc/typecheck/src/ops/for_block.d.ts +32 -0
  25. package/src/ngtsc/typecheck/src/ops/host.d.ts +25 -0
  26. package/src/ngtsc/typecheck/src/ops/if_block.d.ts +28 -0
  27. package/src/ngtsc/typecheck/src/ops/inputs.d.ts +56 -0
  28. package/src/ngtsc/typecheck/src/ops/intersection_observer.d.ts +22 -0
  29. package/src/ngtsc/typecheck/src/ops/let.d.ts +29 -0
  30. package/src/ngtsc/typecheck/src/ops/references.d.ts +57 -0
  31. package/src/ngtsc/typecheck/src/ops/schema.d.ts +31 -0
  32. package/src/ngtsc/typecheck/src/ops/scope.d.ts +187 -0
  33. package/src/ngtsc/typecheck/src/ops/selectorless.d.ts +26 -0
  34. package/src/ngtsc/typecheck/src/ops/signal_forms.d.ts +40 -0
  35. package/src/ngtsc/typecheck/src/ops/switch_block.d.ts +25 -0
  36. package/src/ngtsc/typecheck/src/ops/template.d.ts +40 -0
  37. package/src/ngtsc/typecheck/src/ops/variables.d.ts +56 -0
  38. package/src/ngtsc/typecheck/src/type_check_block.d.ts +2 -274
  39. package/src/ngtsc/typecheck/src/type_check_file.d.ts +1 -1
@@ -0,0 +1,32 @@
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 { AST, TmplAstForLoopBlock } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbExpressionTranslator } from './expression';
11
+ import type { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ import { TcbOp } from './base';
14
+ /**
15
+ * A `TcbOp` which renders a `for` block as a TypeScript `for...of` loop.
16
+ *
17
+ * Executing this operation returns nothing.
18
+ */
19
+ export declare class TcbForOfOp extends TcbOp {
20
+ private tcb;
21
+ private scope;
22
+ private block;
23
+ constructor(tcb: Context, scope: Scope, block: TmplAstForLoopBlock);
24
+ get optional(): boolean;
25
+ execute(): null;
26
+ }
27
+ export declare class TcbForLoopTrackTranslator extends TcbExpressionTranslator {
28
+ private block;
29
+ private allowedVariables;
30
+ constructor(tcb: Context, scope: Scope, block: TmplAstForLoopBlock);
31
+ protected resolve(ast: AST): ts.Expression | null;
32
+ }
@@ -0,0 +1,25 @@
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 { TmplAstHostElement } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import type { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ /**
14
+ * A `TcbOp` which creates an expression for a the host element of a directive.
15
+ *
16
+ * Executing this operation returns a reference to the element variable.
17
+ */
18
+ export declare class TcbHostElementOp extends TcbOp {
19
+ private tcb;
20
+ private scope;
21
+ private element;
22
+ readonly optional = true;
23
+ constructor(tcb: Context, scope: Scope, element: TmplAstHostElement);
24
+ execute(): ts.Identifier;
25
+ }
@@ -0,0 +1,28 @@
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 { TmplAstIfBlock } from '@angular/compiler';
9
+ import { TcbOp } from './base';
10
+ import type { Scope } from './scope';
11
+ import type { Context } from './context';
12
+ /**
13
+ * A `TcbOp` which renders an `if` template block as a TypeScript `if` statement.
14
+ *
15
+ * Executing this operation returns nothing.
16
+ */
17
+ export declare class TcbIfOp extends TcbOp {
18
+ private tcb;
19
+ private scope;
20
+ private block;
21
+ private expressionScopes;
22
+ constructor(tcb: Context, scope: Scope, block: TmplAstIfBlock);
23
+ get optional(): boolean;
24
+ execute(): null;
25
+ private generateBranch;
26
+ private getBranchScope;
27
+ private generateBranchGuard;
28
+ }
@@ -0,0 +1,56 @@
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 { AST, TmplAstBoundAttribute, TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstTemplate } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import type { Context } from './context';
11
+ import type { Scope } from './scope';
12
+ import { TypeCheckableDirectiveMeta } from '../../api';
13
+ import { TcbOp } from './base';
14
+ import { CustomFieldType } from './signal_forms';
15
+ import { LocalSymbol } from './references';
16
+ /**
17
+ * Translates the given attribute binding to a `ts.Expression`.
18
+ */
19
+ export declare function translateInput(value: AST | string, tcb: Context, scope: Scope): ts.Expression;
20
+ /**
21
+ * A `TcbOp` which generates code to check input bindings on an element that correspond with the
22
+ * members of a directive.
23
+ *
24
+ * Executing this operation returns nothing.
25
+ */
26
+ export declare class TcbDirectiveInputsOp extends TcbOp {
27
+ private tcb;
28
+ private scope;
29
+ private node;
30
+ private dir;
31
+ private customControlType;
32
+ constructor(tcb: Context, scope: Scope, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective, dir: TypeCheckableDirectiveMeta, customControlType: CustomFieldType | null);
33
+ get optional(): boolean;
34
+ execute(): null;
35
+ private checkRequiredInputs;
36
+ }
37
+ /**
38
+ * A `TcbOp` which generates code to check "unclaimed inputs" - bindings on an element which were
39
+ * not attributed to any directive or component, and are instead processed against the HTML element
40
+ * itself.
41
+ *
42
+ * Currently, only the expressions of these bindings are checked. The targets of the bindings are
43
+ * checked against the DOM schema via a `TcbDomSchemaCheckerOp`.
44
+ *
45
+ * Executing this operation returns nothing.
46
+ */
47
+ export declare class TcbUnclaimedInputsOp extends TcbOp {
48
+ private tcb;
49
+ private scope;
50
+ private inputs;
51
+ private target;
52
+ private claimedInputs;
53
+ constructor(tcb: Context, scope: Scope, inputs: TmplAstBoundAttribute[], target: LocalSymbol, claimedInputs: Set<string> | null);
54
+ get optional(): boolean;
55
+ execute(): null;
56
+ }
@@ -0,0 +1,22 @@
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 { AST } from '@angular/compiler';
9
+ import { TcbOp } from './base';
10
+ import { Context } from './context';
11
+ import type { Scope } from './scope';
12
+ /**
13
+ * A `TcbOp` which can be used to type check the options of an `IntersectionObserver`.
14
+ */
15
+ export declare class TcbIntersectionObserverOp extends TcbOp {
16
+ private tcb;
17
+ private scope;
18
+ private options;
19
+ constructor(tcb: Context, scope: Scope, options: AST);
20
+ readonly optional = false;
21
+ execute(): null;
22
+ }
@@ -0,0 +1,29 @@
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 { TmplAstLetDeclaration } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { Context } from './context';
11
+ import type { Scope } from './scope';
12
+ import { TcbOp } from './base';
13
+ /**
14
+ * A `TcbOp` which generates a constant for a `TmplAstLetDeclaration`.
15
+ *
16
+ * Executing this operation returns a reference to the `@let` declaration.
17
+ */
18
+ export declare class TcbLetDeclarationOp extends TcbOp {
19
+ private tcb;
20
+ private scope;
21
+ private node;
22
+ constructor(tcb: Context, scope: Scope, node: TmplAstLetDeclaration);
23
+ /**
24
+ * `@let` declarations are mandatory, because their expressions
25
+ * should be checked even if they aren't referenced anywhere.
26
+ */
27
+ readonly optional = false;
28
+ execute(): ts.Identifier;
29
+ }
@@ -0,0 +1,57 @@
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 { TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstHostElement, TmplAstLetDeclaration, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import type { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ import { TypeCheckableDirectiveMeta } from '../../api';
14
+ /** Types that can referenced locally in a template. */
15
+ export type LocalSymbol = TmplAstElement | TmplAstTemplate | TmplAstVariable | TmplAstLetDeclaration | TmplAstReference | TmplAstHostElement | TmplAstComponent | TmplAstDirective;
16
+ /**
17
+ * A `TcbOp` which creates a variable for a local ref in a template.
18
+ * The initializer for the variable is the variable expression for the directive, template, or
19
+ * element the ref refers to. When the reference is used in the template, those TCB statements will
20
+ * access this variable as well. For example:
21
+ * ```ts
22
+ * var _t1 = document.createElement('div');
23
+ * var _t2 = _t1;
24
+ * _t2.value
25
+ * ```
26
+ * This operation supports more fluent lookups for the `TemplateTypeChecker` when getting a symbol
27
+ * for a reference. In most cases, this isn't essential; that is, the information for the symbol
28
+ * could be gathered without this operation using the `BoundTarget`. However, for the case of
29
+ * ng-template references, we will need this reference variable to not only provide a location in
30
+ * the shim file, but also to narrow the variable to the correct `TemplateRef<T>` type rather than
31
+ * `TemplateRef<any>` (this work is still TODO).
32
+ *
33
+ * Executing this operation returns a reference to the directive instance variable with its inferred
34
+ * type.
35
+ */
36
+ export declare class TcbReferenceOp extends TcbOp {
37
+ private readonly tcb;
38
+ private readonly scope;
39
+ private readonly node;
40
+ private readonly host;
41
+ private readonly target;
42
+ constructor(tcb: Context, scope: Scope, node: TmplAstReference, host: TmplAstElement | TmplAstTemplate | TmplAstComponent | TmplAstDirective, target: TypeCheckableDirectiveMeta | TmplAstTemplate | TmplAstElement);
43
+ readonly optional = true;
44
+ execute(): ts.Identifier;
45
+ }
46
+ /**
47
+ * A `TcbOp` which is used when the target of a reference is missing. This operation generates a
48
+ * variable of type any for usages of the invalid reference to resolve to. The invalid reference
49
+ * itself is recorded out-of-band.
50
+ */
51
+ export declare class TcbInvalidReferenceOp extends TcbOp {
52
+ private readonly tcb;
53
+ private readonly scope;
54
+ constructor(tcb: Context, scope: Scope);
55
+ readonly optional = true;
56
+ execute(): ts.Identifier;
57
+ }
@@ -0,0 +1,31 @@
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 { TmplAstComponent, TmplAstElement, TmplAstHostElement } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import { Context } from './context';
12
+ /**
13
+ * A `TcbOp` which feeds elements and unclaimed properties to the `DomSchemaChecker`.
14
+ *
15
+ * The DOM schema is not checked via TCB code generation. Instead, the `DomSchemaChecker` ingests
16
+ * elements and property bindings and accumulates synthetic `ts.Diagnostic`s out-of-band. These are
17
+ * later merged with the diagnostics generated from the TCB.
18
+ *
19
+ * For convenience, the TCB iteration of the template is used to drive the `DomSchemaChecker` via
20
+ * the `TcbDomSchemaCheckerOp`.
21
+ */
22
+ export declare class TcbDomSchemaCheckerOp extends TcbOp {
23
+ private tcb;
24
+ private element;
25
+ private checkElement;
26
+ private claimedInputs;
27
+ constructor(tcb: Context, element: TmplAstElement | TmplAstComponent | TmplAstHostElement, checkElement: boolean, claimedInputs: Set<string> | null);
28
+ get optional(): boolean;
29
+ execute(): ts.Expression | null;
30
+ private getTagName;
31
+ }
@@ -0,0 +1,187 @@
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 { TmplAstForLoopBlock, TmplAstHostElement, TmplAstIfBlockBranch, TmplAstLetDeclaration, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TypeCheckableDirectiveMeta } from '../../api';
11
+ import { Context } from './context';
12
+ import { LocalSymbol } from './references';
13
+ /**
14
+ * Local scope within the type check block for a particular template.
15
+ *
16
+ * The top-level template and each nested `<ng-template>` have their own `Scope`, which exist in a
17
+ * hierarchy. The structure of this hierarchy mirrors the syntactic scopes in the generated type
18
+ * check block, where each nested template is encased in an `if` structure.
19
+ *
20
+ * As a template's `TcbOp`s are executed in a given `Scope`, statements are added via
21
+ * `addStatement()`. When this processing is complete, the `Scope` can be turned into a `ts.Block`
22
+ * via `renderToBlock()`.
23
+ *
24
+ * If a `TcbOp` requires the output of another, it can call `resolve()`.
25
+ */
26
+ export declare class Scope {
27
+ private tcb;
28
+ private parent;
29
+ private guard;
30
+ /**
31
+ * A queue of operations which need to be performed to generate the TCB code for this scope.
32
+ *
33
+ * This array can contain either a `TcbOp` which has yet to be executed, or a `ts.Expression|null`
34
+ * representing the memoized result of executing the operation. As operations are executed, their
35
+ * results are written into the `opQueue`, overwriting the original operation.
36
+ *
37
+ * If an operation is in the process of being executed, it is temporarily overwritten here with
38
+ * `INFER_TYPE_FOR_CIRCULAR_OP_EXPR`. This way, if a cycle is encountered where an operation
39
+ * depends transitively on its own result, the inner operation will infer the least narrow type
40
+ * that fits instead. This has the same semantics as TypeScript itself when types are referenced
41
+ * circularly.
42
+ */
43
+ private opQueue;
44
+ /**
45
+ * A map of `TmplAstElement`s to the index of their `TcbElementOp` in the `opQueue`
46
+ */
47
+ private elementOpMap;
48
+ /**
49
+ * A map of `TmplAstHostElement`s to the index of their `TcbHostElementOp` in the `opQueue`
50
+ */
51
+ private hostElementOpMap;
52
+ /**
53
+ * A map of `TmplAstComponent`s to the index of their `TcbComponentNodeOp` in the `opQueue`
54
+ */
55
+ private componentNodeOpMap;
56
+ /**
57
+ * A map of maps which tracks the index of `TcbDirectiveCtorOp`s in the `opQueue` for each
58
+ * directive on a `TmplAstElement` or `TmplAstTemplate` node.
59
+ */
60
+ private directiveOpMap;
61
+ /**
62
+ * A map of `TmplAstReference`s to the index of their `TcbReferenceOp` in the `opQueue`
63
+ */
64
+ private referenceOpMap;
65
+ /**
66
+ * Map of immediately nested <ng-template>s (within this `Scope`) represented by `TmplAstTemplate`
67
+ * nodes to the index of their `TcbTemplateContextOp`s in the `opQueue`.
68
+ */
69
+ private templateCtxOpMap;
70
+ /**
71
+ * Map of variables declared on the template that created this `Scope` (represented by
72
+ * `TmplAstVariable` nodes) to the index of their `TcbVariableOp`s in the `opQueue`, or to
73
+ * pre-resolved variable identifiers.
74
+ */
75
+ private varMap;
76
+ /**
77
+ * A map of the names of `TmplAstLetDeclaration`s to the index of their op in the `opQueue`.
78
+ *
79
+ * Assumes that there won't be duplicated `@let` declarations within the same scope.
80
+ */
81
+ private letDeclOpMap;
82
+ /**
83
+ * Statements for this template.
84
+ *
85
+ * Executing the `TcbOp`s in the `opQueue` populates this array.
86
+ */
87
+ private statements;
88
+ /**
89
+ * Gets names of the for loop context variables and their types.
90
+ */
91
+ private static getForLoopContextVariableTypes;
92
+ private constructor();
93
+ /**
94
+ * Constructs a `Scope` given either a `TmplAstTemplate` or a list of `TmplAstNode`s.
95
+ *
96
+ * @param tcb the overall context of TCB generation.
97
+ * @param parentScope the `Scope` of the parent template (if any) or `null` if this is the root
98
+ * `Scope`.
99
+ * @param scopedNode Node that provides the scope around the child nodes (e.g. a
100
+ * `TmplAstTemplate` node exposing variables to its children).
101
+ * @param children Child nodes that should be appended to the TCB.
102
+ * @param guard an expression that is applied to this scope for type narrowing purposes.
103
+ */
104
+ static forNodes(tcb: Context, parentScope: Scope | null, scopedNode: TmplAstTemplate | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstHostElement | null, children: TmplAstNode[] | null, guard: ts.Expression | null): Scope;
105
+ /** Registers a local variable with a scope. */
106
+ private static registerVariable;
107
+ /**
108
+ * Look up a `ts.Expression` representing the value of some operation in the current `Scope`,
109
+ * including any parent scope(s). This method always returns a mutable clone of the
110
+ * `ts.Expression` with the comments cleared.
111
+ *
112
+ * @param node a `TmplAstNode` of the operation in question. The lookup performed will depend on
113
+ * the type of this node:
114
+ *
115
+ * Assuming `directive` is not present, then `resolve` will return:
116
+ *
117
+ * * `TmplAstElement` - retrieve the expression for the element DOM node
118
+ * * `TmplAstTemplate` - retrieve the template context variable
119
+ * * `TmplAstVariable` - retrieve a template let- variable
120
+ * * `TmplAstLetDeclaration` - retrieve a template `@let` declaration
121
+ * * `TmplAstReference` - retrieve variable created for the local ref
122
+ *
123
+ * @param directive if present, a directive type on a `TmplAstElement` or `TmplAstTemplate` to
124
+ * look up instead of the default for an element or template node.
125
+ */
126
+ resolve(node: LocalSymbol, directive?: TypeCheckableDirectiveMeta): ts.Identifier | ts.NonNullExpression;
127
+ /**
128
+ * Add a statement to this scope.
129
+ */
130
+ addStatement(stmt: ts.Statement): void;
131
+ /**
132
+ * Get the statements.
133
+ */
134
+ render(): ts.Statement[];
135
+ /**
136
+ * Returns an expression of all template guards that apply to this scope, including those of
137
+ * parent scopes. If no guards have been applied, null is returned.
138
+ */
139
+ guards(): ts.Expression | null;
140
+ /** Returns whether a template symbol is defined locally within the current scope. */
141
+ isLocal(node: TmplAstVariable | TmplAstLetDeclaration | TmplAstReference): boolean;
142
+ /**
143
+ * Constructs a `Scope` given either a `TmplAstTemplate` or a list of `TmplAstNode`s.
144
+ * This is identical to `Scope.forNodes` which we can't reference in some ops due to
145
+ * circular dependencies.
146
+ *.
147
+ * @param parentScope the `Scope` of the parent template.
148
+ * @param scopedNode Node that provides the scope around the child nodes (e.g. a
149
+ * `TmplAstTemplate` node exposing variables to its children).
150
+ * @param children Child nodes that should be appended to the TCB.
151
+ * @param guard an expression that is applied to this scope for type narrowing purposes.
152
+ */
153
+ createChildScope(parentScope: Scope, scopedNode: TmplAstTemplate | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstHostElement | null, children: TmplAstNode[] | null, guard: ts.Expression | null): Scope;
154
+ private resolveLocal;
155
+ /**
156
+ * Like `executeOp`, but assert that the operation actually returned `ts.Expression`.
157
+ */
158
+ private resolveOp;
159
+ /**
160
+ * Execute a particular `TcbOp` in the `opQueue`.
161
+ *
162
+ * This method replaces the operation in the `opQueue` with the result of execution (once done)
163
+ * and also protects against a circular dependency from the operation to itself by temporarily
164
+ * setting the operation's result to a special expression.
165
+ */
166
+ private executeOp;
167
+ private appendNode;
168
+ private appendChildren;
169
+ private checkAndAppendReferencesOfNode;
170
+ private appendDirectivesAndInputsOfElementLikeNode;
171
+ private appendOutputsOfElementLikeNode;
172
+ private appendInputsOfSelectorlessNode;
173
+ private appendOutputsOfSelectorlessNode;
174
+ private appendDirectiveInputs;
175
+ private getDirectiveOp;
176
+ private appendSelectorlessDirectives;
177
+ private appendDeepSchemaChecks;
178
+ private appendIcuExpressions;
179
+ private appendContentProjectionCheckOp;
180
+ private appendComponentNode;
181
+ private appendDeferredBlock;
182
+ private appendDeferredTriggers;
183
+ private appendHostElement;
184
+ private validateReferenceBasedDeferredTrigger;
185
+ /** Reports a diagnostic if there are any `@let` declarations that conflict with a node. */
186
+ private static checkConflictingLet;
187
+ }
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { TmplAstComponent } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ export declare function getComponentTagName(node: TmplAstComponent): string;
14
+ /**
15
+ * A `TcbOp` which creates an expression for a native DOM element from a `TmplAstComponent`.
16
+ *
17
+ * Executing this operation returns a reference to the element variable.
18
+ */
19
+ export declare class TcbComponentNodeOp extends TcbOp {
20
+ private tcb;
21
+ private scope;
22
+ private component;
23
+ readonly optional = true;
24
+ constructor(tcb: Context, scope: Scope, component: TmplAstComponent);
25
+ execute(): ts.Identifier;
26
+ }
@@ -0,0 +1,40 @@
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 { DirectiveOwner, TmplAstComponent, TmplAstDirective, TmplAstElement, TmplAstTemplate } from '@angular/compiler';
9
+ import { TcbOp } from './base';
10
+ import type { Context } from './context';
11
+ import type { Scope } from './scope';
12
+ import { TypeCheckableDirectiveMeta } from '../../api';
13
+ import { TcbBoundAttribute } from './bindings';
14
+ /** Possible types of custom field directives. */
15
+ export type CustomFieldType = 'value' | 'checkbox';
16
+ /** Names of input fields to which users aren't allowed to bind when using a `field` directive. */
17
+ export declare const customFormControlBannedInputFields: Set<string>;
18
+ /**
19
+ * A `TcbOp` which constructs an instance of the signal forms `Field` directive on a native element.
20
+ */
21
+ export declare class TcbNativeFieldDirectiveTypeOp extends TcbOp {
22
+ private tcb;
23
+ private scope;
24
+ private node;
25
+ /** Bindings that aren't supported on signal form fields. */
26
+ protected readonly unsupportedBindingFields: Set<string>;
27
+ private readonly inputType;
28
+ get optional(): boolean;
29
+ constructor(tcb: Context, scope: Scope, node: TmplAstElement);
30
+ execute(): null;
31
+ private getExpectedTypeFromDomNode;
32
+ private getUnsupportedType;
33
+ }
34
+ /** Expands the set of bound inputs with the ones from custom field directives. */
35
+ export declare function expandBoundAttributesForField(directive: TypeCheckableDirectiveMeta, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective, customFieldType: CustomFieldType): TcbBoundAttribute[] | null;
36
+ export declare function isFieldDirective(meta: TypeCheckableDirectiveMeta): boolean;
37
+ /** Determines if a directive is a custom field and its type. */
38
+ export declare function getCustomFieldDirectiveType(meta: TypeCheckableDirectiveMeta): CustomFieldType | null;
39
+ /** Checks whether a node has bindings that aren't supported on fields. */
40
+ export declare function checkUnsupportedFieldBindings(node: DirectiveOwner, unsupportedBindingFields: Set<string>, tcb: Context): void;
@@ -0,0 +1,25 @@
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 { TmplAstSwitchBlock } from '@angular/compiler';
9
+ import { TcbOp } from './base';
10
+ import type { Scope } from './scope';
11
+ import type { Context } from './context';
12
+ /**
13
+ * A `TcbOp` which renders a `switch` block as a TypeScript `switch` statement.
14
+ *
15
+ * Executing this operation returns nothing.
16
+ */
17
+ export declare class TcbSwitchOp extends TcbOp {
18
+ private tcb;
19
+ private scope;
20
+ private block;
21
+ constructor(tcb: Context, scope: Scope, block: TmplAstSwitchBlock);
22
+ get optional(): boolean;
23
+ execute(): null;
24
+ private generateGuard;
25
+ }
@@ -0,0 +1,40 @@
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 { TmplAstTemplate } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import type { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ /**
14
+ * A `TcbOp` which generates a variable for a `TmplAstTemplate`'s context.
15
+ *
16
+ * Executing this operation returns a reference to the template's context variable.
17
+ */
18
+ export declare class TcbTemplateContextOp extends TcbOp {
19
+ private tcb;
20
+ private scope;
21
+ constructor(tcb: Context, scope: Scope);
22
+ readonly optional = true;
23
+ execute(): ts.Identifier;
24
+ }
25
+ /**
26
+ * A `TcbOp` which descends into a `TmplAstTemplate`'s children and generates type-checking code for
27
+ * them.
28
+ *
29
+ * This operation wraps the children's type-checking code in an `if` block, which may include one
30
+ * or more type guard conditions that narrow types within the template body.
31
+ */
32
+ export declare class TcbTemplateBodyOp extends TcbOp {
33
+ private tcb;
34
+ private scope;
35
+ private template;
36
+ constructor(tcb: Context, scope: Scope, template: TmplAstTemplate);
37
+ get optional(): boolean;
38
+ execute(): null;
39
+ private addDirectiveGuards;
40
+ }
@@ -0,0 +1,56 @@
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 { TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
9
+ import ts from 'typescript';
10
+ import { TcbOp } from './base';
11
+ import type { Context } from './context';
12
+ import type { Scope } from './scope';
13
+ /**
14
+ * A `TcbOp` which renders a variable that is implicitly available within a block (e.g. `$count`
15
+ * in a `@for` block).
16
+ *
17
+ * Executing this operation returns the identifier which can be used to refer to the variable.
18
+ */
19
+ export declare class TcbBlockImplicitVariableOp extends TcbOp {
20
+ private tcb;
21
+ private scope;
22
+ private type;
23
+ private variable;
24
+ constructor(tcb: Context, scope: Scope, type: ts.TypeNode, variable: TmplAstVariable);
25
+ readonly optional = true;
26
+ execute(): ts.Identifier;
27
+ }
28
+ /**
29
+ * A `TcbOp` which creates an expression for particular let- `TmplAstVariable` on a
30
+ * `TmplAstTemplate`'s context.
31
+ *
32
+ * Executing this operation returns a reference to the variable variable (lol).
33
+ */
34
+ export declare class TcbTemplateVariableOp extends TcbOp {
35
+ private tcb;
36
+ private scope;
37
+ private template;
38
+ private variable;
39
+ constructor(tcb: Context, scope: Scope, template: TmplAstTemplate, variable: TmplAstVariable);
40
+ get optional(): boolean;
41
+ execute(): ts.Identifier;
42
+ }
43
+ /**
44
+ * A `TcbOp` which renders a variable defined inside of block syntax (e.g. `@if (expr; as var) {}`).
45
+ *
46
+ * Executing this operation returns the identifier which can be used to refer to the variable.
47
+ */
48
+ export declare class TcbBlockVariableOp extends TcbOp {
49
+ private tcb;
50
+ private scope;
51
+ private initializer;
52
+ private variable;
53
+ constructor(tcb: Context, scope: Scope, initializer: ts.Expression, variable: TmplAstVariable);
54
+ get optional(): boolean;
55
+ execute(): ts.Identifier;
56
+ }