Project

General

Profile

1
/**
2
 * @license
3
 * Copyright Google Inc. 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
export declare class ParserError {
9
    input: string;
10
    errLocation: string;
11
    ctxLocation: any;
12
    message: string;
13
    constructor(message: string, input: string, errLocation: string, ctxLocation?: any);
14
}
15
export declare class ParseSpan {
16
    start: number;
17
    end: number;
18
    constructor(start: number, end: number);
19
}
20
export declare class AST {
21
    span: ParseSpan;
22
    constructor(span: ParseSpan);
23
    visit(visitor: AstVisitor, context?: any): any;
24
    toString(): string;
25
}
26
/**
27
 * Represents a quoted expression of the form:
28
 *
29
 * quote = prefix `:` uninterpretedExpression
30
 * prefix = identifier
31
 * uninterpretedExpression = arbitrary string
32
 *
33
 * A quoted expression is meant to be pre-processed by an AST transformer that
34
 * converts it into another AST that no longer contains quoted expressions.
35
 * It is meant to allow third-party developers to extend Angular template
36
 * expression language. The `uninterpretedExpression` part of the quote is
37
 * therefore not interpreted by the Angular's own expression parser.
38
 */
39
export declare class Quote extends AST {
40
    prefix: string;
41
    uninterpretedExpression: string;
42
    location: any;
43
    constructor(span: ParseSpan, prefix: string, uninterpretedExpression: string, location: any);
44
    visit(visitor: AstVisitor, context?: any): any;
45
    toString(): string;
46
}
47
export declare class EmptyExpr extends AST {
48
    visit(visitor: AstVisitor, context?: any): void;
49
}
50
export declare class ImplicitReceiver extends AST {
51
    visit(visitor: AstVisitor, context?: any): any;
52
}
53
/**
54
 * Multiple expressions separated by a semicolon.
55
 */
56
export declare class Chain extends AST {
57
    expressions: any[];
58
    constructor(span: ParseSpan, expressions: any[]);
59
    visit(visitor: AstVisitor, context?: any): any;
60
}
61
export declare class Conditional extends AST {
62
    condition: AST;
63
    trueExp: AST;
64
    falseExp: AST;
65
    constructor(span: ParseSpan, condition: AST, trueExp: AST, falseExp: AST);
66
    visit(visitor: AstVisitor, context?: any): any;
67
}
68
export declare class PropertyRead extends AST {
69
    receiver: AST;
70
    name: string;
71
    constructor(span: ParseSpan, receiver: AST, name: string);
72
    visit(visitor: AstVisitor, context?: any): any;
73
}
74
export declare class PropertyWrite extends AST {
75
    receiver: AST;
76
    name: string;
77
    value: AST;
78
    constructor(span: ParseSpan, receiver: AST, name: string, value: AST);
79
    visit(visitor: AstVisitor, context?: any): any;
80
}
81
export declare class SafePropertyRead extends AST {
82
    receiver: AST;
83
    name: string;
84
    constructor(span: ParseSpan, receiver: AST, name: string);
85
    visit(visitor: AstVisitor, context?: any): any;
86
}
87
export declare class KeyedRead extends AST {
88
    obj: AST;
89
    key: AST;
90
    constructor(span: ParseSpan, obj: AST, key: AST);
91
    visit(visitor: AstVisitor, context?: any): any;
92
}
93
export declare class KeyedWrite extends AST {
94
    obj: AST;
95
    key: AST;
96
    value: AST;
97
    constructor(span: ParseSpan, obj: AST, key: AST, value: AST);
98
    visit(visitor: AstVisitor, context?: any): any;
99
}
100
export declare class BindingPipe extends AST {
101
    exp: AST;
102
    name: string;
103
    args: any[];
104
    constructor(span: ParseSpan, exp: AST, name: string, args: any[]);
105
    visit(visitor: AstVisitor, context?: any): any;
106
}
107
export declare class LiteralPrimitive extends AST {
108
    value: any;
109
    constructor(span: ParseSpan, value: any);
110
    visit(visitor: AstVisitor, context?: any): any;
111
}
112
export declare class LiteralArray extends AST {
113
    expressions: any[];
114
    constructor(span: ParseSpan, expressions: any[]);
115
    visit(visitor: AstVisitor, context?: any): any;
116
}
117
export declare type LiteralMapKey = {
118
    key: string;
119
    quoted: boolean;
120
};
121
export declare class LiteralMap extends AST {
122
    keys: LiteralMapKey[];
123
    values: any[];
124
    constructor(span: ParseSpan, keys: LiteralMapKey[], values: any[]);
125
    visit(visitor: AstVisitor, context?: any): any;
126
}
127
export declare class Interpolation extends AST {
128
    strings: any[];
129
    expressions: any[];
130
    constructor(span: ParseSpan, strings: any[], expressions: any[]);
131
    visit(visitor: AstVisitor, context?: any): any;
132
}
133
export declare class Binary extends AST {
134
    operation: string;
135
    left: AST;
136
    right: AST;
137
    constructor(span: ParseSpan, operation: string, left: AST, right: AST);
138
    visit(visitor: AstVisitor, context?: any): any;
139
}
140
export declare class PrefixNot extends AST {
141
    expression: AST;
142
    constructor(span: ParseSpan, expression: AST);
143
    visit(visitor: AstVisitor, context?: any): any;
144
}
145
export declare class NonNullAssert extends AST {
146
    expression: AST;
147
    constructor(span: ParseSpan, expression: AST);
148
    visit(visitor: AstVisitor, context?: any): any;
149
}
150
export declare class MethodCall extends AST {
151
    receiver: AST;
152
    name: string;
153
    args: any[];
154
    constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
155
    visit(visitor: AstVisitor, context?: any): any;
156
}
157
export declare class SafeMethodCall extends AST {
158
    receiver: AST;
159
    name: string;
160
    args: any[];
161
    constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
162
    visit(visitor: AstVisitor, context?: any): any;
163
}
164
export declare class FunctionCall extends AST {
165
    target: AST | null;
166
    args: any[];
167
    constructor(span: ParseSpan, target: AST | null, args: any[]);
168
    visit(visitor: AstVisitor, context?: any): any;
169
}
170
export declare class ASTWithSource extends AST {
171
    ast: AST;
172
    source: string | null;
173
    location: string;
174
    errors: ParserError[];
175
    constructor(ast: AST, source: string | null, location: string, errors: ParserError[]);
176
    visit(visitor: AstVisitor, context?: any): any;
177
    toString(): string;
178
}
179
export declare class TemplateBinding {
180
    span: ParseSpan;
181
    key: string;
182
    keyIsVar: boolean;
183
    name: string;
184
    expression: ASTWithSource;
185
    constructor(span: ParseSpan, key: string, keyIsVar: boolean, name: string, expression: ASTWithSource);
186
}
187
export interface AstVisitor {
188
    visitBinary(ast: Binary, context: any): any;
189
    visitChain(ast: Chain, context: any): any;
190
    visitConditional(ast: Conditional, context: any): any;
191
    visitFunctionCall(ast: FunctionCall, context: any): any;
192
    visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
193
    visitInterpolation(ast: Interpolation, context: any): any;
194
    visitKeyedRead(ast: KeyedRead, context: any): any;
195
    visitKeyedWrite(ast: KeyedWrite, context: any): any;
196
    visitLiteralArray(ast: LiteralArray, context: any): any;
197
    visitLiteralMap(ast: LiteralMap, context: any): any;
198
    visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
199
    visitMethodCall(ast: MethodCall, context: any): any;
200
    visitPipe(ast: BindingPipe, context: any): any;
201
    visitPrefixNot(ast: PrefixNot, context: any): any;
202
    visitNonNullAssert(ast: NonNullAssert, context: any): any;
203
    visitPropertyRead(ast: PropertyRead, context: any): any;
204
    visitPropertyWrite(ast: PropertyWrite, context: any): any;
205
    visitQuote(ast: Quote, context: any): any;
206
    visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
207
    visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
208
    visit?(ast: AST, context?: any): any;
209
}
210
export declare class NullAstVisitor implements AstVisitor {
211
    visitBinary(ast: Binary, context: any): any;
212
    visitChain(ast: Chain, context: any): any;
213
    visitConditional(ast: Conditional, context: any): any;
214
    visitFunctionCall(ast: FunctionCall, context: any): any;
215
    visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
216
    visitInterpolation(ast: Interpolation, context: any): any;
217
    visitKeyedRead(ast: KeyedRead, context: any): any;
218
    visitKeyedWrite(ast: KeyedWrite, context: any): any;
219
    visitLiteralArray(ast: LiteralArray, context: any): any;
220
    visitLiteralMap(ast: LiteralMap, context: any): any;
221
    visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
222
    visitMethodCall(ast: MethodCall, context: any): any;
223
    visitPipe(ast: BindingPipe, context: any): any;
224
    visitPrefixNot(ast: PrefixNot, context: any): any;
225
    visitNonNullAssert(ast: NonNullAssert, context: any): any;
226
    visitPropertyRead(ast: PropertyRead, context: any): any;
227
    visitPropertyWrite(ast: PropertyWrite, context: any): any;
228
    visitQuote(ast: Quote, context: any): any;
229
    visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
230
    visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
231
}
232
export declare class RecursiveAstVisitor implements AstVisitor {
233
    visitBinary(ast: Binary, context: any): any;
234
    visitChain(ast: Chain, context: any): any;
235
    visitConditional(ast: Conditional, context: any): any;
236
    visitPipe(ast: BindingPipe, context: any): any;
237
    visitFunctionCall(ast: FunctionCall, context: any): any;
238
    visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
239
    visitInterpolation(ast: Interpolation, context: any): any;
240
    visitKeyedRead(ast: KeyedRead, context: any): any;
241
    visitKeyedWrite(ast: KeyedWrite, context: any): any;
242
    visitLiteralArray(ast: LiteralArray, context: any): any;
243
    visitLiteralMap(ast: LiteralMap, context: any): any;
244
    visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
245
    visitMethodCall(ast: MethodCall, context: any): any;
246
    visitPrefixNot(ast: PrefixNot, context: any): any;
247
    visitNonNullAssert(ast: NonNullAssert, context: any): any;
248
    visitPropertyRead(ast: PropertyRead, context: any): any;
249
    visitPropertyWrite(ast: PropertyWrite, context: any): any;
250
    visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
251
    visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
252
    visitAll(asts: AST[], context: any): any;
253
    visitQuote(ast: Quote, context: any): any;
254
}
255
export declare class AstTransformer implements AstVisitor {
256
    visitImplicitReceiver(ast: ImplicitReceiver, context: any): AST;
257
    visitInterpolation(ast: Interpolation, context: any): AST;
258
    visitLiteralPrimitive(ast: LiteralPrimitive, context: any): AST;
259
    visitPropertyRead(ast: PropertyRead, context: any): AST;
260
    visitPropertyWrite(ast: PropertyWrite, context: any): AST;
261
    visitSafePropertyRead(ast: SafePropertyRead, context: any): AST;
262
    visitMethodCall(ast: MethodCall, context: any): AST;
263
    visitSafeMethodCall(ast: SafeMethodCall, context: any): AST;
264
    visitFunctionCall(ast: FunctionCall, context: any): AST;
265
    visitLiteralArray(ast: LiteralArray, context: any): AST;
266
    visitLiteralMap(ast: LiteralMap, context: any): AST;
267
    visitBinary(ast: Binary, context: any): AST;
268
    visitPrefixNot(ast: PrefixNot, context: any): AST;
269
    visitNonNullAssert(ast: NonNullAssert, context: any): AST;
270
    visitConditional(ast: Conditional, context: any): AST;
271
    visitPipe(ast: BindingPipe, context: any): AST;
272
    visitKeyedRead(ast: KeyedRead, context: any): AST;
273
    visitKeyedWrite(ast: KeyedWrite, context: any): AST;
274
    visitAll(asts: any[]): any[];
275
    visitChain(ast: Chain, context: any): AST;
276
    visitQuote(ast: Quote, context: any): AST;
277
}
278
export declare function visitAstChildren(ast: AST, visitor: AstVisitor, context?: any): void;
(1-1/6)