Skip to content
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

Merged
merged 8 commits into from
Feb 15, 2022

Conversation

Uzlopak
Copy link
Collaborator

@Uzlopak Uzlopak commented Feb 9, 2022

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

@Uzlopak Uzlopak changed the title WIP: extract PipelineStage typings from index.d.ts Extract PipelineStage typings from index.d.ts Feb 9, 2022
@@ -1,3 +1,5 @@
/// <reference path="./PipelineStage.d.ts" />
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants