@angular/compiler 14.0.0-next.1 → 14.0.0-next.10

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 (53) hide show
  1. package/esm2020/src/compiler.mjs +2 -2
  2. package/esm2020/src/compiler_facade_interface.mjs +1 -1
  3. package/esm2020/src/expression_parser/parser.mjs +76 -19
  4. package/esm2020/src/jit_compiler_facade.mjs +6 -3
  5. package/esm2020/src/ml_parser/lexer.mjs +2 -2
  6. package/esm2020/src/output/output_ast.mjs +1 -1
  7. package/esm2020/src/parse_util.mjs +2 -2
  8. package/esm2020/src/render3/partial/api.mjs +1 -1
  9. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  10. package/esm2020/src/render3/partial/directive.mjs +1 -1
  11. package/esm2020/src/render3/partial/factory.mjs +1 -1
  12. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  13. package/esm2020/src/render3/partial/injector.mjs +1 -1
  14. package/esm2020/src/render3/partial/ng_module.mjs +1 -1
  15. package/esm2020/src/render3/partial/pipe.mjs +1 -1
  16. package/esm2020/src/render3/r3_identifiers.mjs +3 -1
  17. package/esm2020/src/render3/r3_module_compiler.mjs +45 -8
  18. package/esm2020/src/render3/r3_pipe_compiler.mjs +4 -1
  19. package/esm2020/src/render3/r3_template_transform.mjs +9 -9
  20. package/esm2020/src/render3/view/api.mjs +1 -1
  21. package/esm2020/src/render3/view/compiler.mjs +43 -40
  22. package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +2 -5
  23. package/esm2020/src/render3/view/i18n/meta.mjs +11 -6
  24. package/esm2020/src/render3/view/style_parser.mjs +2 -2
  25. package/esm2020/src/render3/view/styling_builder.mjs +3 -3
  26. package/esm2020/src/render3/view/template.mjs +98 -129
  27. package/esm2020/src/render3/view/util.mjs +94 -15
  28. package/esm2020/src/selector.mjs +3 -3
  29. package/esm2020/src/shadow_css.mjs +2 -2
  30. package/esm2020/src/template_parser/binding_parser.mjs +16 -16
  31. package/esm2020/src/version.mjs +1 -1
  32. package/fesm2015/compiler.mjs +414 -257
  33. package/fesm2015/compiler.mjs.map +1 -1
  34. package/fesm2015/testing.mjs +1 -1
  35. package/fesm2015/testing.mjs.map +1 -1
  36. package/fesm2020/compiler.mjs +410 -255
  37. package/fesm2020/compiler.mjs.map +1 -1
  38. package/fesm2020/testing.mjs +1 -1
  39. package/fesm2020/testing.mjs.map +1 -1
  40. package/package.json +10 -2
  41. package/src/compiler.d.ts +1 -1
  42. package/src/compiler_facade_interface.d.ts +4 -0
  43. package/src/expression_parser/parser.d.ts +22 -5
  44. package/src/output/output_ast.d.ts +2 -1
  45. package/src/render3/partial/api.d.ts +10 -0
  46. package/src/render3/r3_identifiers.d.ts +2 -0
  47. package/src/render3/r3_module_compiler.d.ts +30 -4
  48. package/src/render3/r3_pipe_compiler.d.ts +4 -0
  49. package/src/render3/view/api.d.ts +4 -0
  50. package/src/render3/view/i18n/meta.d.ts +1 -1
  51. package/src/render3/view/template.d.ts +1 -4
  52. package/src/render3/view/util.d.ts +19 -2
  53. package/src/template_parser/binding_parser.d.ts +4 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.1
2
+ * @license Angular v14.0.0-next.10
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../../packages/compiler/testing/src/testing.ts","../../../../../../packages/compiler/testing/public_api.ts","../../../../../../packages/compiler/testing/index.ts","../../../../../../packages/compiler/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all APIs of the compiler package.\n *\n * <div class=\"callout is-critical\">\n * <header>Unstable APIs</header>\n * <p>\n * All compiler apis are currently considered experimental and private!\n * </p>\n * <p>\n * We expect the APIs in this package to keep on changing. Do not rely on them.\n * </p>\n * </div>\n */\n\n// TODO(alxhub): @angular/compiler/testing is unused in Ivy. A placeholder\n// is left here because the components repo still depends on this package\n// directly. It will be cleaned up at a later date.\n//\n// This export ensures this package is not empty.\nexport const unusedExport = true;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"node\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAQA;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AACA;AACA;MACa,YAAY,GAAG;;AC7B5B;;;;;;;AAiBA;;ACjBA;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../../packages/compiler/testing/src/testing.ts","../../../../../../packages/compiler/testing/public_api.ts","../../../../../../packages/compiler/testing/index.ts","../../../../../../packages/compiler/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all APIs of the compiler package.\n *\n * <div class=\"callout is-critical\">\n * <header>Unstable APIs</header>\n * <p>\n * All compiler apis are currently considered experimental and private!\n * </p>\n * <p>\n * We expect the APIs in this package to keep on changing. Do not rely on them.\n * </p>\n * </div>\n */\n\n// TODO(alxhub): @angular/compiler/testing is unused in Ivy. A placeholder\n// is left here because the components repo still depends on this package\n// directly. It will be cleaned up at a later date.\n//\n// This export ensures this package is not empty.\nexport const unusedExport = true;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"node\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AAEH;;;;;;;;;;;;;;AAcG;AAEH;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG;;AC7B5B;;;;;;AAMG;AAWH;;ACjBA;;;;;;AAMG;;ACNH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "14.0.0-next.1",
3
+ "version": "14.0.0-next.10",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": "^12.20.0 || ^14.15.0 || >=16.10.0"
8
+ "node": "^14.15.0 || >=16.10.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "tslib": "^2.3.0"
12
12
  },
13
+ "peerDependencies": {
14
+ "@angular/core": "14.0.0-next.10"
15
+ },
16
+ "peerDependenciesMeta": {
17
+ "@angular/core": {
18
+ "optional": true
19
+ }
20
+ },
13
21
  "repository": {
14
22
  "type": "git",
15
23
  "url": "https://github.com/angular/angular.git",
package/src/compiler.d.ts CHANGED
@@ -58,7 +58,7 @@ export * from './render3/view/t2_binder';
58
58
  export { Identifiers as R3Identifiers } from './render3/r3_identifiers';
59
59
  export { R3ClassMetadata, CompileClassMetadataFn, compileClassMetadata } from './render3/r3_class_metadata_compiler';
60
60
  export { compileFactoryFunction, R3DependencyMetadata, R3FactoryMetadata, FactoryTarget } from './render3/r3_factory';
61
- export { compileNgModule, R3NgModuleMetadata } from './render3/r3_module_compiler';
61
+ export { compileNgModule, R3NgModuleMetadata, R3SelectorScopeMode } from './render3/r3_module_compiler';
62
62
  export { compileInjector, R3InjectorMetadata } from './render3/r3_injector_compiler';
63
63
  export { compilePipeFromMetadata, R3PipeMetadata } from './render3/r3_pipe_compiler';
64
64
  export { makeBindingParser, ParsedTemplate, parseTemplate, ParseTemplateOptions } from './render3/view/template';
@@ -86,6 +86,7 @@ export interface R3PipeMetadataFacade {
86
86
  type: Type;
87
87
  pipeName: string;
88
88
  pure: boolean;
89
+ isStandalone: boolean;
89
90
  }
90
91
  export interface R3InjectableMetadataFacade {
91
92
  name: string;
@@ -136,6 +137,7 @@ export interface R3DirectiveMetadataFacade {
136
137
  exportAs: string[] | null;
137
138
  providers: Provider[] | null;
138
139
  viewQueries: R3QueryMetadataFacade[];
140
+ isStandalone: boolean;
139
141
  }
140
142
  export interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {
141
143
  template: string;
@@ -177,6 +179,7 @@ export interface R3DeclareDirectiveFacade {
177
179
  exportAs?: string[];
178
180
  usesInheritance?: boolean;
179
181
  usesOnChanges?: boolean;
182
+ isStandalone?: boolean;
180
183
  }
181
184
  export interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {
182
185
  template: string;
@@ -271,6 +274,7 @@ export interface R3DeclarePipeFacade {
271
274
  type: Type;
272
275
  name: string;
273
276
  pure?: boolean;
277
+ isStandalone?: boolean;
274
278
  }
275
279
  export interface ParseSourceSpan {
276
280
  start: any;
@@ -6,6 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { InterpolationConfig } from '../ml_parser/interpolation_config';
9
+ import { InterpolatedAttributeToken, InterpolatedTextToken } from '../ml_parser/tokens';
9
10
  import { AbsoluteSourceSpan, AST, ASTWithSource, BindingPipe, LiteralMap, ParserError, ParseSpan, TemplateBinding, TemplateBindingIdentifier } from './ast';
10
11
  import { Lexer, Token } from './lexer';
11
12
  export interface InterpolationPiece {
@@ -25,11 +26,26 @@ export declare class TemplateBindingParseResult {
25
26
  errors: ParserError[];
26
27
  constructor(templateBindings: TemplateBinding[], warnings: string[], errors: ParserError[]);
27
28
  }
29
+ /**
30
+ * Represents the possible parse modes to be used as a bitmask.
31
+ */
32
+ export declare const enum ParseFlags {
33
+ None = 0,
34
+ /**
35
+ * Whether an output binding is being parsed.
36
+ */
37
+ Action = 1,
38
+ /**
39
+ * Whether an assignment event is being parsed, i.e. an expression originating from
40
+ * two-way-binding aka banana-in-a-box syntax.
41
+ */
42
+ AssignmentEvent = 2
43
+ }
28
44
  export declare class Parser {
29
45
  private _lexer;
30
46
  private errors;
31
47
  constructor(_lexer: Lexer);
32
- parseAction(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
48
+ parseAction(input: string, isAssignmentEvent: boolean, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
33
49
  parseBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
34
50
  private checkSimpleExpression;
35
51
  parseSimpleBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource;
@@ -62,7 +78,7 @@ export declare class Parser {
62
78
  * @param absoluteValueOffset start of the `templateValue`
63
79
  */
64
80
  parseTemplateBindings(templateKey: string, templateValue: string, templateUrl: string, absoluteKeyOffset: number, absoluteValueOffset: number): TemplateBindingParseResult;
65
- parseInterpolation(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource | null;
81
+ parseInterpolation(input: string, location: string, absoluteOffset: number, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): ASTWithSource | null;
66
82
  /**
67
83
  * Similar to `parseInterpolation`, but treats the provided string as a single expression
68
84
  * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
@@ -77,7 +93,7 @@ export declare class Parser {
77
93
  * `SplitInterpolation` with splits that look like
78
94
  * <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
79
95
  */
80
- splitInterpolation(input: string, location: string, interpolationConfig?: InterpolationConfig): SplitInterpolation;
96
+ splitInterpolation(input: string, location: string, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): SplitInterpolation;
81
97
  wrapLiteralPrimitive(input: string | null, location: string, absoluteOffset: number): ASTWithSource;
82
98
  private _stripComments;
83
99
  private _commentStart;
@@ -99,7 +115,7 @@ export declare class _ParseAST {
99
115
  location: string;
100
116
  absoluteOffset: number;
101
117
  tokens: Token[];
102
- parseAction: boolean;
118
+ parseFlags: ParseFlags;
103
119
  private errors;
104
120
  private offset;
105
121
  private rparensExpected;
@@ -108,7 +124,7 @@ export declare class _ParseAST {
108
124
  private context;
109
125
  private sourceSpanCache;
110
126
  index: number;
111
- constructor(input: string, location: string, absoluteOffset: number, tokens: Token[], parseAction: boolean, errors: ParserError[], offset: number);
127
+ constructor(input: string, location: string, absoluteOffset: number, tokens: Token[], parseFlags: ParseFlags, errors: ParserError[], offset: number);
112
128
  peek(offset: number): Token;
113
129
  get next(): Token;
114
130
  /** Whether all the parser input has been processed. */
@@ -175,6 +191,7 @@ export declare class _ParseAST {
175
191
  parseLiteralMap(): LiteralMap;
176
192
  parseAccessMember(readReceiver: AST, start: number, isSafe: boolean): AST;
177
193
  parseCall(receiver: AST, start: number, isSafe: boolean): AST;
194
+ private consumeOptionalAssignment;
178
195
  parseCallArguments(): BindingPipe[];
179
196
  /**
180
197
  * Parses an identifier, a keyword, a string with an optional `-` in between,
@@ -563,7 +563,8 @@ export declare function isNull(exp: Expression): boolean;
563
563
  export declare const enum JSDocTagName {
564
564
  Desc = "desc",
565
565
  Id = "id",
566
- Meaning = "meaning"
566
+ Meaning = "meaning",
567
+ Suppress = "suppress"
567
568
  }
568
569
  export declare type JSDocTag = {
569
570
  tagName: JSDocTagName | string;
@@ -105,6 +105,10 @@ export interface R3DeclareDirectiveMetadata extends R3PartialDeclaration {
105
105
  * Whether the directive implements the `ngOnChanges` hook. Defaults to false.
106
106
  */
107
107
  usesOnChanges?: boolean;
108
+ /**
109
+ * Whether the directive is standalone. Defaults to false.
110
+ */
111
+ isStandalone?: boolean;
108
112
  }
109
113
  /**
110
114
  * Describes the shape of the object that the `ɵɵngDeclareComponent()` function accepts.
@@ -298,6 +302,12 @@ export interface R3DeclarePipeMetadata extends R3PartialDeclaration {
298
302
  * Default: true.
299
303
  */
300
304
  pure?: boolean;
305
+ /**
306
+ * Whether the pipe is standalone.
307
+ *
308
+ * Default: false.
309
+ */
310
+ isStandalone?: boolean;
301
311
  }
302
312
  /**
303
313
  * Describes the shape of the object that the `ɵɵngDeclareFactory()` function accepts.
@@ -65,6 +65,7 @@ export declare class Identifiers {
65
65
  static stylePropInterpolate8: o.ExternalReference;
66
66
  static stylePropInterpolateV: o.ExternalReference;
67
67
  static nextContext: o.ExternalReference;
68
+ static resetView: o.ExternalReference;
68
69
  static templateCreate: o.ExternalReference;
69
70
  static text: o.ExternalReference;
70
71
  static enableBindings: o.ExternalReference;
@@ -154,6 +155,7 @@ export declare class Identifiers {
154
155
  static defineNgModule: o.ExternalReference;
155
156
  static declareNgModule: o.ExternalReference;
156
157
  static setNgModuleScope: o.ExternalReference;
158
+ static registerNgModuleType: o.ExternalReference;
157
159
  static PipeDeclaration: o.ExternalReference;
158
160
  static definePipe: o.ExternalReference;
159
161
  static declarePipe: o.ExternalReference;
@@ -8,6 +8,34 @@
8
8
  import { R3DeclareNgModuleFacade } from '../compiler_facade_interface';
9
9
  import * as o from '../output/output_ast';
10
10
  import { R3CompiledExpression, R3Reference } from './util';
11
+ /**
12
+ * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
13
+ * as a part of the NgModule definition.
14
+ */
15
+ export declare enum R3SelectorScopeMode {
16
+ /**
17
+ * Emit the declarations inline into the module definition.
18
+ *
19
+ * This option is useful in certain contexts where it's known that JIT support is required. The
20
+ * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
21
+ * they are unused, but the NgModule is used.
22
+ */
23
+ Inline = 0,
24
+ /**
25
+ * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
26
+ * guarded with the `ngJitMode` flag.
27
+ *
28
+ * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
29
+ * false, which allows unused directives and pipes to be tree-shaken.
30
+ */
31
+ SideEffect = 1,
32
+ /**
33
+ * Don't generate selector scopes at all.
34
+ *
35
+ * This is useful for contexts where JIT support is known to be unnecessary.
36
+ */
37
+ Omit = 2
38
+ }
11
39
  /**
12
40
  * Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.
13
41
  */
@@ -49,11 +77,9 @@ export interface R3NgModuleMetadata {
49
77
  */
50
78
  exports: R3Reference[];
51
79
  /**
52
- * Whether to emit the selector scope values (declarations, imports, exports) inline into the
53
- * module definition, or to generate additional statements which patch them on. Inline emission
54
- * does not allow components to be tree-shaken, but is useful for JIT mode.
80
+ * How to emit the selector scope values (declarations, imports, exports).
55
81
  */
56
- emitInline: boolean;
82
+ selectorScopeMode: R3SelectorScopeMode;
57
83
  /**
58
84
  * Whether to generate closure wrappers for bootstrap, declarations, imports, and exports.
59
85
  */
@@ -41,6 +41,10 @@ export interface R3PipeMetadata {
41
41
  * Whether the pipe is marked as pure.
42
42
  */
43
43
  pure: boolean;
44
+ /**
45
+ * Whether the pipe is standalone.
46
+ */
47
+ isStandalone: boolean;
44
48
  }
45
49
  export declare function compilePipeFromMetadata(metadata: R3PipeMetadata): R3CompiledExpression;
46
50
  export declare function createPipeType(metadata: R3PipeMetadata): o.Type;
@@ -102,6 +102,10 @@ export interface R3DirectiveMetadata {
102
102
  * The list of providers defined in the directive.
103
103
  */
104
104
  providers: o.Expression | null;
105
+ /**
106
+ * Whether or not the component or directive is standalone.
107
+ */
108
+ isStandalone: boolean;
105
109
  }
106
110
  /**
107
111
  * Specifies how a list of declaration type references should be emitted into the generated code.
@@ -75,4 +75,4 @@ export declare class I18nMetaVisitor implements html.Visitor {
75
75
  * @returns Object with id, meaning and description fields
76
76
  */
77
77
  export declare function parseI18nMeta(meta?: string): I18nMeta;
78
- export declare function i18nMetaToJSDoc(meta: I18nMeta): o.JSDocComment | null;
78
+ export declare function i18nMetaToJSDoc(meta: I18nMeta): o.JSDocComment;
@@ -130,11 +130,8 @@ export declare class TemplateDefinitionBuilder implements t.Visitor<void>, Local
130
130
  private instructionFn;
131
131
  private processStylingUpdateInstruction;
132
132
  private creationInstruction;
133
- private creationInstructionChain;
134
133
  private updateInstructionWithAdvance;
135
134
  private updateInstruction;
136
- private updateInstructionChain;
137
- private updateInstructionChainWithAdvance;
138
135
  private addAdvanceInstructionIfNecessary;
139
136
  private allocatePureFunctionSlots;
140
137
  private allocateBindingSlots;
@@ -257,7 +254,7 @@ export declare class BindingScope implements LocalResolver {
257
254
  generateSharedContextVar(retrievalLevel: number): void;
258
255
  getComponentProperty(name: string): o.Expression;
259
256
  maybeRestoreView(): void;
260
- restoreViewStatement(): o.Statement[];
257
+ restoreViewStatement(): o.Statement | null;
261
258
  viewSnapshotStatements(): o.Statement[];
262
259
  isListenerScope(): boolean | null;
263
260
  variableDeclarations(): o.Statement[];
@@ -25,6 +25,20 @@ export declare const IMPLICIT_REFERENCE = "$implicit";
25
25
  export declare const NON_BINDABLE_ATTR = "ngNonBindable";
26
26
  /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
27
27
  export declare const RESTORED_VIEW_CONTEXT_NAME = "restoredCtx";
28
+ /**
29
+ * Possible types that can be used to generate the parameters of an instruction call.
30
+ * If the parameters are a function, the function will be invoked at the time the instruction
31
+ * is generated.
32
+ */
33
+ export declare type InstructionParams = (o.Expression | o.Expression[]) | (() => (o.Expression | o.Expression[]));
34
+ /** Necessary information to generate a call to an instruction function. */
35
+ export interface Instruction {
36
+ span: ParseSourceSpan | null;
37
+ reference: o.ExternalReference;
38
+ paramsOrFn?: InstructionParams;
39
+ }
40
+ /** Generates a call to a single instruction. */
41
+ export declare function invokeInstruction(span: ParseSourceSpan | null, reference: o.ExternalReference, params: o.Expression[]): o.Expression;
28
42
  /**
29
43
  * Creates an allocator for a temporary variable.
30
44
  *
@@ -67,11 +81,14 @@ export declare class DefinitionMap<T = any> {
67
81
  export declare function getAttrsForDirectiveMatching(elOrTpl: t.Element | t.Template): {
68
82
  [name: string]: string;
69
83
  };
70
- /** Returns a call expression to a chained instruction, e.g. `property(params[0])(params[1])`. */
71
- export declare function chainedInstruction(reference: o.ExternalReference, calls: o.Expression[][], span?: ParseSourceSpan | null): o.Expression;
72
84
  /**
73
85
  * Gets the number of arguments expected to be passed to a generated instruction in the case of
74
86
  * interpolation instructions.
75
87
  * @param interpolation An interpolation ast
76
88
  */
77
89
  export declare function getInterpolationArgsLength(interpolation: Interpolation): number;
90
+ /**
91
+ * Generates the final instruction call statements based on the passed in configuration.
92
+ * Will try to chain instructions as much as possible, if chaining is supported.
93
+ */
94
+ export declare function getInstructionStatements(instructions: Instruction[]): o.Statement[];
@@ -9,6 +9,7 @@ import { SecurityContext } from '../core';
9
9
  import { ASTWithSource, BindingPipe, BoundElementProperty, ParsedEvent, ParsedProperty, ParsedVariable, RecursiveAstVisitor } from '../expression_parser/ast';
10
10
  import { Parser } from '../expression_parser/parser';
11
11
  import { InterpolationConfig } from '../ml_parser/interpolation_config';
12
+ import { InterpolatedAttributeToken, InterpolatedTextToken } from '../ml_parser/tokens';
12
13
  import { ParseError, ParseSourceSpan } from '../parse_util';
13
14
  import { ElementSchemaRegistry } from '../schema/element_schema_registry';
14
15
  export interface HostProperties {
@@ -29,7 +30,7 @@ export declare class BindingParser {
29
30
  get interpolationConfig(): InterpolationConfig;
30
31
  createBoundHostProperties(properties: HostProperties, sourceSpan: ParseSourceSpan): ParsedProperty[] | null;
31
32
  createDirectiveHostEventAsts(hostListeners: HostListeners, sourceSpan: ParseSourceSpan): ParsedEvent[] | null;
32
- parseInterpolation(value: string, sourceSpan: ParseSourceSpan): ASTWithSource;
33
+ parseInterpolation(value: string, sourceSpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): ASTWithSource;
33
34
  /**
34
35
  * Similar to `parseInterpolation`, but treats the provided string as a single expression
35
36
  * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
@@ -64,12 +65,12 @@ export declare class BindingParser {
64
65
  private _parseTemplateBindings;
65
66
  parseLiteralAttr(name: string, value: string | null, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
66
67
  parsePropertyBinding(name: string, expression: string, isHost: boolean, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
67
- parsePropertyInterpolation(name: string, value: string, sourceSpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): boolean;
68
+ parsePropertyInterpolation(name: string, value: string, sourceSpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): boolean;
68
69
  private _parsePropertyAst;
69
70
  private _parseAnimation;
70
71
  private _parseBinding;
71
72
  createBoundElementProperty(elementSelector: string, boundProp: ParsedProperty, skipValidation?: boolean, mapPropertyName?: boolean): BoundElementProperty;
72
- parseEvent(name: string, expression: string, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, targetMatchableAttrs: string[][], targetEvents: ParsedEvent[], keySpan: ParseSourceSpan): void;
73
+ parseEvent(name: string, expression: string, isAssignmentEvent: boolean, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, targetMatchableAttrs: string[][], targetEvents: ParsedEvent[], keySpan: ParseSourceSpan): void;
73
74
  calcPossibleSecurityContexts(selector: string, propName: string, isAttribute: boolean): SecurityContext[];
74
75
  private _parseAnimationEvent;
75
76
  private _parseRegularEvent;