dtsgenerator
dtsgenerator copied to clipboard
Move this project and generate result to ESM
There's one big problem.
- We need to remove
namespacefrom the generated results. In that case, how do we guarantee the uniqueness of the output type names?
via. https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm
One easy option would be to prefix every type / interface name with the namespace name. So for example
namespace Responses {
export type BadRequest = any;
}
becomes
export type ResponsesBadRequest = any;
That would not necessarly guarantee uniquenesss but should work for most setups.
Thanks for the good ideas. 👍 The name will be much longer, but I think I can guarantee uniqueness.