title: Typescript - NodeJS - Mongoose
body: <p>I've just started using typescript for NodeJS Server development and I've run into the following errors:</p>
  
  <pre><code>./app/api/shoutbox/shoutbox.dao.ts
  error TS2339: Property 'statics' does not exist on type 'Schema'
  
  ./app/api/shoutbox/shoutbox.controller.ts
  error TS2339: Property 'getAll' does not exist on type 'Model&lt;Document&gt;'.
  
  ./app/api/shoutbox/shoutbox.controller.ts
  error TS2339: Property 'catch' does not exist on type 'Promise&lt;{}&gt;'.
  </code></pre>
  
  <p>I am using Webpack and TS-Loader. And I've referenced</p>
  
  <pre><code>/// &lt;reference path="mongoose/mongoose.d.ts" /&gt;
  /// &lt;reference path="node/node.d.ts" /&gt;
  /// &lt;reference path="express/express.d.ts" /&gt;
  /// &lt;reference path="mime/mime.d.ts" /&gt;
  /// &lt;reference path="serve-static/serve-static.d.ts" /&gt;
  /// &lt;reference path="lodash/lodash.d.ts" /&gt;
  /// &lt;reference path="bluebird/bluebird.d.ts" /&gt;
  
  
  
  // shoutbox.model.ts
  import mongoose = require('mongoose'); 
  var _shoutboxSchema = {
      author: {
          type: String,
          required: true
      },
      created: {
          type: Date,
          default: Date.now
       },
       msg: String
  };
  export default new mongoose.Schema(_shoutboxSchema);
  
  
  // shoutbox.dao.ts
  import mongoose = require('mongoose');
  import Promise = require('bluebird');
  import _ = require('lodash');
  import shoutboxSchema from './shoutbox.model';
  
  shoutboxSchema.statics.getAll = ():Promise&lt;any&gt; =&gt; {
      var _promise = (resolve:Function, reject:Function):void =&gt; {
          var _query = {};
          Shoutbox
               .find(_query)
               .exec((err, shoutbox) =&gt; {
                  err ? reject(err)
                      : resolve(shoutbox);
               });
      };
      return new Promise (_promise);
  };
  var Shoutbox = mongoose.model('Shoutbox', shoutboxSchema);
  export default Shoutbox;
  
  // shoutbox.controller.ts
  import ShoutboxDAO from './shoutbox.dao';
  import express = require("express");
  
  export class ShoutboxController {
      static  getAll(req:express.Request, res:express.Response):void {
           ShoutboxDAO
              .getAll()
              .then(shoutbox =&gt; res.status(200).json(shoutbox))
              .catch(error =&gt; res.status(400).json(error));
      }
  }
  </code></pre>
  
  <p>I've tried around for quite some time now but i cant get rid of the errors. </p>
  
  <p>The code itself runs as intended but i keep getting these errors.</p>
  
  <p>Im thankful for any sort of help.</p>