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. #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

janstrohbeck
Copy link

This adds a definition file for easier integration with Typescript projects.

@idibidiart
Copy link
Owner

Thanks for this and sorry for the delay. I haven't worked on this for some months. I've just made a fix to one of the PropTypes definitions, so I'll have to fix it in your PR and include it.

I've made major enhancements including introduction of a stateful and optional Grid root for better abstraction around layout state and just made this demo here: https://www.youtube.com/watch?v=QyIRoKinyLU (source code linked in Readme)

Given I've not used TypeScript, is there anything I have to do (in package.json or otherwise) besides including the definition file in the root folder?

@janstrohbeck
Copy link
Author

janstrohbeck commented Nov 22, 2017

Yes, you need to add a "types" entry in package.json (like in my commit), as well as add @types/react and @types/react-native to dependencies (which I forgot in my original commit). Should I rebase my PR to the latest master and make those additions?

@idibidiart
Copy link
Owner

Yes, please. That would be awesome! Thank you. Will add Contributors.md later today..

@janstrohbeck
Copy link
Author

Ok, I updated the definition file to the one that I use in my project. I added the Grid component and the necessary dependencies. I also added some props that I think are missing in the PropTypes, like size and sizePoints at the Row component. Is that correct? They are mentioned in the Readme file, but not validated via PropTypes...
If they should be in the PropTypes, I can also add them in this PR.

Also added dependencies to type definitions of react and react-native.
@idibidiart
Copy link
Owner

@janstrohbeck

Row is actually missing more of those

{
size,
smSize,
mdSize,
lgSize,
xlSize,
sizePoints,
smSizePoints,
mdSizePoints,        
lgSizePoints,
xlSizePoints,
}

All of these are valid and need to have corresponding PropTypes. Thank you for noticing that.

So, yes, would be great to add this list of props to the PR.

One note on the original PR, there was an issue #11 in the PropTypes for Row component, and I'm not sure that got incorporated in your latest.

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

2 participants