/** * Renderer AST 的工具库 * * 这里维护操作 Renderer AST 的工具,尤其是方便创建 AST。 * 例如:new AssignmentStatement(new Identifier('html'), new Literal('foo')) 可以简写为 ASSIGN(I('html), L('foo)) */ import { SyntaxNode, Block, MapLiteral, UnaryOperator, UnaryExpression, NewExpression, VariableDefinition, ReturnStatement, BinaryOperator, If, Null, Undefined, AssignmentStatement, Statement, Expression, Identifier, ExpressionStatement, BinaryExpression, Literal, TryStatement, ConditionalExpression, ArrayLiteral } from './renderer-ast-dfn'; export declare function createHTMLLiteralAppend(html: string): ExpressionStatement; export declare function createHTMLExpressionAppend(expr: Expression): ExpressionStatement; export declare function createDefaultValue(expr: Expression, value: Expression): Statement; export declare function createIfNotNull(expr: Expression, statements: Statement[]): If; export declare function createIfNull(expr: Expression, statements: Statement[]): If; export declare function createIfStrictEqual(lhs: Expression, rhs: Expression, statements: Statement[]): If; export declare function createTryStatement(block: Statement[], param: Identifier, body: Statement[]): TryStatement; export declare function createDefineWithDefaultValue(varName: string, value: Expression, defaultValue: Expression): VariableDefinition; export declare function L(val: any): Literal; export declare function I(name: string): Identifier; export declare const NULL: Null; export declare const UNDEFINED: Undefined; export declare const CTX_DATA: BinaryExpression; export declare function CONDITIONAL(cond: Expression, thenExpr: Expression, elseExpr: Expression): ConditionalExpression; export declare function BINARY(lhs: Expression, op: BinaryOperator, rhs: Expression): BinaryExpression; export declare function UNARY(op: UnaryOperator, val: Expression): UnaryExpression; export declare function ASSIGN(lhs: Expression, rhs: Expression): AssignmentStatement; export declare function RETURN(val: Expression): ReturnStatement; export declare function STATEMENT(expr: Expression): ExpressionStatement; export declare function DEF(name: string, expr?: Expression): VariableDefinition; export declare function NEW(name: Expression, args: Expression[]): NewExpression; export declare const EMPTY_MAP: MapLiteral; export declare const EMPTY_ARRAY: ArrayLiteral; export declare function isBlock(node: any): node is Block; export declare function isSyntaxNode(node: any): node is SyntaxNode; export declare function isExpressionStatement(node: SyntaxNode): node is ExpressionStatement; export declare function isBinaryExpression(node: SyntaxNode): node is BinaryExpression; export declare function isIdentifier(node: SyntaxNode): node is Identifier; export declare function isLiteral(node: SyntaxNode): node is Literal;