<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest <code class="notranslate">mongoose/mongoose.d.ts</code> file in this repo and had problems.
<ul dir="auto">
<li>The authors of that type definition are <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/simonxca/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/simonxca">@simonxca</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165219198" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10084" data-hovercard-type="pull_request" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/pull/10084/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/10084">#10084</a>.</li>
</ul>
</li>
</ul>
<p dir="auto">Basically this broke my use of mongoose. Not that I am sure I was using it correctly as I'm a bit of a novice in this TS/JS realm.</p>
<p dir="auto">Snippet:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{...}
interface Location extends mongoose.Document {
  name: string;
  address: string;
  rating: number;
  facilities: string[];
  coords: number[];
  openingTimes: any[];
  reviews: any[];
};
const locationSchema = new mongoose.Schema({
  name: { type: String, required: true },
  address: String,
  rating: { type: Number, &quot;default&quot;: 0, min: 0, max: 5 },
  facilities: [String],
  coords: { type: [Number], index: &quot;2dsphere&quot; },
  openingTimes: [openingTimeSchema],
  reviews: [reviewSchema]
});

mongoose.model&lt;Location&gt;(&quot;Location&quot;, locationSchema);
{...}"><pre class="notranslate"><code class="notranslate">{...}
interface Location extends mongoose.Document {
  name: string;
  address: string;
  rating: number;
  facilities: string[];
  coords: number[];
  openingTimes: any[];
  reviews: any[];
};
const locationSchema = new mongoose.Schema({
  name: { type: String, required: true },
  address: String,
  rating: { type: Number, "default": 0, min: 0, max: 5 },
  facilities: [String],
  coords: { type: [Number], index: "2dsphere" },
  openingTimes: [openingTimeSchema],
  reviews: [reviewSchema]
});

mongoose.model&lt;Location&gt;("Location", locationSchema);
{...}
</code></pre></div>
<p dir="auto">So I can no longer specify the interface with additional properties within &lt;&gt;.</p>
<blockquote>
<p dir="auto">Supplied parameters do not match the signature of the call target.</p>
</blockquote>
<p dir="auto">Simplifying to:</p>
<p dir="auto"><code class="notranslate">mongoose.model("Location", locationSchema);</code></p>
<p dir="auto">Works of course, but now in my controllers when executing a query and explicitly trying to access a property of a document TS is unaware of the additional properties on a document.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="loc
    .findById(req.params.locationid)
    .select(&quot;-reviews -rating&quot;)
    .exec(
      (err, location) =&gt; {
        if (!location) {
          sendJsonResponse(res, 404, {
            &quot;message&quot;: &quot;locationid not found&quot;
          });
          return;
        } else if (err) {
          sendJsonResponse(res, 400, err);
          return;
        }
        location.name = req.body.name;
        location.address = req.body.address;
{...}"><pre class="notranslate"><code class="notranslate">loc
    .findById(req.params.locationid)
    .select("-reviews -rating")
    .exec(
      (err, location) =&gt; {
        if (!location) {
          sendJsonResponse(res, 404, {
            "message": "locationid not found"
          });
          return;
        } else if (err) {
          sendJsonResponse(res, 400, err);
          return;
        }
        location.name = req.body.name;
        location.address = req.body.address;
{...}
</code></pre></div>
<blockquote>
<p dir="auto">Property 'name' does not exist on type '_Model &amp; EventEmitter'.</p>
</blockquote>
<p dir="auto">Then I thought perhaps creating a class that extends mongoose and implements my interface would work, but then I have to provide an implementation for everything in my interface and mongoose.Document. That seems kind of asinine so I figure I must be missing the most obvious way to do this.</p>
<p dir="auto">Thoughts?</p>
<p dir="auto">If you know how to fix the issue, make a pull request instead.</p>
<ul dir="auto">
<li>[x ] I tried using the <code class="notranslate">@types/xxxx</code> package and had problems.</li>
<li>[ x] I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li>[ x] <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/horiuchi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/horiuchi">@horiuchi</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/enaeseth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/enaeseth">@enaeseth</a></li>
</ul>
</li>
</ul>
<p dir="auto">Hi guys...With the last update of <code class="notranslate">@types/passport@0.3.5</code>, when we execute tsc -p tsconfig.json, we got some typescript error on the index.d.ts comming from your module (<code class="notranslate">@types/passport</code> &amp;&amp; <code class="notranslate">@types/passport-http</code>).</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15614466/32079381-69c5e18c-ba78-11e7-85f3-bd892f7b41d2.png"><img src="https://user-images.githubusercontent.com/15614466/32079381-69c5e18c-ba78-11e7-85f3-bd892f7b41d2.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">This issue breaks unfortunetly our continuous integration. Would you please fix this issue and publish a new version of these typed definition ?</p>
<p dir="auto">Thank you in advance for your answers and help.</p>