Trying to implement a Mongoose model in Typescript. Scouring the Google has revealed only a hybrid approach (combining JS and TS). How would one go about implementing the
For anyone looking for a solution for existing Mongoose projects:
We recently built mongoose-tsgen to address this issue (would love some feedback!). Existing solutions like typegoose required rewriting our entire schemas and introduced various incompatibilities. mongoose-tsgen is a simple CLI tool which generates an index.d.ts file containing Typescript interfaces for all your Mongoose schemas; it requires little to no configuration and integrates very smoothly with any Typescript project.