mongojs icon indicating copy to clipboard operation
mongojs copied to clipboard

TypeScript type definitions

Open aberenyi opened this issue 9 years ago • 11 comments

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

aberenyi avatar Jan 11 '16 10:01 aberenyi

Definitely interesting - but we'll need the one that creates the typescript file :smile:

saintedlama avatar Jan 14 '16 13:01 saintedlama

Haha, understood. Will try to carve out time to do it.

aberenyi avatar Jan 14 '16 14:01 aberenyi

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 options parameters 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?

Kaesebrot84 avatar Feb 02 '18 09:02 Kaesebrot84

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?

saintedlama avatar Mar 23 '18 14:03 saintedlama

@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.

rvdende avatar Feb 24 '20 10:02 rvdende

Any updates on this? Gist is MIA and i dont see any PR for this.

Deph0 avatar Apr 06 '20 18:04 Deph0

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.

Kaesebrot84 avatar Apr 08 '20 13:04 Kaesebrot84

Seems like they are unable to recover it.

Kaesebrot84 avatar Apr 09 '20 13:04 Kaesebrot84

Hey, any updates on typescript definitions?

TheCodedProf avatar Jan 25 '21 21:01 TheCodedProf

Hey, any updates on typescript definitions?

I have switched to the mongodb package instead. It has types and full documentation.

rvdende avatar Jan 26 '21 05:01 rvdende

ok

TheCodedProf avatar Jan 26 '21 16:01 TheCodedProf