utils.d.ts 2.3 KB

123456789101112131415161718192021222324252627
  1. import { Expression, Identifier, MemberExpression, SpreadElement } from '@babel/types';
  2. import { ElementNode, ExpressionNode, SimpleExpressionNode, SourceLocation, TransformContext as VueTransformContext } from '@vue/compiler-core';
  3. import { CodegenScope } from '../options';
  4. import { TransformContext } from '../transform';
  5. export declare const ATTR_VUE_ID = "u-i";
  6. export declare const ATTR_VUE_SLOTS = "u-s";
  7. export declare const ATTR_VUE_PROPS = "u-p";
  8. export declare const ATTR_VUE_REF: string;
  9. export declare const ATTR_VUE_REF_IN_FOR: string;
  10. export declare const ATTR_COM_TYPE = "u-t";
  11. export declare const SCOPED_SLOT_IDENTIFIER = "__SCOPED_SLOT__";
  12. export declare const VIRTUAL_HOST_STYLE = "virtualHostStyle";
  13. export declare const VIRTUAL_HOST_CLASS = "virtualHostClass";
  14. export declare function rewriteSpreadElement(name: symbol, expr: SpreadElement, loc: SourceLocation, context: TransformContext): Identifier | MemberExpression | undefined;
  15. export declare function rewirteWithHelper(name: symbol, expr: Expression, loc: SourceLocation, context: TransformContext): Identifier | MemberExpression | undefined;
  16. export declare function parseExprWithRewrite(code: string, loc: SourceLocation, context: TransformContext, node?: Expression): Identifier | MemberExpression | undefined;
  17. export declare function parseExprWithRewriteClass(code: string, loc: SourceLocation, context: TransformContext, node: Expression): Identifier | MemberExpression | undefined;
  18. export declare function rewriteExpressionWithoutProperty(node: ExpressionNode, context: TransformContext, babelNode?: Expression, scope?: CodegenScope): SimpleExpressionNode;
  19. export declare function rewriteExpression(node: ExpressionNode, context: TransformContext | VueTransformContext, babelNode?: Expression, scope?: CodegenScope, { property, ignoreLiteral, referencedScope, }?: {
  20. property: boolean;
  21. ignoreLiteral: boolean;
  22. referencedScope?: CodegenScope;
  23. }): SimpleExpressionNode;
  24. export declare function findReferencedScope(node: Expression, scope: CodegenScope, findReferenced?: boolean): CodegenScope;
  25. export declare function isReferencedByIds(node: Expression, knownIds: string[]): boolean;
  26. export declare function isStaticLiteral(value: object | null | undefined): boolean;
  27. export declare function removeAttribute(node: ElementNode, name: string): void;