/** * AST parser for JavaScript/TypeScript files * Extracts string literals containing Persian/Arabic text using Babel */ import { TextMatch } from '../types'; export interface ASTParseOptions { sourceType?: 'module' | 'script'; allowImportExportEverywhere?: boolean; allowReturnOutsideFunction?: boolean; plugins?: string[]; } export interface StringLiteralMatch extends TextMatch { nodeType: 'StringLiteral' | 'TemplateLiteral' | 'JSXText' | 'JSXAttribute'; parentType?: string; isInFunction?: boolean; isInObject?: boolean; objectKey?: string; } /** * AST Parser for extracting Persian/Arabic text from JavaScript/TypeScript files */ export declare class ASTParser { private options; constructor(options?: ASTParseOptions); /** * Parse JavaScript/TypeScript content and extract Persian/Arabic strings */ parseContent(content: string, filePath: string): Promise; /** * Create a TextMatch object from AST node information */ private createMatch; /** * Check if the node is inside a function */ private isInsideFunction; /** * Check if the node is inside an object */ private isInsideObject; /** * Get the object key if the node is inside an object property */ private getObjectKey; /** * Parse multiple files and return combined results */ parseFiles(files: Array<{ path: string; content: string; }>): Promise; /** * Get parser configuration for different file types */ static getParserOptions(filePath: string): ASTParseOptions; /** * Check if a file should be parsed by this parser */ static canParseFile(filePath: string): boolean; } /** * Utility functions for AST parsing */ export declare class ASTParserUtils { /** * Extract all string concatenations that might contain Persian/Arabic text */ static extractConcatenatedStrings(content: string, filePath: string): StringLiteralMatch[]; /** * Extract text from string concatenation expressions */ private static extractConcatenationText; /** * Get string value from various node types */ private static getStringValue; } export default ASTParser; //# sourceMappingURL=ast-parser.d.ts.map