Describing a mongoose model with sub-document in typescript
<p>Hi I am new to Typescript and I am trying to describe a mongoose model with a subdocument in typescript.</p>

<p>So if I have a sample model below:</p>

<pre><code>var mongoose = require("mongoose");

var ResponseItemSchema = new mongoose.Schema({
    question : String,
    questionChoice : [String],
    choiceType: String,
    hidden  : Boolean,
    adLogic : { skipTo: String, skipOn: String}
});



var AdInstanceSchema  = new mongoose.Schema({  
  adMsg   : {type: String, required: true},
  responseSet : [ResponseItemSchema],
  modified_dt: { type: Date, default: Date.now },
  created_dt: Date
});

var CustomerAdSchema  = new mongoose.Schema({  
  customerId   : {type: mongoose.Schema.Types.ObjectId,
                 ref: 'CustomerSchema', required: true},
  adName  : {type: String, rquired: true, index:true},
  ad :    [AdInstanceSchema],
  msg : {type: String, default: 'Thankyou.'},
  modified_dt: { type: Date, default: Date.now },
  created_dt: Date
});
</code></pre>

<p>I understand how to do this when a mode has no subdocuments.
How would  I describe this as a typescipt class?</p>