MCPcopy
hub / github.com/compodoc/compodoc / parseIndexFile

Method parseIndexFile

src/utils/public-api-parser.util.ts:74–94  ·  view source on GitHub ↗

* Parse a single index.d.ts file and extract its exports

(indexFilePath: string)

Source from the content-addressed store, hash-verified

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

Callers 2

parseIndexFilesMethod · 0.95
processReExportAllMethod · 0.95

Calls 3

processStatementMethod · 0.95
addMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected