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

Add TypeScript definition file #75

Closed
wants to merge 1 commit into from

Conversation

stevenschmatz
Copy link

Hey there! First, thank you for maintaining this great library. I wanted to contribute some types and documentation to make this library easier to use for TypeScript folks.

Side note: I saw that there was another PR for adding a definition file, not sure if you want me to commit some of this over there or not. Thanks!

@hashicorp-cla
Copy link

hashicorp-cla commented Dec 16, 2020

CLA assistant check
All committers have signed the CLA.

@jescalan
Copy link
Collaborator

This is amazing, thank you @stevenschmatz !

@digitaljohn
Copy link

Hi! Great work. What's the ETA on this?

@jescalan
Copy link
Collaborator

I have to pull it down and test it pretty thoroughly locally, it will either be today or tomorrow or after the holiday break!

* For example: `{ ComponentName: Component }` will be accessible in the MDX as `<ComponentName/>`.
*/
components?: {
[componentName: string]: React.FunctionComponent | React.Component;
Copy link
Collaborator

Choose a reason for hiding this comment

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

When I was working on type definitions, I also found that I needed to specify this type in this way instead of just React.Element, but was confused about why. Do you have any further insight on this one?

@jescalan
Copy link
Collaborator

Ok, I pulled this down and ran it through some tests. It's a great start but needed a lot of work to get through mildly strict typescript settings. I ended up updating my own PR with additional typings - could you give that a look and let me know what you think?

#70

@jescalan
Copy link
Collaborator

Closing in favor of #70 - thank you for the contribution though! 💖

@jescalan jescalan closed this Dec 23, 2020
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.

4 participants