-
Notifications
You must be signed in to change notification settings - Fork 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 TypeScript definitions #16
Add TypeScript definitions #16
Conversation
Hi @franky47 I just wanted to give you a heads up that there's some issue with those typings. Here's an example which is not working for me: ${media.greaterThan('xl')`
position: fixed;
top: 50%; left: 0;
${size('100vh')} // <--- TS error here
`} TypeScript error:
|
Interesting, I can't replicate that error, do you have a link to a project I can clone to take a look ? |
Sure, I'll create reproduction repository for you later. Btw, I am using Typescript 3.2.2 |
@franky47 Thank you so much for the PR! 😍 One question, have you tested it in a TS project yourself? As currently, I don't have a TS React project myself. |
@franky47 Here's the repo - https://github.com/sqal/styled-media-query-types-bug |
- Upgrade TypeScript version to 3.3.3 - Update styled-media-query targeted version - Indicate dependency on @types/styled-components^4.1
311913d
to
d29dfbd
Compare
@sqal thanks, it should work now. |
can this be merged? |
Great work on these, are they ready to be merged? would love to have them in the package rather than in my custom typings. |
when will this be released :) ? |
@JClackett Published! Could you please try it and let me know? 🙌✨ |
working! 👍 Thanks |
Relates to issue #3.
Brings the following TypeScript features:
import media from 'styled-media-query'
in a TypeScript filestyled-components
to default or custommedia
objectI'll edit this message with the usage API for documentation once the depending PRs (#14, #15 and DefinitelyTyped#30511) have been merged.