UNPKG

@dkoul/auto-testid-core

Version:

Core AST parsing and transformation logic for React and Vue.js attribute generation

20 lines 891 B
import * as t from '@babel/types'; import { Parser, ParseResult, TransformResult, Transformation } from '../index'; export declare class ReactParser implements Parser { private logger; canParse(filePath: string): boolean; parse(content: string, filePath: string): ParseResult; transform(content: string, transformations: Transformation[]): TransformResult; private extractElementFromJSX; private extractElementsFromFragment; private extractExpressionValue; private getPositionFromPath; private applyTransformationToJSX; serialize(ast: t.Node): string; static containsJSX(content: string): boolean; static isTypeScript(filePath: string): boolean; extractComponentName(content: string, filePath: string): string | null; private isReactComponent; } export declare const reactParser: ReactParser; //# sourceMappingURL=react-parser.d.ts.map