TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Can we add an API for generating declare modules? My code now: ```ts const sourceFile = project.createSourceFile(/*...*/) // some code... sourceFile.insertText( sourceFile.getEnd(), ` declare global { declare const __DEV__: boolean; declare const __EDITOR__: boolean; declare const PW: PW; interface Window { require: (name: string) => unknown; PW: PW; } } ` ); ``` My preferred usage: ```ts const dm = sourceFile.addGlobalDeclare({ // more options }) ``` If the idea is deemed viable, I would happily pull a request.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by peterroe and has received 0 comments.