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

Improving the JSDoc types and generating a declaration file #17

Closed
johnhooks opened this issue Mar 8, 2023 · 2 comments · Fixed by #18
Closed

Improving the JSDoc types and generating a declaration file #17

johnhooks opened this issue Mar 8, 2023 · 2 comments · Fixed by #18

Comments

@johnhooks
Copy link
Contributor

I am working to throughly type @wordpress/blocks and hpq is a dependency of that package. I wanted to open the discussion on how best to improve the types produced by hpq.

There are a few options:

  • Improve the types in the current JSDocs and generate a declaration file using TypeScript
  • Move the package to TypeScript
  • Publish a type declaration to DefinitelyTyped. This is my least favorite option, splitting the types from the source creates a difficult to maintain system where the types can get out of sync with the package.

I can do the work to integrate this, but I want to make sure there is interest before working on it.

@aduth
Copy link
Owner

aduth commented Mar 12, 2023

Hi, thanks for the suggestion! I think it’d be great to add some first-party types. Personally, I’d prefer the JSDoc route, to have more control over the output package size, and since most of the work is already done (though I think there are a few issues in the existing type annotations that should be fixed up). If you’re willing to help with that, I’d really appreciate it. Otherwise I can plan to take a look at it in the next week or two.

@johnhooks
Copy link
Contributor Author

Thanks for the response. I'll put a PR together using JSDocs.

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 a pull request may close this issue.

2 participants