-
Notifications
You must be signed in to change notification settings - Fork 156
add typings! #53
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 typings! #53
Conversation
codecov-io
commented
Apr 1, 2019
Codecov Report
Merging #53 into master will not change coverage.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #53 +/- ## ======================================= Coverage 91.75% 91.75% ======================================= Files 26 26 Lines 279 279 Branches 46 46 ======================================= Hits 256 256 Misses 18 18 Partials 5 5
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update 8b23a86...c8ae37e. Read the comment docs.
@ricokahler Thanks, appreciate the contribution and explanations -- very helpful!
Assuming the index.d.ts will need to be published with package? And/or additional files?
The entire src isn't published currently, only the following files/folders - see here
I'd like to setup a simple React TypeScript project and try it out so that I'm more familiar with the process. Other than that this is looking good!
@jscottsmith oh yes the index.d.ts file should be published along side the index.js file of the library. I forgot about that!
I'd like to setup a simple React TypeScript project and try it out so that I'm more familiar with the process.
Let me know if you need any help or if you think publishing to @types is better
@ricokahler really appreciate the PR -- merged these changes with #55 and published in v2.0.6
Here you go!
Here are some typings to your amazing library ❤️
Some info:
index.d.ts. There are other approaches to this (e.g. ambient typing files next to the file) but this seems to be the best way to do it and maintain it given your project structure.withControllerHOC. HOC typings are a bit more complex than normal component because the HOC needs to capture the incoming props, ensure they satisfy the props being injected, and also remove those props from the external API for the component. The rest of the typings are untested because they are more declarative.Things to consider:
@types/mono repo where the community maintains the types for you.Let me know if you have any questions and thanks again for the great library!