mongojs
mongojs copied to clipboard
TypeScript type definitions
Hiya,
It would be extremely useful if one could import mongojs in a native typescript way, i.e. import * as mongojs from 'mongojs', however, a type definition file is not available on DefinitelyTyped (yet).
I am aware that there is a project called mongots, but that does not seem very active.
Thoughts?
Cheers
Definitely interesting - but we'll need the one that creates the typescript file :smile:
Haha, understood. Will try to carve out time to do it.
Hey guys,
I started by drafting a Database.d.ts. See this Gist.
The problem is that there are no JSDoc comments in the lib-folder files. Therefore it is sometimes hard to tell:
-
What the expected patterns for callback parameters are?
-
Which function parameters are required and which can be omitted?
-
What do some of the
optionsparameters look like?
Also for example if I look up the database.close() documentation in the current README.md it states:
db.close()
But the code actually looks like:
function (force, cb)
So with a little more information I would be happy to finish the task. I also would suggest to include the types into the mongojs project itself instead of putting them into DefinitelyTyped, but this is just a suggestion.
Also a general question, is this repo still being maintained?
Repo is maintained, my reaction time sometimes a bit high 😢
Will merge a PR with the typescript definitions file. Your starting gist looks good - we can polish the API during the PR or after merging the PR if that's ok?
@Kaesebrot84 I see the gist is gone.
Does anyone have a copy of the type definitions? I see its not on Definitely Typed yet either.
Any updates on this? Gist is MIA and i dont see any PR for this.
I am very sorry but I accidentally deleted the gist. I contacted github support about this issue and will keep you updated on this topic.
Seems like they are unable to recover it.
Hey, any updates on typescript definitions?
Hey, any updates on typescript definitions?
I have switched to the mongodb package instead. It has types and full documentation.
ok