ast.d.ts 1.6 KB

1234567891011121314151617
  1. import { ParseResult } from '@babel/parser';
  2. import { ObjectProperty, ObjectExpression, Expression, SpreadElement, ConditionalExpression, Identifier, NumericLiteral, StringLiteral, Literal } from '@babel/types';
  3. import { ExpressionNode } from '@vue/compiler-core';
  4. import { CodegenScope, CodegenVIfScope } from './options';
  5. import { TransformContext } from './transform';
  6. export declare function createIdentifier(name: string): Identifier;
  7. export declare function createObjectProperty(name: string, value: Expression): ObjectProperty;
  8. export declare function createSpreadElement(argument: ConditionalExpression): SpreadElement;
  9. export declare function createObjectExpression(properties: Array<ObjectProperty | SpreadElement>): ObjectExpression;
  10. export declare function createVIfProperty(condition: Expression, { id }: CodegenScope): ObjectProperty;
  11. export declare function createVIfConditionalExpression({ condition, properties, }: CodegenVIfScope): ConditionalExpression;
  12. export declare function createVIfSpreadElement(vIfScope: CodegenVIfScope): SpreadElement;
  13. export declare function parseExpr(code: string | ExpressionNode, context: TransformContext, node?: ExpressionNode): ParseResult<Expression> | undefined;
  14. export declare function parseParam(code: string, context: TransformContext, node: ExpressionNode): Identifier | import("@babel/types").RestElement | import("@babel/types").Pattern;
  15. export declare function isUndefined(expr: Expression): boolean;
  16. export declare function isTrueExpr(expr: Literal): boolean;
  17. export declare function parseStringLiteral(expr: Expression | Identifier | StringLiteral | NumericLiteral): StringLiteral;