Script generates typescript interfaces with all properties from mongoose models.
npm install mon2ts --save
//get generator script
let m2t = require('mon2ts');
//get mongoose model
let model = require('./models/MyModel');
//generate typescript interface as string
let str = m2t(model);
//save the string as .ts somewhere you need it
Script automatically generates import statements for referred models & additional interfaces for nested objects. Accepted type for referred mongoose model is either id or populated interface.