Closed shivshankar3578 closed 3 years ago
Hey, I completely agree! The way the tool works, it reads in Mongoose schemas into memory (same way your app would) and infers types from the schema data. The only type we can get from that is Function
(since TS has already been transpiled at this point).
ts-morph seems like a solid option for reading the Typescript info. I can take a look at this but it likely won't be for a couple weeks, you're welcome to contribute in the meantime!
As per example https://github.com/Bounced-Inc/mongoose-tsgen#example piece of generated definition
isMetadataString: Function;
should be valid signature of isMetadataString methodisMetadataString: (this: IUser) => Boolean