@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.
- package/esm2020/src/compiler.mjs +3 -2
- package/esm2020/src/compiler_facade_interface.mjs +7 -1
- package/esm2020/src/core.mjs +6 -6
- package/esm2020/src/expression_parser/parser.mjs +12 -12
- package/esm2020/src/i18n/i18n_parser.mjs +3 -3
- package/esm2020/src/jit_compiler_facade.mjs +74 -42
- package/esm2020/src/ml_parser/html_whitespaces.mjs +2 -2
- package/esm2020/src/ml_parser/lexer.mjs +36 -36
- package/esm2020/src/ml_parser/parser.mjs +41 -41
- package/esm2020/src/render3/partial/api.mjs +1 -1
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/component.mjs +28 -37
- package/esm2020/src/render3/partial/directive.mjs +6 -3
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +3 -3
- package/esm2020/src/render3/partial/pipe.mjs +6 -3
- package/esm2020/src/render3/r3_ast.mjs +3 -3
- package/esm2020/src/render3/r3_factory.mjs +6 -6
- package/esm2020/src/render3/r3_identifiers.mjs +2 -1
- package/esm2020/src/render3/r3_pipe_compiler.mjs +5 -1
- package/esm2020/src/render3/util.mjs +4 -4
- package/esm2020/src/render3/view/api.mjs +7 -2
- package/esm2020/src/render3/view/compiler.mjs +45 -35
- package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +58 -5
- package/esm2020/src/render3/view/i18n/meta.mjs +4 -4
- package/esm2020/src/render3/view/i18n/util.mjs +2 -2
- package/esm2020/src/render3/view/style_parser.mjs +19 -19
- package/esm2020/src/render3/view/styling_builder.mjs +6 -6
- package/esm2020/src/render3/view/template.mjs +25 -25
- package/esm2020/src/render3/view/util.mjs +14 -5
- package/esm2020/src/selector.mjs +8 -8
- package/esm2020/src/template_parser/binding_parser.mjs +8 -8
- package/esm2020/src/util.mjs +8 -8
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +416 -301
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +424 -314
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +4964 -5
- package/package.json +3 -3
- package/testing/index.d.ts +22 -5
- package/compiler.d.ts +0 -8
- package/public_api.d.ts +0 -13
- package/src/assertions.d.ts +0 -8
- package/src/chars.d.ts +0 -75
- package/src/compiler.d.ts +0 -77
- package/src/compiler_facade_interface.d.ts +0 -284
- package/src/compiler_util/expression_converter.d.ts +0 -71
- package/src/config.d.ts +0 -25
- package/src/constant_pool.d.ts +0 -37
- package/src/core.d.ts +0 -216
- package/src/expression_parser/ast.d.ts +0 -440
- package/src/expression_parser/lexer.d.ts +0 -47
- package/src/expression_parser/parser.d.ts +0 -315
- package/src/i18n/big_integer.d.ts +0 -108
- package/src/i18n/digest.d.ts +0 -44
- package/src/i18n/extractor_merger.d.ts +0 -27
- package/src/i18n/i18n_ast.d.ts +0 -148
- package/src/i18n/i18n_html_parser.d.ts +0 -19
- package/src/i18n/i18n_parser.d.ts +0 -18
- package/src/i18n/index.d.ts +0 -15
- package/src/i18n/message_bundle.d.ts +0 -28
- package/src/i18n/parse_util.d.ts +0 -14
- package/src/i18n/serializers/placeholder.d.ts +0 -25
- package/src/i18n/serializers/serializer.d.ts +0 -46
- package/src/i18n/serializers/xliff.d.ts +0 -19
- package/src/i18n/serializers/xliff2.d.ts +0 -19
- package/src/i18n/serializers/xmb.d.ts +0 -22
- package/src/i18n/serializers/xml_helper.d.ts +0 -52
- package/src/i18n/serializers/xtb.d.ts +0 -20
- package/src/i18n/translation_bundle.d.ts +0 -27
- package/src/injectable_compiler_2.d.ts +0 -24
- package/src/jit_compiler_facade.d.ts +0 -46
- package/src/ml_parser/ast.d.ts +0 -89
- package/src/ml_parser/entities.d.ts +0 -9
- package/src/ml_parser/html_parser.d.ts +0 -13
- package/src/ml_parser/html_tags.d.ts +0 -33
- package/src/ml_parser/html_whitespaces.d.ts +0 -45
- package/src/ml_parser/icu_ast_expander.d.ts +0 -42
- package/src/ml_parser/interpolation_config.d.ts +0 -14
- package/src/ml_parser/lexer.d.ts +0 -114
- package/src/ml_parser/parser.d.ts +0 -26
- package/src/ml_parser/tags.d.ts +0 -29
- package/src/ml_parser/tokens.d.ts +0 -141
- package/src/ml_parser/xml_parser.d.ts +0 -13
- package/src/ml_parser/xml_tags.d.ts +0 -24
- package/src/output/abstract_emitter.d.ts +0 -66
- package/src/output/abstract_js_emitter.d.ts +0 -19
- package/src/output/map_util.d.ts +0 -18
- package/src/output/output_ast.d.ts +0 -575
- package/src/output/output_jit.d.ts +0 -73
- package/src/output/output_jit_trusted_types.d.ts +0 -43
- package/src/output/source_map.d.ts +0 -29
- package/src/parse_util.d.ts +0 -75
- package/src/render3/partial/api.d.ts +0 -441
- package/src/render3/partial/class_metadata.d.ts +0 -10
- package/src/render3/partial/component.d.ts +0 -39
- package/src/render3/partial/directive.d.ts +0 -13
- package/src/render3/partial/factory.d.ts +0 -3
- package/src/render3/partial/injectable.d.ts +0 -19
- package/src/render3/partial/injector.d.ts +0 -3
- package/src/render3/partial/ng_module.d.ts +0 -3
- package/src/render3/partial/pipe.d.ts +0 -12
- package/src/render3/partial/util.d.ts +0 -33
- package/src/render3/r3_ast.d.ts +0 -211
- package/src/render3/r3_class_metadata_compiler.d.ts +0 -35
- package/src/render3/r3_factory.d.ts +0 -94
- package/src/render3/r3_identifiers.d.ts +0 -182
- package/src/render3/r3_injector_compiler.d.ts +0 -18
- package/src/render3/r3_jit.d.ts +0 -22
- package/src/render3/r3_module_compiler.d.ts +0 -103
- package/src/render3/r3_pipe_compiler.d.ts +0 -50
- package/src/render3/r3_template_transform.d.ts +0 -24
- package/src/render3/util.d.ts +0 -94
- package/src/render3/view/api.d.ts +0 -328
- package/src/render3/view/compiler.d.ts +0 -86
- package/src/render3/view/i18n/context.d.ts +0 -68
- package/src/render3/view/i18n/get_msg_utils.d.ts +0 -13
- package/src/render3/view/i18n/icu_serializer.d.ts +0 -9
- package/src/render3/view/i18n/localize_utils.d.ts +0 -24
- package/src/render3/view/i18n/meta.d.ts +0 -78
- package/src/render3/view/i18n/util.d.ts +0 -78
- package/src/render3/view/style_parser.d.ts +0 -18
- package/src/render3/view/styling_builder.d.ts +0 -211
- package/src/render3/view/t2_api.d.ts +0 -152
- package/src/render3/view/t2_binder.d.ts +0 -57
- package/src/render3/view/template.d.ts +0 -450
- package/src/render3/view/util.d.ts +0 -94
- package/src/resource_loader.d.ts +0 -17
- package/src/schema/dom_element_schema_registry.d.ts +0 -45
- package/src/schema/dom_security_schema.d.ts +0 -11
- package/src/schema/element_schema_registry.d.ts +0 -29
- package/src/schema/trusted_types_sinks.d.ts +0 -15
- package/src/selector.d.ts +0 -105
- package/src/shadow_css.d.ts +0 -76
- package/src/style_url_resolver.d.ts +0 -8
- package/src/template_parser/binding_parser.d.ts +0 -91
- package/src/template_parser/template_preparser.d.ts +0 -24
- package/src/util.d.ts +0 -42
- package/src/version.d.ts +0 -14
- package/testing/package.json +0 -9
- package/testing/public_api.d.ts +0 -13
- package/testing/src/testing.d.ts +0 -23
- package/testing/testing.d.ts +0 -4
|
@@ -1,575 +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 { Message } from '../i18n/i18n_ast';
|
|
9
|
-
import { ParseSourceSpan } from '../parse_util';
|
|
10
|
-
import { I18nMeta } from '../render3/view/i18n/meta';
|
|
11
|
-
export declare enum TypeModifier {
|
|
12
|
-
None = 0,
|
|
13
|
-
Const = 1
|
|
14
|
-
}
|
|
15
|
-
export declare abstract class Type {
|
|
16
|
-
modifiers: TypeModifier;
|
|
17
|
-
constructor(modifiers?: TypeModifier);
|
|
18
|
-
abstract visitType(visitor: TypeVisitor, context: any): any;
|
|
19
|
-
hasModifier(modifier: TypeModifier): boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare enum BuiltinTypeName {
|
|
22
|
-
Dynamic = 0,
|
|
23
|
-
Bool = 1,
|
|
24
|
-
String = 2,
|
|
25
|
-
Int = 3,
|
|
26
|
-
Number = 4,
|
|
27
|
-
Function = 5,
|
|
28
|
-
Inferred = 6,
|
|
29
|
-
None = 7
|
|
30
|
-
}
|
|
31
|
-
export declare class BuiltinType extends Type {
|
|
32
|
-
name: BuiltinTypeName;
|
|
33
|
-
constructor(name: BuiltinTypeName, modifiers?: TypeModifier);
|
|
34
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
35
|
-
}
|
|
36
|
-
export declare class ExpressionType extends Type {
|
|
37
|
-
value: Expression;
|
|
38
|
-
typeParams: Type[] | null;
|
|
39
|
-
constructor(value: Expression, modifiers?: TypeModifier, typeParams?: Type[] | null);
|
|
40
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
41
|
-
}
|
|
42
|
-
export declare class ArrayType extends Type {
|
|
43
|
-
of: Type;
|
|
44
|
-
constructor(of: Type, modifiers?: TypeModifier);
|
|
45
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
46
|
-
}
|
|
47
|
-
export declare class MapType extends Type {
|
|
48
|
-
valueType: Type | null;
|
|
49
|
-
constructor(valueType: Type | null | undefined, modifiers?: TypeModifier);
|
|
50
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
51
|
-
}
|
|
52
|
-
export declare const DYNAMIC_TYPE: BuiltinType;
|
|
53
|
-
export declare const INFERRED_TYPE: BuiltinType;
|
|
54
|
-
export declare const BOOL_TYPE: BuiltinType;
|
|
55
|
-
export declare const INT_TYPE: BuiltinType;
|
|
56
|
-
export declare const NUMBER_TYPE: BuiltinType;
|
|
57
|
-
export declare const STRING_TYPE: BuiltinType;
|
|
58
|
-
export declare const FUNCTION_TYPE: BuiltinType;
|
|
59
|
-
export declare const NONE_TYPE: BuiltinType;
|
|
60
|
-
export interface TypeVisitor {
|
|
61
|
-
visitBuiltinType(type: BuiltinType, context: any): any;
|
|
62
|
-
visitExpressionType(type: ExpressionType, context: any): any;
|
|
63
|
-
visitArrayType(type: ArrayType, context: any): any;
|
|
64
|
-
visitMapType(type: MapType, context: any): any;
|
|
65
|
-
}
|
|
66
|
-
export declare enum UnaryOperator {
|
|
67
|
-
Minus = 0,
|
|
68
|
-
Plus = 1
|
|
69
|
-
}
|
|
70
|
-
export declare enum BinaryOperator {
|
|
71
|
-
Equals = 0,
|
|
72
|
-
NotEquals = 1,
|
|
73
|
-
Identical = 2,
|
|
74
|
-
NotIdentical = 3,
|
|
75
|
-
Minus = 4,
|
|
76
|
-
Plus = 5,
|
|
77
|
-
Divide = 6,
|
|
78
|
-
Multiply = 7,
|
|
79
|
-
Modulo = 8,
|
|
80
|
-
And = 9,
|
|
81
|
-
Or = 10,
|
|
82
|
-
BitwiseAnd = 11,
|
|
83
|
-
Lower = 12,
|
|
84
|
-
LowerEquals = 13,
|
|
85
|
-
Bigger = 14,
|
|
86
|
-
BiggerEquals = 15,
|
|
87
|
-
NullishCoalesce = 16
|
|
88
|
-
}
|
|
89
|
-
export declare function nullSafeIsEquivalent<T extends {
|
|
90
|
-
isEquivalent(other: T): boolean;
|
|
91
|
-
}>(base: T | null, other: T | null): boolean;
|
|
92
|
-
export declare function areAllEquivalent<T extends {
|
|
93
|
-
isEquivalent(other: T): boolean;
|
|
94
|
-
}>(base: T[], other: T[]): boolean;
|
|
95
|
-
export declare abstract class Expression {
|
|
96
|
-
type: Type | null;
|
|
97
|
-
sourceSpan: ParseSourceSpan | null;
|
|
98
|
-
constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null);
|
|
99
|
-
abstract visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
100
|
-
/**
|
|
101
|
-
* Calculates whether this expression produces the same value as the given expression.
|
|
102
|
-
* Note: We don't check Types nor ParseSourceSpans nor function arguments.
|
|
103
|
-
*/
|
|
104
|
-
abstract isEquivalent(e: Expression): boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Return true if the expression is constant.
|
|
107
|
-
*/
|
|
108
|
-
abstract isConstant(): boolean;
|
|
109
|
-
prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr;
|
|
110
|
-
key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr;
|
|
111
|
-
callFn(params: Expression[], sourceSpan?: ParseSourceSpan | null, pure?: boolean): InvokeFunctionExpr;
|
|
112
|
-
instantiate(params: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): InstantiateExpr;
|
|
113
|
-
conditional(trueCase: Expression, falseCase?: Expression | null, sourceSpan?: ParseSourceSpan | null): ConditionalExpr;
|
|
114
|
-
equals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
115
|
-
notEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
116
|
-
identical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
117
|
-
notIdentical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
118
|
-
minus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
119
|
-
plus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
120
|
-
divide(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
121
|
-
multiply(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
122
|
-
modulo(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
123
|
-
and(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
124
|
-
bitwiseAnd(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr;
|
|
125
|
-
or(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
126
|
-
lower(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
127
|
-
lowerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
128
|
-
bigger(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
129
|
-
biggerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
130
|
-
isBlank(sourceSpan?: ParseSourceSpan | null): Expression;
|
|
131
|
-
nullishCoalesce(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
|
132
|
-
toStmt(): Statement;
|
|
133
|
-
}
|
|
134
|
-
export declare class ReadVarExpr extends Expression {
|
|
135
|
-
name: string;
|
|
136
|
-
constructor(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
137
|
-
isEquivalent(e: Expression): boolean;
|
|
138
|
-
isConstant(): boolean;
|
|
139
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
140
|
-
set(value: Expression): WriteVarExpr;
|
|
141
|
-
}
|
|
142
|
-
export declare class TypeofExpr extends Expression {
|
|
143
|
-
expr: Expression;
|
|
144
|
-
constructor(expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
145
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
146
|
-
isEquivalent(e: Expression): boolean;
|
|
147
|
-
isConstant(): boolean;
|
|
148
|
-
}
|
|
149
|
-
export declare class WrappedNodeExpr<T> extends Expression {
|
|
150
|
-
node: T;
|
|
151
|
-
constructor(node: T, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
152
|
-
isEquivalent(e: Expression): boolean;
|
|
153
|
-
isConstant(): boolean;
|
|
154
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
155
|
-
}
|
|
156
|
-
export declare class WriteVarExpr extends Expression {
|
|
157
|
-
name: string;
|
|
158
|
-
value: Expression;
|
|
159
|
-
constructor(name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
160
|
-
isEquivalent(e: Expression): boolean;
|
|
161
|
-
isConstant(): boolean;
|
|
162
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
163
|
-
toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt;
|
|
164
|
-
toConstDecl(): DeclareVarStmt;
|
|
165
|
-
}
|
|
166
|
-
export declare class WriteKeyExpr extends Expression {
|
|
167
|
-
receiver: Expression;
|
|
168
|
-
index: Expression;
|
|
169
|
-
value: Expression;
|
|
170
|
-
constructor(receiver: Expression, index: Expression, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
171
|
-
isEquivalent(e: Expression): boolean;
|
|
172
|
-
isConstant(): boolean;
|
|
173
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
174
|
-
}
|
|
175
|
-
export declare class WritePropExpr extends Expression {
|
|
176
|
-
receiver: Expression;
|
|
177
|
-
name: string;
|
|
178
|
-
value: Expression;
|
|
179
|
-
constructor(receiver: Expression, name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
180
|
-
isEquivalent(e: Expression): boolean;
|
|
181
|
-
isConstant(): boolean;
|
|
182
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
183
|
-
}
|
|
184
|
-
export declare class InvokeFunctionExpr extends Expression {
|
|
185
|
-
fn: Expression;
|
|
186
|
-
args: Expression[];
|
|
187
|
-
pure: boolean;
|
|
188
|
-
constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, pure?: boolean);
|
|
189
|
-
isEquivalent(e: Expression): boolean;
|
|
190
|
-
isConstant(): boolean;
|
|
191
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
192
|
-
}
|
|
193
|
-
export declare class TaggedTemplateExpr extends Expression {
|
|
194
|
-
tag: Expression;
|
|
195
|
-
template: TemplateLiteral;
|
|
196
|
-
constructor(tag: Expression, template: TemplateLiteral, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
197
|
-
isEquivalent(e: Expression): boolean;
|
|
198
|
-
isConstant(): boolean;
|
|
199
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
200
|
-
}
|
|
201
|
-
export declare class InstantiateExpr extends Expression {
|
|
202
|
-
classExpr: Expression;
|
|
203
|
-
args: Expression[];
|
|
204
|
-
constructor(classExpr: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
205
|
-
isEquivalent(e: Expression): boolean;
|
|
206
|
-
isConstant(): boolean;
|
|
207
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
208
|
-
}
|
|
209
|
-
export declare class LiteralExpr extends Expression {
|
|
210
|
-
value: number | string | boolean | null | undefined;
|
|
211
|
-
constructor(value: number | string | boolean | null | undefined, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
212
|
-
isEquivalent(e: Expression): boolean;
|
|
213
|
-
isConstant(): boolean;
|
|
214
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
215
|
-
}
|
|
216
|
-
export declare class TemplateLiteral {
|
|
217
|
-
elements: TemplateLiteralElement[];
|
|
218
|
-
expressions: Expression[];
|
|
219
|
-
constructor(elements: TemplateLiteralElement[], expressions: Expression[]);
|
|
220
|
-
}
|
|
221
|
-
export declare class TemplateLiteralElement {
|
|
222
|
-
text: string;
|
|
223
|
-
sourceSpan?: ParseSourceSpan | undefined;
|
|
224
|
-
rawText: string;
|
|
225
|
-
constructor(text: string, sourceSpan?: ParseSourceSpan | undefined, rawText?: string);
|
|
226
|
-
}
|
|
227
|
-
export declare class LiteralPiece {
|
|
228
|
-
text: string;
|
|
229
|
-
sourceSpan: ParseSourceSpan;
|
|
230
|
-
constructor(text: string, sourceSpan: ParseSourceSpan);
|
|
231
|
-
}
|
|
232
|
-
export declare class PlaceholderPiece {
|
|
233
|
-
text: string;
|
|
234
|
-
sourceSpan: ParseSourceSpan;
|
|
235
|
-
associatedMessage?: Message | undefined;
|
|
236
|
-
/**
|
|
237
|
-
* Create a new instance of a `PlaceholderPiece`.
|
|
238
|
-
*
|
|
239
|
-
* @param text the name of this placeholder (e.g. `PH_1`).
|
|
240
|
-
* @param sourceSpan the location of this placeholder in its localized message the source code.
|
|
241
|
-
* @param associatedMessage reference to another message that this placeholder is associated with.
|
|
242
|
-
* The `associatedMessage` is mainly used to provide a relationship to an ICU message that has
|
|
243
|
-
* been extracted out from the message containing the placeholder.
|
|
244
|
-
*/
|
|
245
|
-
constructor(text: string, sourceSpan: ParseSourceSpan, associatedMessage?: Message | undefined);
|
|
246
|
-
}
|
|
247
|
-
export declare type MessagePiece = LiteralPiece | PlaceholderPiece;
|
|
248
|
-
export declare class LocalizedString extends Expression {
|
|
249
|
-
readonly metaBlock: I18nMeta;
|
|
250
|
-
readonly messageParts: LiteralPiece[];
|
|
251
|
-
readonly placeHolderNames: PlaceholderPiece[];
|
|
252
|
-
readonly expressions: Expression[];
|
|
253
|
-
constructor(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeHolderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null);
|
|
254
|
-
isEquivalent(e: Expression): boolean;
|
|
255
|
-
isConstant(): boolean;
|
|
256
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
257
|
-
/**
|
|
258
|
-
* Serialize the given `meta` and `messagePart` into "cooked" and "raw" strings that can be used
|
|
259
|
-
* in a `$localize` tagged string. The format of the metadata is the same as that parsed by
|
|
260
|
-
* `parseI18nMeta()`.
|
|
261
|
-
*
|
|
262
|
-
* @param meta The metadata to serialize
|
|
263
|
-
* @param messagePart The first part of the tagged string
|
|
264
|
-
*/
|
|
265
|
-
serializeI18nHead(): CookedRawString;
|
|
266
|
-
getMessagePartSourceSpan(i: number): ParseSourceSpan | null;
|
|
267
|
-
getPlaceholderSourceSpan(i: number): ParseSourceSpan;
|
|
268
|
-
/**
|
|
269
|
-
* Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that
|
|
270
|
-
* can be used in a `$localize` tagged string.
|
|
271
|
-
*
|
|
272
|
-
* The format is `:<placeholder-name>[@@<associated-id>]:`.
|
|
273
|
-
*
|
|
274
|
-
* The `associated-id` is the message id of the (usually an ICU) message to which this placeholder
|
|
275
|
-
* refers.
|
|
276
|
-
*
|
|
277
|
-
* @param partIndex The index of the message part to serialize.
|
|
278
|
-
*/
|
|
279
|
-
serializeI18nTemplatePart(partIndex: number): CookedRawString;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* A structure to hold the cooked and raw strings of a template literal element, along with its
|
|
283
|
-
* source-span range.
|
|
284
|
-
*/
|
|
285
|
-
export interface CookedRawString {
|
|
286
|
-
cooked: string;
|
|
287
|
-
raw: string;
|
|
288
|
-
range: ParseSourceSpan | null;
|
|
289
|
-
}
|
|
290
|
-
export declare class ExternalExpr extends Expression {
|
|
291
|
-
value: ExternalReference;
|
|
292
|
-
typeParams: Type[] | null;
|
|
293
|
-
constructor(value: ExternalReference, type?: Type | null, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null);
|
|
294
|
-
isEquivalent(e: Expression): boolean;
|
|
295
|
-
isConstant(): boolean;
|
|
296
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
297
|
-
}
|
|
298
|
-
export declare class ExternalReference {
|
|
299
|
-
moduleName: string | null;
|
|
300
|
-
name: string | null;
|
|
301
|
-
runtime?: any;
|
|
302
|
-
constructor(moduleName: string | null, name: string | null, runtime?: any);
|
|
303
|
-
}
|
|
304
|
-
export declare class ConditionalExpr extends Expression {
|
|
305
|
-
condition: Expression;
|
|
306
|
-
falseCase: Expression | null;
|
|
307
|
-
trueCase: Expression;
|
|
308
|
-
constructor(condition: Expression, trueCase: Expression, falseCase?: Expression | null, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
309
|
-
isEquivalent(e: Expression): boolean;
|
|
310
|
-
isConstant(): boolean;
|
|
311
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
312
|
-
}
|
|
313
|
-
export declare class NotExpr extends Expression {
|
|
314
|
-
condition: Expression;
|
|
315
|
-
constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null);
|
|
316
|
-
isEquivalent(e: Expression): boolean;
|
|
317
|
-
isConstant(): boolean;
|
|
318
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
319
|
-
}
|
|
320
|
-
export declare class FnParam {
|
|
321
|
-
name: string;
|
|
322
|
-
type: Type | null;
|
|
323
|
-
constructor(name: string, type?: Type | null);
|
|
324
|
-
isEquivalent(param: FnParam): boolean;
|
|
325
|
-
}
|
|
326
|
-
export declare class FunctionExpr extends Expression {
|
|
327
|
-
params: FnParam[];
|
|
328
|
-
statements: Statement[];
|
|
329
|
-
name?: string | null | undefined;
|
|
330
|
-
constructor(params: FnParam[], statements: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null | undefined);
|
|
331
|
-
isEquivalent(e: Expression): boolean;
|
|
332
|
-
isConstant(): boolean;
|
|
333
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
334
|
-
toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt;
|
|
335
|
-
}
|
|
336
|
-
export declare class UnaryOperatorExpr extends Expression {
|
|
337
|
-
operator: UnaryOperator;
|
|
338
|
-
expr: Expression;
|
|
339
|
-
parens: boolean;
|
|
340
|
-
constructor(operator: UnaryOperator, expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
|
|
341
|
-
isEquivalent(e: Expression): boolean;
|
|
342
|
-
isConstant(): boolean;
|
|
343
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
344
|
-
}
|
|
345
|
-
export declare class BinaryOperatorExpr extends Expression {
|
|
346
|
-
operator: BinaryOperator;
|
|
347
|
-
rhs: Expression;
|
|
348
|
-
parens: boolean;
|
|
349
|
-
lhs: Expression;
|
|
350
|
-
constructor(operator: BinaryOperator, lhs: Expression, rhs: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
|
|
351
|
-
isEquivalent(e: Expression): boolean;
|
|
352
|
-
isConstant(): boolean;
|
|
353
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
354
|
-
}
|
|
355
|
-
export declare class ReadPropExpr extends Expression {
|
|
356
|
-
receiver: Expression;
|
|
357
|
-
name: string;
|
|
358
|
-
constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
359
|
-
isEquivalent(e: Expression): boolean;
|
|
360
|
-
isConstant(): boolean;
|
|
361
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
362
|
-
set(value: Expression): WritePropExpr;
|
|
363
|
-
}
|
|
364
|
-
export declare class ReadKeyExpr extends Expression {
|
|
365
|
-
receiver: Expression;
|
|
366
|
-
index: Expression;
|
|
367
|
-
constructor(receiver: Expression, index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
368
|
-
isEquivalent(e: Expression): boolean;
|
|
369
|
-
isConstant(): boolean;
|
|
370
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
371
|
-
set(value: Expression): WriteKeyExpr;
|
|
372
|
-
}
|
|
373
|
-
export declare class LiteralArrayExpr extends Expression {
|
|
374
|
-
entries: Expression[];
|
|
375
|
-
constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
376
|
-
isConstant(): boolean;
|
|
377
|
-
isEquivalent(e: Expression): boolean;
|
|
378
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
379
|
-
}
|
|
380
|
-
export declare class LiteralMapEntry {
|
|
381
|
-
key: string;
|
|
382
|
-
value: Expression;
|
|
383
|
-
quoted: boolean;
|
|
384
|
-
constructor(key: string, value: Expression, quoted: boolean);
|
|
385
|
-
isEquivalent(e: LiteralMapEntry): boolean;
|
|
386
|
-
}
|
|
387
|
-
export declare class LiteralMapExpr extends Expression {
|
|
388
|
-
entries: LiteralMapEntry[];
|
|
389
|
-
valueType: Type | null;
|
|
390
|
-
constructor(entries: LiteralMapEntry[], type?: MapType | null, sourceSpan?: ParseSourceSpan | null);
|
|
391
|
-
isEquivalent(e: Expression): boolean;
|
|
392
|
-
isConstant(): boolean;
|
|
393
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
394
|
-
}
|
|
395
|
-
export declare class CommaExpr extends Expression {
|
|
396
|
-
parts: Expression[];
|
|
397
|
-
constructor(parts: Expression[], sourceSpan?: ParseSourceSpan | null);
|
|
398
|
-
isEquivalent(e: Expression): boolean;
|
|
399
|
-
isConstant(): boolean;
|
|
400
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
401
|
-
}
|
|
402
|
-
export interface ExpressionVisitor {
|
|
403
|
-
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
|
404
|
-
visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
|
|
405
|
-
visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
|
|
406
|
-
visitWritePropExpr(expr: WritePropExpr, context: any): any;
|
|
407
|
-
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
|
408
|
-
visitTaggedTemplateExpr(ast: TaggedTemplateExpr, context: any): any;
|
|
409
|
-
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
|
410
|
-
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
|
411
|
-
visitLocalizedString(ast: LocalizedString, context: any): any;
|
|
412
|
-
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
|
413
|
-
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
|
414
|
-
visitNotExpr(ast: NotExpr, context: any): any;
|
|
415
|
-
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
|
416
|
-
visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;
|
|
417
|
-
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
|
418
|
-
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
|
419
|
-
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
|
420
|
-
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
|
421
|
-
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
|
422
|
-
visitCommaExpr(ast: CommaExpr, context: any): any;
|
|
423
|
-
visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any;
|
|
424
|
-
visitTypeofExpr(ast: TypeofExpr, context: any): any;
|
|
425
|
-
}
|
|
426
|
-
export declare const NULL_EXPR: LiteralExpr;
|
|
427
|
-
export declare const TYPED_NULL_EXPR: LiteralExpr;
|
|
428
|
-
export declare enum StmtModifier {
|
|
429
|
-
None = 0,
|
|
430
|
-
Final = 1,
|
|
431
|
-
Private = 2,
|
|
432
|
-
Exported = 4,
|
|
433
|
-
Static = 8
|
|
434
|
-
}
|
|
435
|
-
export declare class LeadingComment {
|
|
436
|
-
text: string;
|
|
437
|
-
multiline: boolean;
|
|
438
|
-
trailingNewline: boolean;
|
|
439
|
-
constructor(text: string, multiline: boolean, trailingNewline: boolean);
|
|
440
|
-
toString(): string;
|
|
441
|
-
}
|
|
442
|
-
export declare class JSDocComment extends LeadingComment {
|
|
443
|
-
tags: JSDocTag[];
|
|
444
|
-
constructor(tags: JSDocTag[]);
|
|
445
|
-
toString(): string;
|
|
446
|
-
}
|
|
447
|
-
export declare abstract class Statement {
|
|
448
|
-
modifiers: StmtModifier;
|
|
449
|
-
sourceSpan: ParseSourceSpan | null;
|
|
450
|
-
leadingComments?: LeadingComment[] | undefined;
|
|
451
|
-
constructor(modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined);
|
|
452
|
-
/**
|
|
453
|
-
* Calculates whether this statement produces the same value as the given statement.
|
|
454
|
-
* Note: We don't check Types nor ParseSourceSpans nor function arguments.
|
|
455
|
-
*/
|
|
456
|
-
abstract isEquivalent(stmt: Statement): boolean;
|
|
457
|
-
abstract visitStatement(visitor: StatementVisitor, context: any): any;
|
|
458
|
-
hasModifier(modifier: StmtModifier): boolean;
|
|
459
|
-
addLeadingComment(leadingComment: LeadingComment): void;
|
|
460
|
-
}
|
|
461
|
-
export declare class DeclareVarStmt extends Statement {
|
|
462
|
-
name: string;
|
|
463
|
-
value?: Expression | undefined;
|
|
464
|
-
type: Type | null;
|
|
465
|
-
constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
466
|
-
isEquivalent(stmt: Statement): boolean;
|
|
467
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
468
|
-
}
|
|
469
|
-
export declare class DeclareFunctionStmt extends Statement {
|
|
470
|
-
name: string;
|
|
471
|
-
params: FnParam[];
|
|
472
|
-
statements: Statement[];
|
|
473
|
-
type: Type | null;
|
|
474
|
-
constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
475
|
-
isEquivalent(stmt: Statement): boolean;
|
|
476
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
477
|
-
}
|
|
478
|
-
export declare class ExpressionStatement extends Statement {
|
|
479
|
-
expr: Expression;
|
|
480
|
-
constructor(expr: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
481
|
-
isEquivalent(stmt: Statement): boolean;
|
|
482
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
483
|
-
}
|
|
484
|
-
export declare class ReturnStatement extends Statement {
|
|
485
|
-
value: Expression;
|
|
486
|
-
constructor(value: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
487
|
-
isEquivalent(stmt: Statement): boolean;
|
|
488
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
489
|
-
}
|
|
490
|
-
export declare class IfStmt extends Statement {
|
|
491
|
-
condition: Expression;
|
|
492
|
-
trueCase: Statement[];
|
|
493
|
-
falseCase: Statement[];
|
|
494
|
-
constructor(condition: Expression, trueCase: Statement[], falseCase?: Statement[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
495
|
-
isEquivalent(stmt: Statement): boolean;
|
|
496
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
497
|
-
}
|
|
498
|
-
export interface StatementVisitor {
|
|
499
|
-
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
|
500
|
-
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
|
501
|
-
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
|
502
|
-
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
|
503
|
-
visitIfStmt(stmt: IfStmt, context: any): any;
|
|
504
|
-
}
|
|
505
|
-
export declare class RecursiveAstVisitor implements StatementVisitor, ExpressionVisitor {
|
|
506
|
-
visitType(ast: Type, context: any): any;
|
|
507
|
-
visitExpression(ast: Expression, context: any): any;
|
|
508
|
-
visitBuiltinType(type: BuiltinType, context: any): any;
|
|
509
|
-
visitExpressionType(type: ExpressionType, context: any): any;
|
|
510
|
-
visitArrayType(type: ArrayType, context: any): any;
|
|
511
|
-
visitMapType(type: MapType, context: any): any;
|
|
512
|
-
visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any;
|
|
513
|
-
visitTypeofExpr(ast: TypeofExpr, context: any): any;
|
|
514
|
-
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
|
515
|
-
visitWriteVarExpr(ast: WriteVarExpr, context: any): any;
|
|
516
|
-
visitWriteKeyExpr(ast: WriteKeyExpr, context: any): any;
|
|
517
|
-
visitWritePropExpr(ast: WritePropExpr, context: any): any;
|
|
518
|
-
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
|
519
|
-
visitTaggedTemplateExpr(ast: TaggedTemplateExpr, context: any): any;
|
|
520
|
-
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
|
521
|
-
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
|
522
|
-
visitLocalizedString(ast: LocalizedString, context: any): any;
|
|
523
|
-
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
|
524
|
-
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
|
525
|
-
visitNotExpr(ast: NotExpr, context: any): any;
|
|
526
|
-
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
|
527
|
-
visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;
|
|
528
|
-
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
|
529
|
-
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
|
530
|
-
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
|
531
|
-
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
|
532
|
-
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
|
533
|
-
visitCommaExpr(ast: CommaExpr, context: any): any;
|
|
534
|
-
visitAllExpressions(exprs: Expression[], context: any): void;
|
|
535
|
-
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
|
536
|
-
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
|
537
|
-
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
|
538
|
-
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
|
539
|
-
visitIfStmt(stmt: IfStmt, context: any): any;
|
|
540
|
-
visitAllStatements(stmts: Statement[], context: any): void;
|
|
541
|
-
}
|
|
542
|
-
export declare function leadingComment(text: string, multiline?: boolean, trailingNewline?: boolean): LeadingComment;
|
|
543
|
-
export declare function jsDocComment(tags?: JSDocTag[]): JSDocComment;
|
|
544
|
-
export declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr;
|
|
545
|
-
export declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr;
|
|
546
|
-
export declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier): ExpressionType | null;
|
|
547
|
-
export declare function expressionType(expr: Expression, typeModifiers?: TypeModifier, typeParams?: Type[] | null): ExpressionType;
|
|
548
|
-
export declare function typeofExpr(expr: Expression): TypeofExpr;
|
|
549
|
-
export declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
|
|
550
|
-
export declare function literalMap(values: {
|
|
551
|
-
key: string;
|
|
552
|
-
quoted: boolean;
|
|
553
|
-
value: Expression;
|
|
554
|
-
}[], type?: MapType | null): LiteralMapExpr;
|
|
555
|
-
export declare function unary(operator: UnaryOperator, expr: Expression, type?: Type, sourceSpan?: ParseSourceSpan | null): UnaryOperatorExpr;
|
|
556
|
-
export declare function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr;
|
|
557
|
-
export declare function fn(params: FnParam[], body: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null): FunctionExpr;
|
|
558
|
-
export declare function ifStmt(condition: Expression, thenClause: Statement[], elseClause?: Statement[], sourceSpan?: ParseSourceSpan, leadingComments?: LeadingComment[]): IfStmt;
|
|
559
|
-
export declare function taggedTemplate(tag: Expression, template: TemplateLiteral, type?: Type | null, sourceSpan?: ParseSourceSpan | null): TaggedTemplateExpr;
|
|
560
|
-
export declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr;
|
|
561
|
-
export declare function localizedString(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeholderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null): LocalizedString;
|
|
562
|
-
export declare function isNull(exp: Expression): boolean;
|
|
563
|
-
export declare const enum JSDocTagName {
|
|
564
|
-
Desc = "desc",
|
|
565
|
-
Id = "id",
|
|
566
|
-
Meaning = "meaning",
|
|
567
|
-
Suppress = "suppress"
|
|
568
|
-
}
|
|
569
|
-
export declare type JSDocTag = {
|
|
570
|
-
tagName: JSDocTagName | string;
|
|
571
|
-
text?: string;
|
|
572
|
-
} | {
|
|
573
|
-
tagName?: undefined;
|
|
574
|
-
text: string;
|
|
575
|
-
};
|
|
@@ -1,73 +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 { EmitterVisitorContext } from './abstract_emitter';
|
|
9
|
-
import { AbstractJsEmitterVisitor } from './abstract_js_emitter';
|
|
10
|
-
import * as o from './output_ast';
|
|
11
|
-
export interface ExternalReferenceResolver {
|
|
12
|
-
resolveExternalReference(ref: o.ExternalReference): unknown;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A helper class to manage the evaluation of JIT generated code.
|
|
16
|
-
*/
|
|
17
|
-
export declare class JitEvaluator {
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param sourceUrl The URL of the generated code.
|
|
21
|
-
* @param statements An array of Angular statement AST nodes to be evaluated.
|
|
22
|
-
* @param refResolver Resolves `o.ExternalReference`s into values.
|
|
23
|
-
* @param createSourceMaps If true then create a source-map for the generated code and include it
|
|
24
|
-
* inline as a source-map comment.
|
|
25
|
-
* @returns A map of all the variables in the generated code.
|
|
26
|
-
*/
|
|
27
|
-
evaluateStatements(sourceUrl: string, statements: o.Statement[], refResolver: ExternalReferenceResolver, createSourceMaps: boolean): {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Evaluate a piece of JIT generated code.
|
|
32
|
-
* @param sourceUrl The URL of this generated code.
|
|
33
|
-
* @param ctx A context object that contains an AST of the code to be evaluated.
|
|
34
|
-
* @param vars A map containing the names and values of variables that the evaluated code might
|
|
35
|
-
* reference.
|
|
36
|
-
* @param createSourceMap If true then create a source-map for the generated code and include it
|
|
37
|
-
* inline as a source-map comment.
|
|
38
|
-
* @returns The result of evaluating the code.
|
|
39
|
-
*/
|
|
40
|
-
evaluateCode(sourceUrl: string, ctx: EmitterVisitorContext, vars: {
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
}, createSourceMap: boolean): any;
|
|
43
|
-
/**
|
|
44
|
-
* Execute a JIT generated function by calling it.
|
|
45
|
-
*
|
|
46
|
-
* This method can be overridden in tests to capture the functions that are generated
|
|
47
|
-
* by this `JitEvaluator` class.
|
|
48
|
-
*
|
|
49
|
-
* @param fn A function to execute.
|
|
50
|
-
* @param args The arguments to pass to the function being executed.
|
|
51
|
-
* @returns The return value of the executed function.
|
|
52
|
-
*/
|
|
53
|
-
executeFunction(fn: Function, args: any[]): any;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* An Angular AST visitor that converts AST nodes into executable JavaScript code.
|
|
57
|
-
*/
|
|
58
|
-
export declare class JitEmitterVisitor extends AbstractJsEmitterVisitor {
|
|
59
|
-
private refResolver;
|
|
60
|
-
private _evalArgNames;
|
|
61
|
-
private _evalArgValues;
|
|
62
|
-
private _evalExportedVars;
|
|
63
|
-
constructor(refResolver: ExternalReferenceResolver);
|
|
64
|
-
createReturnStmt(ctx: EmitterVisitorContext): void;
|
|
65
|
-
getArgs(): {
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
};
|
|
68
|
-
visitExternalExpr(ast: o.ExternalExpr, ctx: EmitterVisitorContext): any;
|
|
69
|
-
visitWrappedNodeExpr(ast: o.WrappedNodeExpr<any>, ctx: EmitterVisitorContext): any;
|
|
70
|
-
visitDeclareVarStmt(stmt: o.DeclareVarStmt, ctx: EmitterVisitorContext): any;
|
|
71
|
-
visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, ctx: EmitterVisitorContext): any;
|
|
72
|
-
private _emitReferenceToExternal;
|
|
73
|
-
}
|
|
@@ -1,43 +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
|
-
/**
|
|
9
|
-
* While Angular only uses Trusted Types internally for the time being,
|
|
10
|
-
* references to Trusted Types could leak into our core.d.ts, which would force
|
|
11
|
-
* anyone compiling against @angular/core to provide the @types/trusted-types
|
|
12
|
-
* package in their compilation unit.
|
|
13
|
-
*
|
|
14
|
-
* Until https://github.com/microsoft/TypeScript/issues/30024 is resolved, we
|
|
15
|
-
* will keep Angular's public API surface free of references to Trusted Types.
|
|
16
|
-
* For internal and semi-private APIs that need to reference Trusted Types, the
|
|
17
|
-
* minimal type definitions for the Trusted Types API provided by this module
|
|
18
|
-
* should be used instead. They are marked as "declare" to prevent them from
|
|
19
|
-
* being renamed by compiler optimization.
|
|
20
|
-
*
|
|
21
|
-
* Adapted from
|
|
22
|
-
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/trusted-types/index.d.ts
|
|
23
|
-
* but restricted to the API surface used within Angular.
|
|
24
|
-
*/
|
|
25
|
-
export declare interface TrustedScript {
|
|
26
|
-
__brand__: 'TrustedScript';
|
|
27
|
-
}
|
|
28
|
-
export declare interface TrustedTypePolicyFactory {
|
|
29
|
-
createPolicy(policyName: string, policyOptions: {
|
|
30
|
-
createScript?: (input: string) => string;
|
|
31
|
-
}): TrustedTypePolicy;
|
|
32
|
-
}
|
|
33
|
-
export declare interface TrustedTypePolicy {
|
|
34
|
-
createScript(input: string): TrustedScript;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Unsafely call the Function constructor with the given string arguments.
|
|
38
|
-
* @security This is a security-sensitive function; any use of this function
|
|
39
|
-
* must go through security review. In particular, it must be assured that it
|
|
40
|
-
* is only called from the JIT compiler, as use in other code can lead to XSS
|
|
41
|
-
* vulnerabilities.
|
|
42
|
-
*/
|
|
43
|
-
export declare function newTrustedFunctionForJIT(...args: string[]): Function;
|