Open peterroe opened 3 months ago
Can we add an API for generating declare modules?
My code now:
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:
const dm = sourceFile.addGlobalDeclare({ // more options })
If the idea is deemed viable, I would happily pull a request.
Can we add an API for generating declare modules?
My code now:
My preferred usage:
If the idea is deemed viable, I would happily pull a request.