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

types(schematypes): use DocType for instance method this #13822

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

pshaddel
Copy link
Contributor

@pshaddel pshaddel commented Sep 4, 2023

Fixes this issue: #13800

@pshaddel
Copy link
Contributor Author

pshaddel commented Sep 4, 2023

Right now instance method names does not have a typing(also the function we are passing) when user is passing InstanceMethod type. Let me know if I need to implement this too.

@ozzyonfire
Copy link

This looks great. Thanks for implementing it so quickly. I'm wondering if "this" should also expose the methods of a HydratedDocument. Like for example, "populate".

There are a couple times I call this.populate('item') or something similar inside my instance method. And right now Typescript doesn't like that.

@pshaddel
Copy link
Contributor Author

pshaddel commented Sep 5, 2023

Thanks for pointing that out. Just changed it to HydratedDocument.

@pshaddel
Copy link
Contributor Author

pshaddel commented Sep 5, 2023

I have pushed a new commit to fix the typescript failing test.

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 7.5.1 milestone Sep 8, 2023
@vkarpov15 vkarpov15 merged commit 8df3699 into Automattic:master Sep 8, 2023
3 checks passed
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.

None yet

3 participants