You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
current mongoose implementation is really permissive, and hard to extend properly. IMHO it would have to be refactored to account for the typesafety that TS provides, but it would be a breaking change. I'm interested in this as well, and would be willing to give it a try, create two typings, mongoose and mongoose-legacy
yeah, the promise.catch problem happened to me as well, and it's hard to extend the defined interfaces and classes in this typing. also most of the functions are missing their promise returns, like save(), populate(), execPopulate(), etc
had to manually edit the mongoose.d.ts to import bluebird to the typings file so I could use it in mongoose.Promise = Bluebird because there's no easy way around, extending the interfaces are useless
+1
Is there any work in progress on updating the mongoose.d.ts? Similar to @pocesar I ended up manually adding supplementary type definitions for MongooseArray and MongooseDocumentArray to use in model definitions, as they are completely missing from the current mongoose definition.
Activity
pocesar commentedon Jul 12, 2015
current mongoose implementation is really permissive, and hard to extend properly. IMHO it would have to be refactored to account for the typesafety that TS provides, but it would be a breaking change. I'm interested in this as well, and would be willing to give it a try, create two typings, mongoose and mongoose-legacy
davidlondono commentedon Sep 23, 2015
+1
aleh-op commentedon Oct 15, 2015
The guy who implemented previous version is not going to refactor it. I check his activity on github and he is absent for a long time.
So i think that, we should implement new version on our own.
dominikkukacka commentedon Jan 25, 2016
is there any news about this?
pocesar commentedon Jan 26, 2016
just like new lodash, I think this needs a joint task force. the new lodash (4.x) definitions are superb btw, hinting just works(tm) https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/lodash/lodash.d.ts
IMHO it's a benchmark of how good a typings definition is, being the highest tier
notice the "checkmarks" in header, it's a hacky (but clever) way to get this done and keep track of progress
stevehipwell commentedon Feb 17, 2016
Do you have any news? Promise is broken if you want to use catch, will this be fixed?
pocesar commentedon Mar 13, 2016
yeah, the promise.catch problem happened to me as well, and it's hard to extend the defined interfaces and classes in this typing. also most of the functions are missing their promise returns, like save(), populate(), execPopulate(), etc
had to manually edit the mongoose.d.ts to import bluebird to the typings file so I could use it in
mongoose.Promise = Bluebirdbecause there's no easy way around, extending the interfaces are uselesstomwanzek commentedon May 16, 2016
+1
Is there any work in progress on updating the mongoose.d.ts? Similar to @pocesar I ended up manually adding supplementary type definitions for MongooseArray and MongooseDocumentArray to use in model definitions, as they are completely missing from the current mongoose definition.
Also, this issue seems to overlap with #4262.
simon-xiong-ca commentedon Jul 4, 2016
Hey everyone, I've started working on an updated Definition for v4 here: https://github.com/simonxca/DefinitelyTyped/blob/mongoose4/mongoose/mongoose.d.ts
Still a long way to go, but I'm interested in suggestions on how to manage the breaking changes from v3 to v4.
Updates to Mongoose 4.5.x (DefinitelyTyped#10084)