@auscope/angular2parse 2.0.0 → 2.0.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 (64) hide show
  1. package/auscope-angular2parse.d.ts +5 -0
  2. package/esm2020/auscope-angular2parse.mjs +5 -0
  3. package/esm2020/lib/angular/compiler/assertions.mjs +45 -0
  4. package/esm2020/lib/angular/compiler/ast.mjs +393 -0
  5. package/esm2020/lib/angular/compiler/chars.mjs +78 -0
  6. package/esm2020/lib/angular/compiler/interpolation-config.mjs +24 -0
  7. package/esm2020/lib/angular/compiler/lexer.mjs +344 -0
  8. package/esm2020/lib/angular/compiler/parser.mjs +721 -0
  9. package/esm2020/lib/angular/compiler.mjs +7 -0
  10. package/esm2020/lib/angular/facade/lang.mjs +85 -0
  11. package/esm2020/lib/angular/facade.mjs +2 -0
  12. package/esm2020/lib/angular.mjs +3 -0
  13. package/esm2020/lib/module.mjs +18 -0
  14. package/esm2020/lib/parse.mjs +66 -0
  15. package/esm2020/lib/util/binary-operations.mjs +18 -0
  16. package/esm2020/lib/util/lang.mjs +13 -0
  17. package/esm2020/lib/util.mjs +3 -0
  18. package/esm2020/lib/visitors/parse-visitor-compiler.mjs +96 -0
  19. package/esm2020/lib/visitors/parse-visitor-resolver.mjs +141 -0
  20. package/esm2020/lib/visitors.mjs +3 -0
  21. package/esm2020/public-api.mjs +6 -0
  22. package/fesm2015/auscope-angular2parse.mjs +2035 -0
  23. package/fesm2015/auscope-angular2parse.mjs.map +1 -0
  24. package/fesm2020/auscope-angular2parse.mjs +2033 -0
  25. package/fesm2020/auscope-angular2parse.mjs.map +1 -0
  26. package/lib/angular/compiler/assertions.d.ts +9 -0
  27. package/lib/angular/compiler/ast.d.ts +242 -0
  28. package/lib/angular/compiler/chars.d.ts +69 -0
  29. package/lib/angular/compiler/interpolation-config.d.ts +14 -0
  30. package/lib/angular/compiler/lexer.d.ts +44 -0
  31. package/lib/angular/compiler/parser.d.ts +92 -0
  32. package/{src/lib/angular/compiler.ts → lib/angular/compiler.d.ts} +1 -1
  33. package/lib/angular/facade/lang.d.ts +44 -0
  34. package/lib/angular/facade.d.ts +1 -0
  35. package/{src/lib/angular.ts → lib/angular.d.ts} +1 -1
  36. package/lib/module.d.ts +9 -0
  37. package/lib/parse.d.ts +21 -0
  38. package/lib/util/binary-operations.d.ts +1 -0
  39. package/lib/util/lang.d.ts +4 -0
  40. package/{src/lib/util.ts → lib/util.d.ts} +1 -1
  41. package/lib/visitors/parse-visitor-compiler.d.ts +23 -0
  42. package/lib/visitors/parse-visitor-resolver.d.ts +25 -0
  43. package/lib/visitors.d.ts +2 -0
  44. package/package.json +41 -18
  45. package/public-api.d.ts +2 -0
  46. package/ng-package.json +0 -7
  47. package/src/lib/angular/compiler/assertions.ts +0 -49
  48. package/src/lib/angular/compiler/ast.ts +0 -393
  49. package/src/lib/angular/compiler/chars.ts +0 -89
  50. package/src/lib/angular/compiler/interpolation-config.ts +0 -25
  51. package/src/lib/angular/compiler/lexer.ts +0 -383
  52. package/src/lib/angular/compiler/parser.ts +0 -811
  53. package/src/lib/angular/facade/lang.ts +0 -124
  54. package/src/lib/angular/facade.ts +0 -1
  55. package/src/lib/module.ts +0 -12
  56. package/src/lib/parse.ts +0 -78
  57. package/src/lib/util/binary-operations.ts +0 -17
  58. package/src/lib/util/lang.ts +0 -15
  59. package/src/lib/visitors/parse-visitor-compiler.ts +0 -149
  60. package/src/lib/visitors/parse-visitor-resolver.ts +0 -208
  61. package/src/lib/visitors.ts +0 -2
  62. package/src/public-api.ts +0 -5
  63. package/tsconfig.lib.json +0 -20
  64. package/tsconfig.lib.prod.json +0 -9
@@ -0,0 +1,242 @@
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 class LiteralMap extends AST {
118
+ keys: any[];
119
+ values: any[];
120
+ constructor(span: ParseSpan, keys: any[], values: any[]);
121
+ visit(visitor: AstVisitor, context?: any): any;
122
+ }
123
+ export declare class Interpolation extends AST {
124
+ strings: any[];
125
+ expressions: any[];
126
+ constructor(span: ParseSpan, strings: any[], expressions: any[]);
127
+ visit(visitor: AstVisitor, context?: any): any;
128
+ }
129
+ export declare class Binary extends AST {
130
+ operation: string;
131
+ left: AST;
132
+ right: AST;
133
+ constructor(span: ParseSpan, operation: string, left: AST, right: AST);
134
+ visit(visitor: AstVisitor, context?: any): any;
135
+ }
136
+ export declare class PrefixNot extends AST {
137
+ expression: AST;
138
+ constructor(span: ParseSpan, expression: AST);
139
+ visit(visitor: AstVisitor, context?: any): any;
140
+ }
141
+ export declare class MethodCall extends AST {
142
+ receiver: AST;
143
+ name: string;
144
+ args: any[];
145
+ constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
146
+ visit(visitor: AstVisitor, context?: any): any;
147
+ }
148
+ export declare class SafeMethodCall extends AST {
149
+ receiver: AST;
150
+ name: string;
151
+ args: any[];
152
+ constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
153
+ visit(visitor: AstVisitor, context?: any): any;
154
+ }
155
+ export declare class FunctionCall extends AST {
156
+ target: AST;
157
+ args: any[];
158
+ constructor(span: ParseSpan, target: AST, args: any[]);
159
+ visit(visitor: AstVisitor, context?: any): any;
160
+ }
161
+ export declare class ASTWithSource extends AST {
162
+ ast: AST;
163
+ source: string;
164
+ location: string;
165
+ errors: ParserError[];
166
+ constructor(ast: AST, source: string, location: string, errors: ParserError[]);
167
+ visit(visitor: AstVisitor, context?: any): any;
168
+ toString(): string;
169
+ }
170
+ export declare class TemplateBinding {
171
+ span: ParseSpan;
172
+ key: string;
173
+ keyIsVar: boolean;
174
+ name: string;
175
+ expression: ASTWithSource;
176
+ constructor(span: ParseSpan, key: string, keyIsVar: boolean, name: string, expression: ASTWithSource);
177
+ }
178
+ export interface AstVisitor {
179
+ visitBinary(ast: Binary, context: any): any;
180
+ visitChain(ast: Chain, context: any): any;
181
+ visitConditional(ast: Conditional, context: any): any;
182
+ visitFunctionCall(ast: FunctionCall, context: any): any;
183
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
184
+ visitInterpolation(ast: Interpolation, context: any): any;
185
+ visitKeyedRead(ast: KeyedRead, context: any): any;
186
+ visitKeyedWrite(ast: KeyedWrite, context: any): any;
187
+ visitLiteralArray(ast: LiteralArray, context: any): any;
188
+ visitLiteralMap(ast: LiteralMap, context: any): any;
189
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
190
+ visitMethodCall(ast: MethodCall, context: any): any;
191
+ visitPipe(ast: BindingPipe, context: any): any;
192
+ visitPrefixNot(ast: PrefixNot, context: any): any;
193
+ visitPropertyRead(ast: PropertyRead, context: any): any;
194
+ visitPropertyWrite(ast: PropertyWrite, context: any): any;
195
+ visitQuote(ast: Quote, context: any): any;
196
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
197
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
198
+ }
199
+ export declare class RecursiveAstVisitor implements AstVisitor {
200
+ visitBinary(ast: Binary, context: any): any;
201
+ visitChain(ast: Chain, context: any): any;
202
+ visitConditional(ast: Conditional, context: any): any;
203
+ visitPipe(ast: BindingPipe, context: any): any;
204
+ visitFunctionCall(ast: FunctionCall, context: any): any;
205
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
206
+ visitInterpolation(ast: Interpolation, context: any): any;
207
+ visitKeyedRead(ast: KeyedRead, context: any): any;
208
+ visitKeyedWrite(ast: KeyedWrite, context: any): any;
209
+ visitLiteralArray(ast: LiteralArray, context: any): any;
210
+ visitLiteralMap(ast: LiteralMap, context: any): any;
211
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
212
+ visitMethodCall(ast: MethodCall, context: any): any;
213
+ visitPrefixNot(ast: PrefixNot, context: any): any;
214
+ visitPropertyRead(ast: PropertyRead, context: any): any;
215
+ visitPropertyWrite(ast: PropertyWrite, context: any): any;
216
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
217
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
218
+ visitAll(asts: AST[], context: any): any;
219
+ visitQuote(ast: Quote, context: any): any;
220
+ }
221
+ export declare class AstTransformer implements AstVisitor {
222
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): AST;
223
+ visitInterpolation(ast: Interpolation, context: any): AST;
224
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): AST;
225
+ visitPropertyRead(ast: PropertyRead, context: any): AST;
226
+ visitPropertyWrite(ast: PropertyWrite, context: any): AST;
227
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): AST;
228
+ visitMethodCall(ast: MethodCall, context: any): AST;
229
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): AST;
230
+ visitFunctionCall(ast: FunctionCall, context: any): AST;
231
+ visitLiteralArray(ast: LiteralArray, context: any): AST;
232
+ visitLiteralMap(ast: LiteralMap, context: any): AST;
233
+ visitBinary(ast: Binary, context: any): AST;
234
+ visitPrefixNot(ast: PrefixNot, context: any): AST;
235
+ visitConditional(ast: Conditional, context: any): AST;
236
+ visitPipe(ast: BindingPipe, context: any): AST;
237
+ visitKeyedRead(ast: KeyedRead, context: any): AST;
238
+ visitKeyedWrite(ast: KeyedWrite, context: any): AST;
239
+ visitAll(asts: any[]): any[];
240
+ visitChain(ast: Chain, context: any): AST;
241
+ visitQuote(ast: Quote, context: any): AST;
242
+ }
@@ -0,0 +1,69 @@
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 const $EOF = 0;
9
+ export declare const $TAB = 9;
10
+ export declare const $LF = 10;
11
+ export declare const $VTAB = 11;
12
+ export declare const $FF = 12;
13
+ export declare const $CR = 13;
14
+ export declare const $SPACE = 32;
15
+ export declare const $BANG = 33;
16
+ export declare const $DQ = 34;
17
+ export declare const $HASH = 35;
18
+ export declare const $$ = 36;
19
+ export declare const $PERCENT = 37;
20
+ export declare const $AMPERSAND = 38;
21
+ export declare const $SQ = 39;
22
+ export declare const $LPAREN = 40;
23
+ export declare const $RPAREN = 41;
24
+ export declare const $STAR = 42;
25
+ export declare const $PLUS = 43;
26
+ export declare const $COMMA = 44;
27
+ export declare const $MINUS = 45;
28
+ export declare const $PERIOD = 46;
29
+ export declare const $SLASH = 47;
30
+ export declare const $COLON = 58;
31
+ export declare const $SEMICOLON = 59;
32
+ export declare const $LT = 60;
33
+ export declare const $EQ = 61;
34
+ export declare const $GT = 62;
35
+ export declare const $QUESTION = 63;
36
+ export declare const $0 = 48;
37
+ export declare const $9 = 57;
38
+ export declare const $A = 65;
39
+ export declare const $E = 69;
40
+ export declare const $F = 70;
41
+ export declare const $X = 88;
42
+ export declare const $Z = 90;
43
+ export declare const $LBRACKET = 91;
44
+ export declare const $BACKSLASH = 92;
45
+ export declare const $RBRACKET = 93;
46
+ export declare const $CARET = 94;
47
+ export declare const $_ = 95;
48
+ export declare const $a = 97;
49
+ export declare const $e = 101;
50
+ export declare const $f = 102;
51
+ export declare const $n = 110;
52
+ export declare const $r = 114;
53
+ export declare const $t = 116;
54
+ export declare const $u = 117;
55
+ export declare const $v = 118;
56
+ export declare const $x = 120;
57
+ export declare const $z = 122;
58
+ export declare const $LBRACE = 123;
59
+ export declare const $BAR = 124;
60
+ export declare const $RBRACE = 125;
61
+ export declare const $NBSP = 160;
62
+ export declare const $PIPE = 124;
63
+ export declare const $TILDA = 126;
64
+ export declare const $AT = 64;
65
+ export declare const $BT = 96;
66
+ export declare function isWhitespace(code: number): boolean;
67
+ export declare function isDigit(code: number): boolean;
68
+ export declare function isAsciiLetter(code: number): boolean;
69
+ export declare function isAsciiHexDigit(code: number): boolean;
@@ -0,0 +1,14 @@
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 InterpolationConfig {
9
+ start: string;
10
+ end: string;
11
+ static fromArray(markers: [string, string]): InterpolationConfig;
12
+ constructor(start: string, end: string);
13
+ }
14
+ export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
@@ -0,0 +1,44 @@
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 enum TokenType {
9
+ Character = 0,
10
+ Identifier = 1,
11
+ Keyword = 2,
12
+ String = 3,
13
+ Operator = 4,
14
+ Number = 5,
15
+ Error = 6
16
+ }
17
+ export declare class Lexer {
18
+ tokenize(text: string): Token[];
19
+ }
20
+ export declare class Token {
21
+ index: number;
22
+ type: TokenType;
23
+ numValue: number;
24
+ strValue: string;
25
+ constructor(index: number, type: TokenType, numValue: number, strValue: string);
26
+ isCharacter(code: number): boolean;
27
+ isNumber(): boolean;
28
+ isString(): boolean;
29
+ isOperator(operater: string): boolean;
30
+ isIdentifier(): boolean;
31
+ isKeyword(): boolean;
32
+ isKeywordLet(): boolean;
33
+ isKeywordNull(): boolean;
34
+ isKeywordUndefined(): boolean;
35
+ isKeywordTrue(): boolean;
36
+ isKeywordFalse(): boolean;
37
+ isKeywordThis(): boolean;
38
+ isError(): boolean;
39
+ toNumber(): number;
40
+ toString(): string;
41
+ }
42
+ export declare const EOF: Token;
43
+ export declare function isIdentifier(input: string): boolean;
44
+ export declare function isQuote(code: number): boolean;
@@ -0,0 +1,92 @@
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
+ import { InterpolationConfig } from './interpolation-config';
9
+ import { AST, ASTWithSource, BindingPipe, LiteralMap, ParseSpan, ParserError, TemplateBinding } from './ast';
10
+ import { Lexer, Token } from './lexer';
11
+ export declare class SplitInterpolation {
12
+ strings: string[];
13
+ expressions: string[];
14
+ offsets: number[];
15
+ constructor(strings: string[], expressions: string[], offsets: number[]);
16
+ }
17
+ export declare class TemplateBindingParseResult {
18
+ templateBindings: TemplateBinding[];
19
+ warnings: string[];
20
+ errors: ParserError[];
21
+ constructor(templateBindings: TemplateBinding[], warnings: string[], errors: ParserError[]);
22
+ }
23
+ export declare class Parser {
24
+ private _lexer;
25
+ private errors;
26
+ constructor(_lexer: Lexer);
27
+ parseAction(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
28
+ parseBinding(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
29
+ parseSimpleBinding(input: string, location: string, interpolationConfig?: InterpolationConfig): ASTWithSource;
30
+ private _reportError;
31
+ private _parseBindingAst;
32
+ private _parseQuote;
33
+ parseTemplateBindings(prefixToken: string, input: string, location: any): TemplateBindingParseResult;
34
+ parseInterpolation(input: string, location: any, interpolationConfig?: InterpolationConfig): ASTWithSource;
35
+ splitInterpolation(input: string, location: string, interpolationConfig?: InterpolationConfig): SplitInterpolation;
36
+ wrapLiteralPrimitive(input: string, location: any): ASTWithSource;
37
+ private _stripComments;
38
+ private _commentStart;
39
+ private _checkNoInterpolation;
40
+ private _findInterpolationErrorColumn;
41
+ }
42
+ export declare class _ParseAST {
43
+ input: string;
44
+ location: any;
45
+ tokens: Token[];
46
+ inputLength: number;
47
+ parseAction: boolean;
48
+ private errors;
49
+ private offset;
50
+ private rparensExpected;
51
+ private rbracketsExpected;
52
+ private rbracesExpected;
53
+ index: number;
54
+ constructor(input: string, location: any, tokens: Token[], inputLength: number, parseAction: boolean, errors: ParserError[], offset: number);
55
+ peek(offset: number): Token;
56
+ get next(): Token;
57
+ get inputIndex(): number;
58
+ span(start: number): ParseSpan;
59
+ advance(): void;
60
+ optionalCharacter(code: number): boolean;
61
+ peekKeywordLet(): boolean;
62
+ expectCharacter(code: number): void;
63
+ optionalOperator(op: string): boolean;
64
+ expectOperator(operator: string): void;
65
+ expectIdentifierOrKeyword(): string;
66
+ expectIdentifierOrKeywordOrString(): string;
67
+ parseChain(): AST;
68
+ parsePipe(): AST;
69
+ parseExpression(): AST;
70
+ parseConditional(): AST;
71
+ parseLogicalOr(): AST;
72
+ parseLogicalAnd(): AST;
73
+ parseEquality(): AST;
74
+ parseRelational(): AST;
75
+ parseAdditive(): AST;
76
+ parseMultiplicative(): AST;
77
+ parsePrefix(): AST;
78
+ parseCallChain(): AST;
79
+ parsePrimary(): AST;
80
+ parseExpressionList(terminator: number): AST[];
81
+ parseLiteralMap(): LiteralMap;
82
+ parseAccessMemberOrMethodCall(receiver: AST, isSafe?: boolean): AST;
83
+ parseCallArguments(): BindingPipe[];
84
+ /**
85
+ * An identifier, a keyword, a string with an optional `-` inbetween.
86
+ */
87
+ expectTemplateBindingKey(): string;
88
+ parseTemplateBindings(): TemplateBindingParseResult;
89
+ error(message: string, index?: number): void;
90
+ private locationText;
91
+ private skip;
92
+ }
@@ -3,4 +3,4 @@ export * from './compiler/ast';
3
3
  export * from './compiler/chars';
4
4
  export * from './compiler/interpolation-config';
5
5
  export * from './compiler/lexer';
6
- export * from './compiler/parser';
6
+ export * from './compiler/parser';
@@ -0,0 +1,44 @@
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 interface BrowserNodeGlobal {
9
+ Object: typeof Object;
10
+ Array: typeof Array;
11
+ Map: typeof Map;
12
+ Set: typeof Set;
13
+ Date: DateConstructor;
14
+ RegExp: RegExpConstructor;
15
+ JSON: typeof JSON;
16
+ Math: any;
17
+ assert(condition: any): void;
18
+ Reflect: any;
19
+ getAngularTestability: Function;
20
+ getAllAngularTestabilities: Function;
21
+ getAllAngularRootElements: Function;
22
+ frameworkStabilizers: Array<Function>;
23
+ setTimeout: Function;
24
+ clearTimeout: Function;
25
+ setInterval: Function;
26
+ clearInterval: Function;
27
+ encodeURI: Function;
28
+ }
29
+ export declare function getTypeNameForDebugging(type: any): string;
30
+ export declare function isPresent(obj: any): boolean;
31
+ export declare function isBlank(obj: any): boolean;
32
+ export declare function isStrictStringMap(obj: any): boolean;
33
+ export declare function stringify(token: any): string;
34
+ export declare class NumberWrapper {
35
+ static parseIntAutoRadix(text: string): number;
36
+ static isNumeric(value: any): boolean;
37
+ }
38
+ export declare function looseIdentical(a: any, b: any): boolean;
39
+ export declare function isJsObject(o: any): boolean;
40
+ export declare function print(obj: Error | Object): void;
41
+ export declare function warn(obj: Error | Object): void;
42
+ export declare function setValueOnPath(global: any, path: string, value: any): void;
43
+ export declare function isPrimitive(obj: any): boolean;
44
+ export declare function escapeRegExp(s: string): string;
@@ -0,0 +1 @@
1
+ export * from './facade/lang';
@@ -1,2 +1,2 @@
1
1
  export * from './angular/compiler';
2
- export * from './angular/facade';
2
+ export * from './angular/facade';
@@ -0,0 +1,9 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { PipesConfig } from './parse';
3
+ import * as i0 from "@angular/core";
4
+ export declare class Angular2ParseModule {
5
+ static forRoot(pipesConfigMap: PipesConfig[]): ModuleWithProviders<any>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<Angular2ParseModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<Angular2ParseModule, never, never, never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<Angular2ParseModule>;
9
+ }
package/lib/parse.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare const PIPES_CONFIG: InjectionToken<unknown>;
4
+ export interface PipesConfig {
5
+ pipeName: string;
6
+ pipeInstance: any;
7
+ }
8
+ export declare class Parse {
9
+ private _parser;
10
+ private _pipesCache;
11
+ private _evalCache;
12
+ private _calcCache;
13
+ /**
14
+ * Used to dependency inject the Angular 2 parser.
15
+ */
16
+ constructor(pipesConfigs: PipesConfig[][]);
17
+ eval(expression: string): Function;
18
+ calc(expression: string): Function;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<Parse, [{ optional: true; }]>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<Parse>;
21
+ }
@@ -0,0 +1 @@
1
+ export declare const BinaryOperations: Map<string, any>;
@@ -0,0 +1,4 @@
1
+ export declare function compileToJSON(json: any): string;
2
+ export declare function isPresent(obj: any): boolean;
3
+ export declare function isJsObject(obj: any): boolean;
4
+ export declare function isFunction(val: any): boolean;
@@ -1,2 +1,2 @@
1
1
  export * from './util/binary-operations';
2
- export * from './util/lang';
2
+ export * from './util/lang';
@@ -0,0 +1,23 @@
1
+ import { AST, RecursiveAstVisitor, PropertyRead, MethodCall, KeyedRead, ImplicitReceiver, LiteralPrimitive, Binary, Chain, Conditional, BindingPipe, FunctionCall, Interpolation, KeyedWrite, LiteralArray, LiteralMap, PrefixNot, PropertyWrite, SafePropertyRead, SafeMethodCall, Quote } from '../angular';
2
+ export declare class ParseVisitorCompiler extends RecursiveAstVisitor {
3
+ visitBinary(ast: Binary): any;
4
+ visitChain(ast: Chain): any;
5
+ visitConditional(ast: Conditional): any;
6
+ visitPipe(ast: BindingPipe): any;
7
+ visitFunctionCall(ast: FunctionCall): any;
8
+ visitImplicitReceiver(ast: ImplicitReceiver): any;
9
+ visitInterpolation(ast: Interpolation): any;
10
+ visitKeyedRead(ast: KeyedRead): any;
11
+ visitKeyedWrite(ast: KeyedWrite): any;
12
+ visitLiteralArray(ast: LiteralArray): any;
13
+ visitLiteralMap(ast: LiteralMap): any;
14
+ visitLiteralPrimitive(ast: LiteralPrimitive): any;
15
+ visitMethodCall(ast: MethodCall): any;
16
+ visitPrefixNot(ast: PrefixNot): any;
17
+ visitPropertyRead(ast: PropertyRead): any;
18
+ visitPropertyWrite(ast: PropertyWrite): any;
19
+ visitSafePropertyRead(ast: SafePropertyRead): any;
20
+ visitSafeMethodCall(ast: SafeMethodCall): any;
21
+ visitAll(asts: AST[]): any;
22
+ visitQuote(ast: Quote): any;
23
+ }
@@ -0,0 +1,25 @@
1
+ import { AST, RecursiveAstVisitor, PropertyRead, MethodCall, KeyedRead, ImplicitReceiver, LiteralPrimitive, Binary, Chain, Conditional, BindingPipe, FunctionCall, Interpolation, KeyedWrite, LiteralArray, LiteralMap, PrefixNot, PropertyWrite, SafePropertyRead, SafeMethodCall, Quote } from '../angular';
2
+ export declare class ParseVisitorResolver extends RecursiveAstVisitor {
3
+ private pipes;
4
+ constructor(pipes: Map<string, any>);
5
+ visitBinary(ast: Binary, context: any): any;
6
+ visitChain(ast: Chain, context: any): any;
7
+ visitConditional(ast: Conditional, context: any): any;
8
+ visitPipe(ast: BindingPipe, context: any): any;
9
+ visitFunctionCall(ast: FunctionCall, context: any): any;
10
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
11
+ visitInterpolation(ast: Interpolation, context: any): any;
12
+ visitKeyedRead(ast: KeyedRead, context: any): any;
13
+ visitKeyedWrite(ast: KeyedWrite, context: any): any;
14
+ visitLiteralArray(ast: LiteralArray, context: any): any;
15
+ visitLiteralMap(ast: LiteralMap, context: any): any;
16
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
17
+ visitMethodCall(ast: MethodCall, context: any): any;
18
+ visitPrefixNot(ast: PrefixNot, context: any): any;
19
+ visitPropertyRead(ast: PropertyRead, context: any): any;
20
+ visitPropertyWrite(ast: PropertyWrite, context: any): any;
21
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
22
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
23
+ visitAll(asts: AST[], context: any): any;
24
+ visitQuote(ast: Quote, context: any): any;
25
+ }
@@ -0,0 +1,2 @@
1
+ export * from './visitors/parse-visitor-compiler';
2
+ export * from './visitors/parse-visitor-resolver';