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 { CompileDirectiveMetadata, CompileDirectiveSummary, CompilePipeSummary, CompileTypeMetadata } from '../compile_metadata';
|
---|
9 | import { CompileReflector } from '../compile_reflector';
|
---|
10 | import { CompilerConfig } from '../config';
|
---|
11 | import { SchemaMetadata } from '../core';
|
---|
12 | import { AST } from '../expression_parser/ast';
|
---|
13 | import { Parser } from '../expression_parser/parser';
|
---|
14 | import { HtmlParser, ParseTreeResult } from '../ml_parser/html_parser';
|
---|
15 | import { InterpolationConfig } from '../ml_parser/interpolation_config';
|
---|
16 | import { ParseError, ParseErrorLevel, ParseSourceSpan } from '../parse_util';
|
---|
17 | import { ElementSchemaRegistry } from '../schema/element_schema_registry';
|
---|
18 | import { CssSelector } from '../selector';
|
---|
19 | import { Console } from '../util';
|
---|
20 | import * as t from './template_ast';
|
---|
21 | export declare class TemplateParseError extends ParseError {
|
---|
22 | constructor(message: string, span: ParseSourceSpan, level: ParseErrorLevel);
|
---|
23 | }
|
---|
24 | export declare class TemplateParseResult {
|
---|
25 | templateAst?: t.TemplateAst[] | undefined;
|
---|
26 | usedPipes?: CompilePipeSummary[] | undefined;
|
---|
27 | errors?: ParseError[] | undefined;
|
---|
28 | constructor(templateAst?: t.TemplateAst[] | undefined, usedPipes?: CompilePipeSummary[] | undefined, errors?: ParseError[] | undefined);
|
---|
29 | }
|
---|
30 | export declare class TemplateParser {
|
---|
31 | private _config;
|
---|
32 | private _reflector;
|
---|
33 | private _exprParser;
|
---|
34 | private _schemaRegistry;
|
---|
35 | private _htmlParser;
|
---|
36 | private _console;
|
---|
37 | transforms: t.TemplateAstVisitor[];
|
---|
38 | constructor(_config: CompilerConfig, _reflector: CompileReflector, _exprParser: Parser, _schemaRegistry: ElementSchemaRegistry, _htmlParser: HtmlParser, _console: Console | null, transforms: t.TemplateAstVisitor[]);
|
---|
39 | get expressionParser(): Parser;
|
---|
40 | parse(component: CompileDirectiveMetadata, template: string | ParseTreeResult, directives: CompileDirectiveSummary[], pipes: CompilePipeSummary[], schemas: SchemaMetadata[], templateUrl: string, preserveWhitespaces: boolean): {
|
---|
41 | template: t.TemplateAst[];
|
---|
42 | pipes: CompilePipeSummary[];
|
---|
43 | };
|
---|
44 | tryParse(component: CompileDirectiveMetadata, template: string | ParseTreeResult, directives: CompileDirectiveSummary[], pipes: CompilePipeSummary[], schemas: SchemaMetadata[], templateUrl: string, preserveWhitespaces: boolean): TemplateParseResult;
|
---|
45 | tryParseHtml(htmlAstWithErrors: ParseTreeResult, component: CompileDirectiveMetadata, directives: CompileDirectiveSummary[], pipes: CompilePipeSummary[], schemas: SchemaMetadata[]): TemplateParseResult;
|
---|
46 | expandHtml(htmlAstWithErrors: ParseTreeResult, forced?: boolean): ParseTreeResult;
|
---|
47 | getInterpolationConfig(component: CompileDirectiveMetadata): InterpolationConfig | undefined;
|
---|
48 | }
|
---|
49 | export declare function splitClasses(classAttrValue: string): string[];
|
---|
50 | export declare function createElementCssSelector(elementName: string, attributes: [string, string][]): CssSelector;
|
---|
51 | export declare function removeSummaryDuplicates<T extends {
|
---|
52 | type: CompileTypeMetadata;
|
---|
53 | }>(items: T[]): T[];
|
---|
54 | export declare function isEmptyExpression(ast: AST): boolean;
|
---|