* Parse a single index.d.ts file and extract its exports
(indexFilePath: string)
| 72 | * Parse a single index.d.ts file and extract its exports |
| 73 | */ |
| 74 | private async parseIndexFile(indexFilePath: string): Promise<void> { |
| 75 | if (this.processedFiles.has(indexFilePath)) { |
| 76 | return; // Avoid circular dependencies |
| 77 | } |
| 78 | this.processedFiles.add(indexFilePath); |
| 79 | |
| 80 | logger.debug(`Parsing index file: ${indexFilePath}`); |
| 81 | |
| 82 | const sourceText = fs.readFileSync(indexFilePath, 'utf-8'); |
| 83 | const sourceFile = ts.createSourceFile( |
| 84 | indexFilePath, |
| 85 | sourceText, |
| 86 | ts.ScriptTarget.Latest, |
| 87 | true |
| 88 | ); |
| 89 | |
| 90 | // Process all top-level statements in the file |
| 91 | for (const statement of sourceFile.statements) { |
| 92 | await this.processStatement(statement, indexFilePath); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Process a TypeScript statement to extract exports |
no test coverage detected