@angular/compiler 13.2.0-next.2 → 14.0.0-next.0

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.2.0-next.2
2
+ * @license Angular v14.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "13.2.0-next.2",
3
+ "version": "14.0.0-next.0",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
package/src/compiler.d.ts CHANGED
@@ -42,7 +42,7 @@ export * from './ml_parser/tags';
42
42
  export { ParseTreeResult, TreeError } from './ml_parser/parser';
43
43
  export { LexerRange } from './ml_parser/lexer';
44
44
  export * from './ml_parser/xml_parser';
45
- export { ArrayType, DYNAMIC_TYPE, BinaryOperator, BinaryOperatorExpr, BuiltinType, BuiltinTypeName, CommaExpr, ConditionalExpr, DeclareFunctionStmt, DeclareVarStmt, Expression, ExpressionStatement, ExpressionType, ExpressionVisitor, ExternalExpr, ExternalReference, literalMap, FunctionExpr, IfStmt, InstantiateExpr, InvokeFunctionExpr, LiteralArrayExpr, LiteralExpr, LiteralMapExpr, MapType, NotExpr, NONE_TYPE, ReadKeyExpr, ReadPropExpr, ReadVarExpr, ReturnStatement, StatementVisitor, TaggedTemplateExpr, TemplateLiteral, TemplateLiteralElement, Type, TypeVisitor, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, StmtModifier, Statement, STRING_TYPE, TypeofExpr, jsDocComment, leadingComment, LeadingComment, JSDocComment, UnaryOperator, UnaryOperatorExpr, LocalizedString } from './output/output_ast';
45
+ export { ArrayType, DYNAMIC_TYPE, BinaryOperator, BinaryOperatorExpr, BuiltinType, BuiltinTypeName, CommaExpr, ConditionalExpr, DeclareFunctionStmt, DeclareVarStmt, Expression, ExpressionStatement, ExpressionType, ExpressionVisitor, ExternalExpr, ExternalReference, literalMap, FunctionExpr, IfStmt, InstantiateExpr, InvokeFunctionExpr, LiteralArrayExpr, LiteralExpr, LiteralMapExpr, MapType, NotExpr, NONE_TYPE, ReadKeyExpr, ReadPropExpr, ReadVarExpr, ReturnStatement, StatementVisitor, TaggedTemplateExpr, TemplateLiteral, TemplateLiteralElement, Type, TypeModifier, TypeVisitor, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, StmtModifier, Statement, STRING_TYPE, TypeofExpr, jsDocComment, leadingComment, LeadingComment, JSDocComment, UnaryOperator, UnaryOperatorExpr, LocalizedString } from './output/output_ast';
46
46
  export { EmitterVisitorContext } from './output/abstract_emitter';
47
47
  export { JitEvaluator } from './output/output_jit';
48
48
  export * from './parse_util';
@@ -100,7 +100,6 @@ export declare class _ParseAST {
100
100
  location: string;
101
101
  absoluteOffset: number;
102
102
  tokens: Token[];
103
- inputLength: number;
104
103
  parseAction: boolean;
105
104
  private errors;
106
105
  private offset;
@@ -110,7 +109,7 @@ export declare class _ParseAST {
110
109
  private context;
111
110
  private sourceSpanCache;
112
111
  index: number;
113
- constructor(input: string, location: string, absoluteOffset: number, tokens: Token[], inputLength: number, parseAction: boolean, errors: ParserError[], offset: number);
112
+ constructor(input: string, location: string, absoluteOffset: number, tokens: Token[], parseAction: boolean, errors: ParserError[], offset: number);
114
113
  peek(offset: number): Token;
115
114
  get next(): Token;
116
115
  /** Whether all the parser input has been processed. */
@@ -9,11 +9,12 @@ import { Message } from '../i18n/i18n_ast';
9
9
  import { ParseSourceSpan } from '../parse_util';
10
10
  import { I18nMeta } from '../render3/view/i18n/meta';
11
11
  export declare enum TypeModifier {
12
- Const = 0
12
+ None = 0,
13
+ Const = 1
13
14
  }
14
15
  export declare abstract class Type {
15
- modifiers: TypeModifier[];
16
- constructor(modifiers?: TypeModifier[]);
16
+ modifiers: TypeModifier;
17
+ constructor(modifiers?: TypeModifier);
17
18
  abstract visitType(visitor: TypeVisitor, context: any): any;
18
19
  hasModifier(modifier: TypeModifier): boolean;
19
20
  }
@@ -29,23 +30,23 @@ export declare enum BuiltinTypeName {
29
30
  }
30
31
  export declare class BuiltinType extends Type {
31
32
  name: BuiltinTypeName;
32
- constructor(name: BuiltinTypeName, modifiers?: TypeModifier[]);
33
+ constructor(name: BuiltinTypeName, modifiers?: TypeModifier);
33
34
  visitType(visitor: TypeVisitor, context: any): any;
34
35
  }
35
36
  export declare class ExpressionType extends Type {
36
37
  value: Expression;
37
38
  typeParams: Type[] | null;
38
- constructor(value: Expression, modifiers?: TypeModifier[], typeParams?: Type[] | null);
39
+ constructor(value: Expression, modifiers?: TypeModifier, typeParams?: Type[] | null);
39
40
  visitType(visitor: TypeVisitor, context: any): any;
40
41
  }
41
42
  export declare class ArrayType extends Type {
42
43
  of: Type;
43
- constructor(of: Type, modifiers?: TypeModifier[]);
44
+ constructor(of: Type, modifiers?: TypeModifier);
44
45
  visitType(visitor: TypeVisitor, context: any): any;
45
46
  }
46
47
  export declare class MapType extends Type {
47
48
  valueType: Type | null;
48
- constructor(valueType: Type | null | undefined, modifiers?: TypeModifier[]);
49
+ constructor(valueType: Type | null | undefined, modifiers?: TypeModifier);
49
50
  visitType(visitor: TypeVisitor, context: any): any;
50
51
  }
51
52
  export declare const DYNAMIC_TYPE: BuiltinType;
@@ -159,7 +160,7 @@ export declare class WriteVarExpr extends Expression {
159
160
  isEquivalent(e: Expression): boolean;
160
161
  isConstant(): boolean;
161
162
  visitExpression(visitor: ExpressionVisitor, context: any): any;
162
- toDeclStmt(type?: Type | null, modifiers?: StmtModifier[]): DeclareVarStmt;
163
+ toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt;
163
164
  toConstDecl(): DeclareVarStmt;
164
165
  }
165
166
  export declare class WriteKeyExpr extends Expression {
@@ -330,7 +331,7 @@ export declare class FunctionExpr extends Expression {
330
331
  isEquivalent(e: Expression): boolean;
331
332
  isConstant(): boolean;
332
333
  visitExpression(visitor: ExpressionVisitor, context: any): any;
333
- toDeclStmt(name: string, modifiers?: StmtModifier[]): DeclareFunctionStmt;
334
+ toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt;
334
335
  }
335
336
  export declare class UnaryOperatorExpr extends Expression {
336
337
  operator: UnaryOperator;
@@ -425,10 +426,11 @@ export interface ExpressionVisitor {
425
426
  export declare const NULL_EXPR: LiteralExpr;
426
427
  export declare const TYPED_NULL_EXPR: LiteralExpr;
427
428
  export declare enum StmtModifier {
428
- Final = 0,
429
- Private = 1,
430
- Exported = 2,
431
- Static = 3
429
+ None = 0,
430
+ Final = 1,
431
+ Private = 2,
432
+ Exported = 4,
433
+ Static = 8
432
434
  }
433
435
  export declare class LeadingComment {
434
436
  text: string;
@@ -443,10 +445,10 @@ export declare class JSDocComment extends LeadingComment {
443
445
  toString(): string;
444
446
  }
445
447
  export declare abstract class Statement {
446
- modifiers: StmtModifier[];
448
+ modifiers: StmtModifier;
447
449
  sourceSpan: ParseSourceSpan | null;
448
450
  leadingComments?: LeadingComment[] | undefined;
449
- constructor(modifiers?: StmtModifier[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined);
451
+ constructor(modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined);
450
452
  /**
451
453
  * Calculates whether this statement produces the same value as the given statement.
452
454
  * Note: We don't check Types nor ParseSourceSpans nor function arguments.
@@ -460,7 +462,7 @@ export declare class DeclareVarStmt extends Statement {
460
462
  name: string;
461
463
  value?: Expression | undefined;
462
464
  type: Type | null;
463
- constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
465
+ constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
464
466
  isEquivalent(stmt: Statement): boolean;
465
467
  visitStatement(visitor: StatementVisitor, context: any): any;
466
468
  }
@@ -469,7 +471,7 @@ export declare class DeclareFunctionStmt extends Statement {
469
471
  params: FnParam[];
470
472
  statements: Statement[];
471
473
  type: Type | null;
472
- constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
474
+ constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
473
475
  isEquivalent(stmt: Statement): boolean;
474
476
  visitStatement(visitor: StatementVisitor, context: any): any;
475
477
  }
@@ -541,8 +543,8 @@ export declare function leadingComment(text: string, multiline?: boolean, traili
541
543
  export declare function jsDocComment(tags?: JSDocTag[]): JSDocComment;
542
544
  export declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr;
543
545
  export declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr;
544
- export declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier[]): ExpressionType | null;
545
- export declare function expressionType(expr: Expression, typeModifiers?: TypeModifier[], typeParams?: Type[] | null): ExpressionType;
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;
546
548
  export declare function typeofExpr(expr: Expression): TypeofExpr;
547
549
  export declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
548
550
  export declare function literalMap(values: {
@@ -96,7 +96,7 @@ export declare class Element implements Node {
96
96
  visit<Result>(visitor: Visitor<Result>): Result;
97
97
  }
98
98
  export declare class Template implements Node {
99
- tagName: string;
99
+ tagName: string | null;
100
100
  attributes: TextAttribute[];
101
101
  inputs: BoundAttribute[];
102
102
  outputs: BoundEvent[];
@@ -108,7 +108,7 @@ export declare class Template implements Node {
108
108
  startSourceSpan: ParseSourceSpan;
109
109
  endSourceSpan: ParseSourceSpan | null;
110
110
  i18n?: I18nMeta | undefined;
111
- constructor(tagName: string, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], templateAttrs: (BoundAttribute | TextAttribute)[], children: Node[], references: Reference[], variables: Variable[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta | undefined);
111
+ constructor(tagName: string | null, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], templateAttrs: (BoundAttribute | TextAttribute)[], children: Node[], references: Reference[], variables: Variable[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta | undefined);
112
112
  visit<Result>(visitor: Visitor<Result>): Result;
113
113
  }
114
114
  export declare class Content implements Node {
@@ -14,7 +14,7 @@ import { InterpolationConfig } from '../../ml_parser/interpolation_config';
14
14
  import { LexerRange } from '../../ml_parser/lexer';
15
15
  import * as o from '../../output/output_ast';
16
16
  import { ParseError } from '../../parse_util';
17
- import { CssSelector, SelectorMatcher } from '../../selector';
17
+ import { CssSelector } from '../../selector';
18
18
  import { BindingParser } from '../../template_parser/binding_parser';
19
19
  import * as t from '../r3_ast';
20
20
  import { I18nContext } from './i18n/context';
@@ -45,10 +45,6 @@ export declare class TemplateDefinitionBuilder implements t.Visitor<void>, Local
45
45
  private i18nContext;
46
46
  private templateIndex;
47
47
  private templateName;
48
- private directiveMatcher;
49
- private directives;
50
- private pipeTypeByName;
51
- private pipes;
52
48
  private _namespace;
53
49
  private i18nUseExternalIds;
54
50
  private _constants;
@@ -91,7 +87,7 @@ export declare class TemplateDefinitionBuilder implements t.Visitor<void>, Local
91
87
  private _ngContentReservedSlots;
92
88
  private _ngContentSelectorsOffset;
93
89
  private _implicitReceiverExpr;
94
- constructor(constantPool: ConstantPool, parentBindingScope: BindingScope, level: number, contextName: string | null, i18nContext: I18nContext | null, templateIndex: number | null, templateName: string | null, directiveMatcher: SelectorMatcher | null, directives: Set<o.Expression>, pipeTypeByName: Map<string, o.Expression>, pipes: Set<o.Expression>, _namespace: o.ExternalReference, relativeContextFilePath: string, i18nUseExternalIds: boolean, _constants?: ComponentDefConsts);
90
+ constructor(constantPool: ConstantPool, parentBindingScope: BindingScope, level: number, contextName: string | null, i18nContext: I18nContext | null, templateIndex: number | null, templateName: string | null, _namespace: o.ExternalReference, relativeContextFilePath: string, i18nUseExternalIds: boolean, _constants?: ComponentDefConsts);
95
91
  buildTemplateFunction(nodes: t.Node[], variables: t.Variable[], ngContentSelectorsOffset?: number, i18n?: i18n.I18nMeta): o.FunctionExpr;
96
92
  getLocal(name: string): o.Expression | null;
97
93
  notifyImplicitReceiverUse(): void;
@@ -155,7 +151,6 @@ export declare class TemplateDefinitionBuilder implements t.Visitor<void>, Local
155
151
  * @param value The original expression we will be resolving an arguments list from.
156
152
  */
157
153
  private getUpdateInstructionArguments;
158
- private matchDirectives;
159
154
  /**
160
155
  * Prepares all attribute expression values for the `TAttributes` array.
161
156
  *