@angular/compiler 14.0.0-next.8 → 14.0.0-rc.1

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 (148) hide show
  1. package/esm2020/src/compiler.mjs +3 -2
  2. package/esm2020/src/compiler_facade_interface.mjs +7 -1
  3. package/esm2020/src/core.mjs +6 -6
  4. package/esm2020/src/expression_parser/parser.mjs +12 -12
  5. package/esm2020/src/i18n/i18n_parser.mjs +3 -3
  6. package/esm2020/src/jit_compiler_facade.mjs +74 -42
  7. package/esm2020/src/ml_parser/html_whitespaces.mjs +2 -2
  8. package/esm2020/src/ml_parser/lexer.mjs +36 -36
  9. package/esm2020/src/ml_parser/parser.mjs +41 -41
  10. package/esm2020/src/render3/partial/api.mjs +1 -1
  11. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  12. package/esm2020/src/render3/partial/component.mjs +28 -37
  13. package/esm2020/src/render3/partial/directive.mjs +6 -3
  14. package/esm2020/src/render3/partial/factory.mjs +1 -1
  15. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  16. package/esm2020/src/render3/partial/injector.mjs +1 -1
  17. package/esm2020/src/render3/partial/ng_module.mjs +3 -3
  18. package/esm2020/src/render3/partial/pipe.mjs +6 -3
  19. package/esm2020/src/render3/r3_ast.mjs +3 -3
  20. package/esm2020/src/render3/r3_factory.mjs +6 -6
  21. package/esm2020/src/render3/r3_identifiers.mjs +2 -1
  22. package/esm2020/src/render3/r3_pipe_compiler.mjs +5 -1
  23. package/esm2020/src/render3/util.mjs +4 -4
  24. package/esm2020/src/render3/view/api.mjs +7 -2
  25. package/esm2020/src/render3/view/compiler.mjs +45 -35
  26. package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +58 -5
  27. package/esm2020/src/render3/view/i18n/meta.mjs +4 -4
  28. package/esm2020/src/render3/view/i18n/util.mjs +2 -2
  29. package/esm2020/src/render3/view/style_parser.mjs +19 -19
  30. package/esm2020/src/render3/view/styling_builder.mjs +6 -6
  31. package/esm2020/src/render3/view/template.mjs +25 -25
  32. package/esm2020/src/render3/view/util.mjs +14 -5
  33. package/esm2020/src/selector.mjs +8 -8
  34. package/esm2020/src/template_parser/binding_parser.mjs +8 -8
  35. package/esm2020/src/util.mjs +8 -8
  36. package/esm2020/src/version.mjs +1 -1
  37. package/fesm2015/compiler.mjs +416 -301
  38. package/fesm2015/compiler.mjs.map +1 -1
  39. package/fesm2015/testing.mjs +1 -1
  40. package/fesm2020/compiler.mjs +424 -314
  41. package/fesm2020/compiler.mjs.map +1 -1
  42. package/fesm2020/testing.mjs +1 -1
  43. package/index.d.ts +4964 -5
  44. package/package.json +3 -3
  45. package/testing/index.d.ts +22 -5
  46. package/compiler.d.ts +0 -8
  47. package/public_api.d.ts +0 -13
  48. package/src/assertions.d.ts +0 -8
  49. package/src/chars.d.ts +0 -75
  50. package/src/compiler.d.ts +0 -77
  51. package/src/compiler_facade_interface.d.ts +0 -284
  52. package/src/compiler_util/expression_converter.d.ts +0 -71
  53. package/src/config.d.ts +0 -25
  54. package/src/constant_pool.d.ts +0 -37
  55. package/src/core.d.ts +0 -216
  56. package/src/expression_parser/ast.d.ts +0 -440
  57. package/src/expression_parser/lexer.d.ts +0 -47
  58. package/src/expression_parser/parser.d.ts +0 -315
  59. package/src/i18n/big_integer.d.ts +0 -108
  60. package/src/i18n/digest.d.ts +0 -44
  61. package/src/i18n/extractor_merger.d.ts +0 -27
  62. package/src/i18n/i18n_ast.d.ts +0 -148
  63. package/src/i18n/i18n_html_parser.d.ts +0 -19
  64. package/src/i18n/i18n_parser.d.ts +0 -18
  65. package/src/i18n/index.d.ts +0 -15
  66. package/src/i18n/message_bundle.d.ts +0 -28
  67. package/src/i18n/parse_util.d.ts +0 -14
  68. package/src/i18n/serializers/placeholder.d.ts +0 -25
  69. package/src/i18n/serializers/serializer.d.ts +0 -46
  70. package/src/i18n/serializers/xliff.d.ts +0 -19
  71. package/src/i18n/serializers/xliff2.d.ts +0 -19
  72. package/src/i18n/serializers/xmb.d.ts +0 -22
  73. package/src/i18n/serializers/xml_helper.d.ts +0 -52
  74. package/src/i18n/serializers/xtb.d.ts +0 -20
  75. package/src/i18n/translation_bundle.d.ts +0 -27
  76. package/src/injectable_compiler_2.d.ts +0 -24
  77. package/src/jit_compiler_facade.d.ts +0 -46
  78. package/src/ml_parser/ast.d.ts +0 -89
  79. package/src/ml_parser/entities.d.ts +0 -9
  80. package/src/ml_parser/html_parser.d.ts +0 -13
  81. package/src/ml_parser/html_tags.d.ts +0 -33
  82. package/src/ml_parser/html_whitespaces.d.ts +0 -45
  83. package/src/ml_parser/icu_ast_expander.d.ts +0 -42
  84. package/src/ml_parser/interpolation_config.d.ts +0 -14
  85. package/src/ml_parser/lexer.d.ts +0 -114
  86. package/src/ml_parser/parser.d.ts +0 -26
  87. package/src/ml_parser/tags.d.ts +0 -29
  88. package/src/ml_parser/tokens.d.ts +0 -141
  89. package/src/ml_parser/xml_parser.d.ts +0 -13
  90. package/src/ml_parser/xml_tags.d.ts +0 -24
  91. package/src/output/abstract_emitter.d.ts +0 -66
  92. package/src/output/abstract_js_emitter.d.ts +0 -19
  93. package/src/output/map_util.d.ts +0 -18
  94. package/src/output/output_ast.d.ts +0 -575
  95. package/src/output/output_jit.d.ts +0 -73
  96. package/src/output/output_jit_trusted_types.d.ts +0 -43
  97. package/src/output/source_map.d.ts +0 -29
  98. package/src/parse_util.d.ts +0 -75
  99. package/src/render3/partial/api.d.ts +0 -441
  100. package/src/render3/partial/class_metadata.d.ts +0 -10
  101. package/src/render3/partial/component.d.ts +0 -39
  102. package/src/render3/partial/directive.d.ts +0 -13
  103. package/src/render3/partial/factory.d.ts +0 -3
  104. package/src/render3/partial/injectable.d.ts +0 -19
  105. package/src/render3/partial/injector.d.ts +0 -3
  106. package/src/render3/partial/ng_module.d.ts +0 -3
  107. package/src/render3/partial/pipe.d.ts +0 -12
  108. package/src/render3/partial/util.d.ts +0 -33
  109. package/src/render3/r3_ast.d.ts +0 -211
  110. package/src/render3/r3_class_metadata_compiler.d.ts +0 -35
  111. package/src/render3/r3_factory.d.ts +0 -94
  112. package/src/render3/r3_identifiers.d.ts +0 -182
  113. package/src/render3/r3_injector_compiler.d.ts +0 -18
  114. package/src/render3/r3_jit.d.ts +0 -22
  115. package/src/render3/r3_module_compiler.d.ts +0 -103
  116. package/src/render3/r3_pipe_compiler.d.ts +0 -50
  117. package/src/render3/r3_template_transform.d.ts +0 -24
  118. package/src/render3/util.d.ts +0 -94
  119. package/src/render3/view/api.d.ts +0 -328
  120. package/src/render3/view/compiler.d.ts +0 -86
  121. package/src/render3/view/i18n/context.d.ts +0 -68
  122. package/src/render3/view/i18n/get_msg_utils.d.ts +0 -13
  123. package/src/render3/view/i18n/icu_serializer.d.ts +0 -9
  124. package/src/render3/view/i18n/localize_utils.d.ts +0 -24
  125. package/src/render3/view/i18n/meta.d.ts +0 -78
  126. package/src/render3/view/i18n/util.d.ts +0 -78
  127. package/src/render3/view/style_parser.d.ts +0 -18
  128. package/src/render3/view/styling_builder.d.ts +0 -211
  129. package/src/render3/view/t2_api.d.ts +0 -152
  130. package/src/render3/view/t2_binder.d.ts +0 -57
  131. package/src/render3/view/template.d.ts +0 -450
  132. package/src/render3/view/util.d.ts +0 -94
  133. package/src/resource_loader.d.ts +0 -17
  134. package/src/schema/dom_element_schema_registry.d.ts +0 -45
  135. package/src/schema/dom_security_schema.d.ts +0 -11
  136. package/src/schema/element_schema_registry.d.ts +0 -29
  137. package/src/schema/trusted_types_sinks.d.ts +0 -15
  138. package/src/selector.d.ts +0 -105
  139. package/src/shadow_css.d.ts +0 -76
  140. package/src/style_url_resolver.d.ts +0 -8
  141. package/src/template_parser/binding_parser.d.ts +0 -91
  142. package/src/template_parser/template_preparser.d.ts +0 -24
  143. package/src/util.d.ts +0 -42
  144. package/src/version.d.ts +0 -14
  145. package/testing/package.json +0 -9
  146. package/testing/public_api.d.ts +0 -13
  147. package/testing/src/testing.d.ts +0 -23
  148. package/testing/testing.d.ts +0 -4
@@ -1,33 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as o from '../../output/output_ast';
9
- import { R3DependencyMetadata } from '../r3_factory';
10
- /**
11
- * Creates an array literal expression from the given array, mapping all values to an expression
12
- * using the provided mapping function. If the array is empty or null, then null is returned.
13
- *
14
- * @param values The array to transfer into literal array expression.
15
- * @param mapper The logic to use for creating an expression for the array's values.
16
- * @returns An array literal expression representing `values`, or null if `values` is empty or
17
- * is itself null.
18
- */
19
- export declare function toOptionalLiteralArray<T>(values: T[] | null, mapper: (value: T) => o.Expression): o.LiteralArrayExpr | null;
20
- /**
21
- * Creates an object literal expression from the given object, mapping all values to an expression
22
- * using the provided mapping function. If the object has no keys, then null is returned.
23
- *
24
- * @param object The object to transfer into an object literal expression.
25
- * @param mapper The logic to use for creating an expression for the object's values.
26
- * @returns An object literal expression representing `object`, or null if `object` does not have
27
- * any keys.
28
- */
29
- export declare function toOptionalLiteralMap<T>(object: {
30
- [key: string]: T;
31
- }, mapper: (value: T) => o.Expression): o.LiteralMapExpr | null;
32
- export declare function compileDependencies(deps: R3DependencyMetadata[] | 'invalid' | null): o.LiteralExpr | o.LiteralArrayExpr;
33
- export declare function compileDependency(dep: R3DependencyMetadata): o.LiteralMapExpr;
@@ -1,211 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { SecurityContext } from '../core';
9
- import { AST, BindingType, BoundElementProperty, ParsedEvent, ParsedEventType } from '../expression_parser/ast';
10
- import { I18nMeta } from '../i18n/i18n_ast';
11
- import { ParseSourceSpan } from '../parse_util';
12
- export interface Node {
13
- sourceSpan: ParseSourceSpan;
14
- visit<Result>(visitor: Visitor<Result>): Result;
15
- }
16
- /**
17
- * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently
18
- * require the implementation of a visitor for Comments as they are only collected at
19
- * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`
20
- * is true.
21
- */
22
- export declare class Comment implements Node {
23
- value: string;
24
- sourceSpan: ParseSourceSpan;
25
- constructor(value: string, sourceSpan: ParseSourceSpan);
26
- visit<Result>(_visitor: Visitor<Result>): Result;
27
- }
28
- export declare class Text implements Node {
29
- value: string;
30
- sourceSpan: ParseSourceSpan;
31
- constructor(value: string, sourceSpan: ParseSourceSpan);
32
- visit<Result>(visitor: Visitor<Result>): Result;
33
- }
34
- export declare class BoundText implements Node {
35
- value: AST;
36
- sourceSpan: ParseSourceSpan;
37
- i18n?: I18nMeta | undefined;
38
- constructor(value: AST, sourceSpan: ParseSourceSpan, i18n?: I18nMeta | undefined);
39
- visit<Result>(visitor: Visitor<Result>): Result;
40
- }
41
- /**
42
- * Represents a text attribute in the template.
43
- *
44
- * `valueSpan` may not be present in cases where there is no value `<div a></div>`.
45
- * `keySpan` may also not be present for synthetic attributes from ICU expansions.
46
- */
47
- export declare class TextAttribute implements Node {
48
- name: string;
49
- value: string;
50
- sourceSpan: ParseSourceSpan;
51
- readonly keySpan: ParseSourceSpan | undefined;
52
- valueSpan?: ParseSourceSpan | undefined;
53
- i18n?: I18nMeta | undefined;
54
- constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan?: ParseSourceSpan | undefined, i18n?: I18nMeta | undefined);
55
- visit<Result>(visitor: Visitor<Result>): Result;
56
- }
57
- export declare class BoundAttribute implements Node {
58
- name: string;
59
- type: BindingType;
60
- securityContext: SecurityContext;
61
- value: AST;
62
- unit: string | null;
63
- sourceSpan: ParseSourceSpan;
64
- readonly keySpan: ParseSourceSpan;
65
- valueSpan: ParseSourceSpan | undefined;
66
- i18n: I18nMeta | undefined;
67
- constructor(name: string, type: BindingType, securityContext: SecurityContext, value: AST, unit: string | null, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, i18n: I18nMeta | undefined);
68
- static fromBoundElementProperty(prop: BoundElementProperty, i18n?: I18nMeta): BoundAttribute;
69
- visit<Result>(visitor: Visitor<Result>): Result;
70
- }
71
- export declare class BoundEvent implements Node {
72
- name: string;
73
- type: ParsedEventType;
74
- handler: AST;
75
- target: string | null;
76
- phase: string | null;
77
- sourceSpan: ParseSourceSpan;
78
- handlerSpan: ParseSourceSpan;
79
- readonly keySpan: ParseSourceSpan;
80
- constructor(name: string, type: ParsedEventType, handler: AST, target: string | null, phase: string | null, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan);
81
- static fromParsedEvent(event: ParsedEvent): BoundEvent;
82
- visit<Result>(visitor: Visitor<Result>): Result;
83
- }
84
- export declare class Element implements Node {
85
- name: string;
86
- attributes: TextAttribute[];
87
- inputs: BoundAttribute[];
88
- outputs: BoundEvent[];
89
- children: Node[];
90
- references: Reference[];
91
- sourceSpan: ParseSourceSpan;
92
- startSourceSpan: ParseSourceSpan;
93
- endSourceSpan: ParseSourceSpan | null;
94
- i18n?: I18nMeta | undefined;
95
- constructor(name: string, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], children: Node[], references: Reference[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta | undefined);
96
- visit<Result>(visitor: Visitor<Result>): Result;
97
- }
98
- export declare class Template implements Node {
99
- tagName: string | null;
100
- attributes: TextAttribute[];
101
- inputs: BoundAttribute[];
102
- outputs: BoundEvent[];
103
- templateAttrs: (BoundAttribute | TextAttribute)[];
104
- children: Node[];
105
- references: Reference[];
106
- variables: Variable[];
107
- sourceSpan: ParseSourceSpan;
108
- startSourceSpan: ParseSourceSpan;
109
- endSourceSpan: ParseSourceSpan | null;
110
- i18n?: I18nMeta | undefined;
111
- constructor(tagName: string | null, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], templateAttrs: (BoundAttribute | TextAttribute)[], children: Node[], references: Reference[], variables: Variable[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta | undefined);
112
- visit<Result>(visitor: Visitor<Result>): Result;
113
- }
114
- export declare class Content implements Node {
115
- selector: string;
116
- attributes: TextAttribute[];
117
- sourceSpan: ParseSourceSpan;
118
- i18n?: I18nMeta | undefined;
119
- readonly name = "ng-content";
120
- constructor(selector: string, attributes: TextAttribute[], sourceSpan: ParseSourceSpan, i18n?: I18nMeta | undefined);
121
- visit<Result>(visitor: Visitor<Result>): Result;
122
- }
123
- export declare class Variable implements Node {
124
- name: string;
125
- value: string;
126
- sourceSpan: ParseSourceSpan;
127
- readonly keySpan: ParseSourceSpan;
128
- valueSpan?: ParseSourceSpan | undefined;
129
- constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined);
130
- visit<Result>(visitor: Visitor<Result>): Result;
131
- }
132
- export declare class Reference implements Node {
133
- name: string;
134
- value: string;
135
- sourceSpan: ParseSourceSpan;
136
- readonly keySpan: ParseSourceSpan;
137
- valueSpan?: ParseSourceSpan | undefined;
138
- constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined);
139
- visit<Result>(visitor: Visitor<Result>): Result;
140
- }
141
- export declare class Icu implements Node {
142
- vars: {
143
- [name: string]: BoundText;
144
- };
145
- placeholders: {
146
- [name: string]: Text | BoundText;
147
- };
148
- sourceSpan: ParseSourceSpan;
149
- i18n?: I18nMeta | undefined;
150
- constructor(vars: {
151
- [name: string]: BoundText;
152
- }, placeholders: {
153
- [name: string]: Text | BoundText;
154
- }, sourceSpan: ParseSourceSpan, i18n?: I18nMeta | undefined);
155
- visit<Result>(visitor: Visitor<Result>): Result;
156
- }
157
- export interface Visitor<Result = any> {
158
- visit?(node: Node): Result;
159
- visitElement(element: Element): Result;
160
- visitTemplate(template: Template): Result;
161
- visitContent(content: Content): Result;
162
- visitVariable(variable: Variable): Result;
163
- visitReference(reference: Reference): Result;
164
- visitTextAttribute(attribute: TextAttribute): Result;
165
- visitBoundAttribute(attribute: BoundAttribute): Result;
166
- visitBoundEvent(attribute: BoundEvent): Result;
167
- visitText(text: Text): Result;
168
- visitBoundText(text: BoundText): Result;
169
- visitIcu(icu: Icu): Result;
170
- }
171
- export declare class NullVisitor implements Visitor<void> {
172
- visitElement(element: Element): void;
173
- visitTemplate(template: Template): void;
174
- visitContent(content: Content): void;
175
- visitVariable(variable: Variable): void;
176
- visitReference(reference: Reference): void;
177
- visitTextAttribute(attribute: TextAttribute): void;
178
- visitBoundAttribute(attribute: BoundAttribute): void;
179
- visitBoundEvent(attribute: BoundEvent): void;
180
- visitText(text: Text): void;
181
- visitBoundText(text: BoundText): void;
182
- visitIcu(icu: Icu): void;
183
- }
184
- export declare class RecursiveVisitor implements Visitor<void> {
185
- visitElement(element: Element): void;
186
- visitTemplate(template: Template): void;
187
- visitContent(content: Content): void;
188
- visitVariable(variable: Variable): void;
189
- visitReference(reference: Reference): void;
190
- visitTextAttribute(attribute: TextAttribute): void;
191
- visitBoundAttribute(attribute: BoundAttribute): void;
192
- visitBoundEvent(attribute: BoundEvent): void;
193
- visitText(text: Text): void;
194
- visitBoundText(text: BoundText): void;
195
- visitIcu(icu: Icu): void;
196
- }
197
- export declare class TransformVisitor implements Visitor<Node> {
198
- visitElement(element: Element): Node;
199
- visitTemplate(template: Template): Node;
200
- visitContent(content: Content): Node;
201
- visitVariable(variable: Variable): Node;
202
- visitReference(reference: Reference): Node;
203
- visitTextAttribute(attribute: TextAttribute): Node;
204
- visitBoundAttribute(attribute: BoundAttribute): Node;
205
- visitBoundEvent(attribute: BoundEvent): Node;
206
- visitText(text: Text): Node;
207
- visitBoundText(text: BoundText): Node;
208
- visitIcu(icu: Icu): Node;
209
- }
210
- export declare function visitAll<Result>(visitor: Visitor<Result>, nodes: Node[]): Result[];
211
- export declare function transformAll<Result extends Node>(visitor: Visitor<Node>, nodes: Result[]): Result[];
@@ -1,35 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as o from '../output/output_ast';
9
- export declare type CompileClassMetadataFn = (metadata: R3ClassMetadata) => o.Expression;
10
- /**
11
- * Metadata of a class which captures the original Angular decorators of a class. The original
12
- * decorators are preserved in the generated code to allow TestBed APIs to recompile the class
13
- * using the original decorator with a set of overrides applied.
14
- */
15
- export interface R3ClassMetadata {
16
- /**
17
- * The class type for which the metadata is captured.
18
- */
19
- type: o.Expression;
20
- /**
21
- * An expression representing the Angular decorators that were applied on the class.
22
- */
23
- decorators: o.Expression;
24
- /**
25
- * An expression representing the Angular decorators applied to constructor parameters, or `null`
26
- * if there is no constructor.
27
- */
28
- ctorParameters: o.Expression | null;
29
- /**
30
- * An expression representing the Angular decorators that were applied on the properties of the
31
- * class, or `null` if no properties have decorators.
32
- */
33
- propDecorators: o.Expression | null;
34
- }
35
- export declare function compileClassMetadata(metadata: R3ClassMetadata): o.Expression;
@@ -1,94 +0,0 @@
1
- import * as o from '../output/output_ast';
2
- import { R3CompiledExpression, R3Reference } from './util';
3
- /**
4
- * Metadata required by the factory generator to generate a `factory` function for a type.
5
- */
6
- export interface R3ConstructorFactoryMetadata {
7
- /**
8
- * String name of the type being generated (used to name the factory function).
9
- */
10
- name: string;
11
- /**
12
- * An expression representing the interface type being constructed.
13
- */
14
- type: R3Reference;
15
- /**
16
- * An expression representing the constructor type, intended for use within a class definition
17
- * itself.
18
- *
19
- * This can differ from the outer `type` if the class is being compiled by ngcc and is inside
20
- * an IIFE structure that uses a different name internally.
21
- */
22
- internalType: o.Expression;
23
- /** Number of arguments for the `type`. */
24
- typeArgumentCount: number;
25
- /**
26
- * Regardless of whether `fnOrClass` is a constructor function or a user-defined factory, it
27
- * may have 0 or more parameters, which will be injected according to the `R3DependencyMetadata`
28
- * for those parameters. If this is `null`, then the type's constructor is nonexistent and will
29
- * be inherited from `fnOrClass` which is interpreted as the current type. If this is `'invalid'`,
30
- * then one or more of the parameters wasn't resolvable and any attempt to use these deps will
31
- * result in a runtime error.
32
- */
33
- deps: R3DependencyMetadata[] | 'invalid' | null;
34
- /**
35
- * Type of the target being created by the factory.
36
- */
37
- target: FactoryTarget;
38
- }
39
- export declare enum R3FactoryDelegateType {
40
- Class = 0,
41
- Function = 1
42
- }
43
- export interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {
44
- delegate: o.Expression;
45
- delegateType: R3FactoryDelegateType;
46
- delegateDeps: R3DependencyMetadata[];
47
- }
48
- export interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata {
49
- expression: o.Expression;
50
- }
51
- export declare type R3FactoryMetadata = R3ConstructorFactoryMetadata | R3DelegatedFnOrClassMetadata | R3ExpressionFactoryMetadata;
52
- export declare enum FactoryTarget {
53
- Directive = 0,
54
- Component = 1,
55
- Injectable = 2,
56
- Pipe = 3,
57
- NgModule = 4
58
- }
59
- export interface R3DependencyMetadata {
60
- /**
61
- * An expression representing the token or value to be injected.
62
- * Or `null` if the dependency could not be resolved - making it invalid.
63
- */
64
- token: o.Expression | null;
65
- /**
66
- * If an @Attribute decorator is present, this is the literal type of the attribute name, or
67
- * the unknown type if no literal type is available (e.g. the attribute name is an expression).
68
- * Otherwise it is null;
69
- */
70
- attributeNameType: o.Expression | null;
71
- /**
72
- * Whether the dependency has an @Host qualifier.
73
- */
74
- host: boolean;
75
- /**
76
- * Whether the dependency has an @Optional qualifier.
77
- */
78
- optional: boolean;
79
- /**
80
- * Whether the dependency has an @Self qualifier.
81
- */
82
- self: boolean;
83
- /**
84
- * Whether the dependency has an @SkipSelf qualifier.
85
- */
86
- skipSelf: boolean;
87
- }
88
- /**
89
- * Construct a factory function expression for the given `R3FactoryMetadata`.
90
- */
91
- export declare function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression;
92
- export declare function createFactoryType(meta: R3FactoryMetadata): o.ExpressionType;
93
- export declare function isDelegatedFactoryMetadata(meta: R3FactoryMetadata): meta is R3DelegatedFnOrClassMetadata;
94
- export declare function isExpressionFactoryMetadata(meta: R3FactoryMetadata): meta is R3ExpressionFactoryMetadata;
@@ -1,182 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as o from '../output/output_ast';
9
- export declare class Identifiers {
10
- static NEW_METHOD: string;
11
- static TRANSFORM_METHOD: string;
12
- static PATCH_DEPS: string;
13
- static core: o.ExternalReference;
14
- static namespaceHTML: o.ExternalReference;
15
- static namespaceMathML: o.ExternalReference;
16
- static namespaceSVG: o.ExternalReference;
17
- static element: o.ExternalReference;
18
- static elementStart: o.ExternalReference;
19
- static elementEnd: o.ExternalReference;
20
- static advance: o.ExternalReference;
21
- static syntheticHostProperty: o.ExternalReference;
22
- static syntheticHostListener: o.ExternalReference;
23
- static attribute: o.ExternalReference;
24
- static attributeInterpolate1: o.ExternalReference;
25
- static attributeInterpolate2: o.ExternalReference;
26
- static attributeInterpolate3: o.ExternalReference;
27
- static attributeInterpolate4: o.ExternalReference;
28
- static attributeInterpolate5: o.ExternalReference;
29
- static attributeInterpolate6: o.ExternalReference;
30
- static attributeInterpolate7: o.ExternalReference;
31
- static attributeInterpolate8: o.ExternalReference;
32
- static attributeInterpolateV: o.ExternalReference;
33
- static classProp: o.ExternalReference;
34
- static elementContainerStart: o.ExternalReference;
35
- static elementContainerEnd: o.ExternalReference;
36
- static elementContainer: o.ExternalReference;
37
- static styleMap: o.ExternalReference;
38
- static styleMapInterpolate1: o.ExternalReference;
39
- static styleMapInterpolate2: o.ExternalReference;
40
- static styleMapInterpolate3: o.ExternalReference;
41
- static styleMapInterpolate4: o.ExternalReference;
42
- static styleMapInterpolate5: o.ExternalReference;
43
- static styleMapInterpolate6: o.ExternalReference;
44
- static styleMapInterpolate7: o.ExternalReference;
45
- static styleMapInterpolate8: o.ExternalReference;
46
- static styleMapInterpolateV: o.ExternalReference;
47
- static classMap: o.ExternalReference;
48
- static classMapInterpolate1: o.ExternalReference;
49
- static classMapInterpolate2: o.ExternalReference;
50
- static classMapInterpolate3: o.ExternalReference;
51
- static classMapInterpolate4: o.ExternalReference;
52
- static classMapInterpolate5: o.ExternalReference;
53
- static classMapInterpolate6: o.ExternalReference;
54
- static classMapInterpolate7: o.ExternalReference;
55
- static classMapInterpolate8: o.ExternalReference;
56
- static classMapInterpolateV: o.ExternalReference;
57
- static styleProp: o.ExternalReference;
58
- static stylePropInterpolate1: o.ExternalReference;
59
- static stylePropInterpolate2: o.ExternalReference;
60
- static stylePropInterpolate3: o.ExternalReference;
61
- static stylePropInterpolate4: o.ExternalReference;
62
- static stylePropInterpolate5: o.ExternalReference;
63
- static stylePropInterpolate6: o.ExternalReference;
64
- static stylePropInterpolate7: o.ExternalReference;
65
- static stylePropInterpolate8: o.ExternalReference;
66
- static stylePropInterpolateV: o.ExternalReference;
67
- static nextContext: o.ExternalReference;
68
- static resetView: o.ExternalReference;
69
- static templateCreate: o.ExternalReference;
70
- static text: o.ExternalReference;
71
- static enableBindings: o.ExternalReference;
72
- static disableBindings: o.ExternalReference;
73
- static getCurrentView: o.ExternalReference;
74
- static textInterpolate: o.ExternalReference;
75
- static textInterpolate1: o.ExternalReference;
76
- static textInterpolate2: o.ExternalReference;
77
- static textInterpolate3: o.ExternalReference;
78
- static textInterpolate4: o.ExternalReference;
79
- static textInterpolate5: o.ExternalReference;
80
- static textInterpolate6: o.ExternalReference;
81
- static textInterpolate7: o.ExternalReference;
82
- static textInterpolate8: o.ExternalReference;
83
- static textInterpolateV: o.ExternalReference;
84
- static restoreView: o.ExternalReference;
85
- static pureFunction0: o.ExternalReference;
86
- static pureFunction1: o.ExternalReference;
87
- static pureFunction2: o.ExternalReference;
88
- static pureFunction3: o.ExternalReference;
89
- static pureFunction4: o.ExternalReference;
90
- static pureFunction5: o.ExternalReference;
91
- static pureFunction6: o.ExternalReference;
92
- static pureFunction7: o.ExternalReference;
93
- static pureFunction8: o.ExternalReference;
94
- static pureFunctionV: o.ExternalReference;
95
- static pipeBind1: o.ExternalReference;
96
- static pipeBind2: o.ExternalReference;
97
- static pipeBind3: o.ExternalReference;
98
- static pipeBind4: o.ExternalReference;
99
- static pipeBindV: o.ExternalReference;
100
- static hostProperty: o.ExternalReference;
101
- static property: o.ExternalReference;
102
- static propertyInterpolate: o.ExternalReference;
103
- static propertyInterpolate1: o.ExternalReference;
104
- static propertyInterpolate2: o.ExternalReference;
105
- static propertyInterpolate3: o.ExternalReference;
106
- static propertyInterpolate4: o.ExternalReference;
107
- static propertyInterpolate5: o.ExternalReference;
108
- static propertyInterpolate6: o.ExternalReference;
109
- static propertyInterpolate7: o.ExternalReference;
110
- static propertyInterpolate8: o.ExternalReference;
111
- static propertyInterpolateV: o.ExternalReference;
112
- static i18n: o.ExternalReference;
113
- static i18nAttributes: o.ExternalReference;
114
- static i18nExp: o.ExternalReference;
115
- static i18nStart: o.ExternalReference;
116
- static i18nEnd: o.ExternalReference;
117
- static i18nApply: o.ExternalReference;
118
- static i18nPostprocess: o.ExternalReference;
119
- static pipe: o.ExternalReference;
120
- static projection: o.ExternalReference;
121
- static projectionDef: o.ExternalReference;
122
- static reference: o.ExternalReference;
123
- static inject: o.ExternalReference;
124
- static injectAttribute: o.ExternalReference;
125
- static directiveInject: o.ExternalReference;
126
- static invalidFactory: o.ExternalReference;
127
- static invalidFactoryDep: o.ExternalReference;
128
- static templateRefExtractor: o.ExternalReference;
129
- static forwardRef: o.ExternalReference;
130
- static resolveForwardRef: o.ExternalReference;
131
- static ɵɵdefineInjectable: o.ExternalReference;
132
- static declareInjectable: o.ExternalReference;
133
- static InjectableDeclaration: o.ExternalReference;
134
- static resolveWindow: o.ExternalReference;
135
- static resolveDocument: o.ExternalReference;
136
- static resolveBody: o.ExternalReference;
137
- static defineComponent: o.ExternalReference;
138
- static declareComponent: o.ExternalReference;
139
- static setComponentScope: o.ExternalReference;
140
- static ChangeDetectionStrategy: o.ExternalReference;
141
- static ViewEncapsulation: o.ExternalReference;
142
- static ComponentDeclaration: o.ExternalReference;
143
- static FactoryDeclaration: o.ExternalReference;
144
- static declareFactory: o.ExternalReference;
145
- static FactoryTarget: o.ExternalReference;
146
- static defineDirective: o.ExternalReference;
147
- static declareDirective: o.ExternalReference;
148
- static DirectiveDeclaration: o.ExternalReference;
149
- static InjectorDef: o.ExternalReference;
150
- static InjectorDeclaration: o.ExternalReference;
151
- static defineInjector: o.ExternalReference;
152
- static declareInjector: o.ExternalReference;
153
- static NgModuleDeclaration: o.ExternalReference;
154
- static ModuleWithProviders: o.ExternalReference;
155
- static defineNgModule: o.ExternalReference;
156
- static declareNgModule: o.ExternalReference;
157
- static setNgModuleScope: o.ExternalReference;
158
- static registerNgModuleType: o.ExternalReference;
159
- static PipeDeclaration: o.ExternalReference;
160
- static definePipe: o.ExternalReference;
161
- static declarePipe: o.ExternalReference;
162
- static declareClassMetadata: o.ExternalReference;
163
- static setClassMetadata: o.ExternalReference;
164
- static queryRefresh: o.ExternalReference;
165
- static viewQuery: o.ExternalReference;
166
- static loadQuery: o.ExternalReference;
167
- static contentQuery: o.ExternalReference;
168
- static NgOnChangesFeature: o.ExternalReference;
169
- static InheritDefinitionFeature: o.ExternalReference;
170
- static CopyDefinitionFeature: o.ExternalReference;
171
- static ProvidersFeature: o.ExternalReference;
172
- static listener: o.ExternalReference;
173
- static getInheritedFactory: o.ExternalReference;
174
- static sanitizeHtml: o.ExternalReference;
175
- static sanitizeStyle: o.ExternalReference;
176
- static sanitizeResourceUrl: o.ExternalReference;
177
- static sanitizeScript: o.ExternalReference;
178
- static sanitizeUrl: o.ExternalReference;
179
- static sanitizeUrlOrResourceUrl: o.ExternalReference;
180
- static trustConstantHtml: o.ExternalReference;
181
- static trustConstantResourceUrl: o.ExternalReference;
182
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as o from '../output/output_ast';
9
- import { R3CompiledExpression, R3Reference } from './util';
10
- export interface R3InjectorMetadata {
11
- name: string;
12
- type: R3Reference;
13
- internalType: o.Expression;
14
- providers: o.Expression | null;
15
- imports: o.Expression[];
16
- }
17
- export declare function compileInjector(meta: R3InjectorMetadata): R3CompiledExpression;
18
- export declare function createInjectorType(meta: R3InjectorMetadata): o.Type;
@@ -1,22 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as o from '../output/output_ast';
9
- import { ExternalReferenceResolver } from '../output/output_jit';
10
- /**
11
- * Implementation of `CompileReflector` which resolves references to @angular/core
12
- * symbols at runtime, according to a consumer-provided mapping.
13
- *
14
- * Only supports `resolveExternalReference`, all other methods throw.
15
- */
16
- export declare class R3JitReflector implements ExternalReferenceResolver {
17
- private context;
18
- constructor(context: {
19
- [key: string]: unknown;
20
- });
21
- resolveExternalReference(ref: o.ExternalReference): unknown;
22
- }