Skip to content

fix(index.d.ts): allow 2 generic types in mongoose.model function #9685

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

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

synsh
Copy link
Contributor

@synsh synsh commented Dec 8, 2020

fixes #9678

@icopp
Copy link

icopp commented Dec 9, 2020

From my testing with something similar on an existing codebase, it looks like there may still be some issues here with methods like create, which will expect that the methods from the statics are included on the supplied object. Fixing it may take changing the Model definition to directly accommodate statics as a generic type param which create and the like can then exclude.

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@vkarpov15 vkarpov15 added this to the 5.11.6 milestone Dec 9, 2020
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Dec 9, 2020
@vkarpov15 vkarpov15 merged commit 7a52e45 into Automattic:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to define types of statics with mongoose 5.11 ?
3 participants