-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract PipelineStage typings from index.d.ts #11368
Extract PipelineStage typings from index.d.ts #11368
Conversation
add tests for $addFields and $bucket
@@ -1,3 +1,5 @@ | |||
/// <reference path="./PipelineStage.d.ts" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I do like breaking up index.d.ts
into separate files, is it safe to rely on reference path
? This means that Mongoose wouldn't work in libs that use noResolve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, never used noResolve before in my TS projects.
As I read noResolve means that typings like node typings with triple Slash reference won't throw an error if we don't have the node typings installed in our project.
I am currently just on my phone. But we could check this by setting noResolve in tsd configuration. If it throws it is an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked it. It will break. But it would also break in mongoose 6.2.0 before we merged some of my improvements. So we can safely assume that this is not an actual issue. Also I think before somebody would use noResolve he would use skipLibCheck, which should do what you actually would like to do with noResolve.
If this satisfying your question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Uzlopak that makes sense, thanks for clarifying. I don't know enough about TypeScript to know whether anyone would actually use --noResolve
, but it looks like that enough typings in DefinitelyTyped use reference path
that anyone using noResolve will have a workaround. So I'll merge this 👍
Extracting typings from PipelineStage from index.d.ts
Started to use some of the examples from mongodb documentation for typings tests
Can be merged, we can add later more typing tests