source: trip-planner-front/node_modules/@angular/compiler/src/ml_parser/ast.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.1 KB
Line 
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 */
8import { AstPath } from '../ast_path';
9import { I18nMeta } from '../i18n/i18n_ast';
10import { ParseSourceSpan } from '../parse_util';
11import { InterpolatedAttributeToken, InterpolatedTextToken } from './tokens';
12interface BaseNode {
13 sourceSpan: ParseSourceSpan;
14 visit(visitor: Visitor, context: any): any;
15}
16export declare type Node = Attribute | Comment | Element | Expansion | ExpansionCase | Text;
17export declare abstract class NodeWithI18n implements BaseNode {
18 sourceSpan: ParseSourceSpan;
19 i18n?: I18nMeta | undefined;
20 constructor(sourceSpan: ParseSourceSpan, i18n?: I18nMeta | undefined);
21 abstract visit(visitor: Visitor, context: any): any;
22}
23export declare class Text extends NodeWithI18n {
24 value: string;
25 tokens: InterpolatedTextToken[];
26 constructor(value: string, sourceSpan: ParseSourceSpan, tokens: InterpolatedTextToken[], i18n?: I18nMeta);
27 visit(visitor: Visitor, context: any): any;
28}
29export declare class Expansion extends NodeWithI18n {
30 switchValue: string;
31 type: string;
32 cases: ExpansionCase[];
33 switchValueSourceSpan: ParseSourceSpan;
34 constructor(switchValue: string, type: string, cases: ExpansionCase[], sourceSpan: ParseSourceSpan, switchValueSourceSpan: ParseSourceSpan, i18n?: I18nMeta);
35 visit(visitor: Visitor, context: any): any;
36}
37export declare class ExpansionCase implements BaseNode {
38 value: string;
39 expression: Node[];
40 sourceSpan: ParseSourceSpan;
41 valueSourceSpan: ParseSourceSpan;
42 expSourceSpan: ParseSourceSpan;
43 constructor(value: string, expression: Node[], sourceSpan: ParseSourceSpan, valueSourceSpan: ParseSourceSpan, expSourceSpan: ParseSourceSpan);
44 visit(visitor: Visitor, context: any): any;
45}
46export declare class Attribute extends NodeWithI18n {
47 name: string;
48 value: string;
49 readonly keySpan: ParseSourceSpan | undefined;
50 valueSpan: ParseSourceSpan | undefined;
51 valueTokens: InterpolatedAttributeToken[] | undefined;
52 constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan: ParseSourceSpan | undefined, valueTokens: InterpolatedAttributeToken[] | undefined, i18n: I18nMeta | undefined);
53 visit(visitor: Visitor, context: any): any;
54}
55export declare class Element extends NodeWithI18n {
56 name: string;
57 attrs: Attribute[];
58 children: Node[];
59 startSourceSpan: ParseSourceSpan;
60 endSourceSpan: ParseSourceSpan | null;
61 constructor(name: string, attrs: Attribute[], children: Node[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null, i18n?: I18nMeta);
62 visit(visitor: Visitor, context: any): any;
63}
64export declare class Comment implements BaseNode {
65 value: string | null;
66 sourceSpan: ParseSourceSpan;
67 constructor(value: string | null, sourceSpan: ParseSourceSpan);
68 visit(visitor: Visitor, context: any): any;
69}
70export interface Visitor {
71 visit?(node: Node, context: any): any;
72 visitElement(element: Element, context: any): any;
73 visitAttribute(attribute: Attribute, context: any): any;
74 visitText(text: Text, context: any): any;
75 visitComment(comment: Comment, context: any): any;
76 visitExpansion(expansion: Expansion, context: any): any;
77 visitExpansionCase(expansionCase: ExpansionCase, context: any): any;
78}
79export declare function visitAll(visitor: Visitor, nodes: Node[], context?: any): any[];
80export declare class RecursiveVisitor implements Visitor {
81 constructor();
82 visitElement(ast: Element, context: any): any;
83 visitAttribute(ast: Attribute, context: any): any;
84 visitText(ast: Text, context: any): any;
85 visitComment(ast: Comment, context: any): any;
86 visitExpansion(ast: Expansion, context: any): any;
87 visitExpansionCase(ast: ExpansionCase, context: any): any;
88 private visitChildren;
89}
90export declare type HtmlAstPath = AstPath<Node>;
91export declare function findNode(nodes: Node[], position: number): HtmlAstPath;
92export {};
Note: See TracBrowser for help on using the repository browser.