-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
======================================
Coverage 92.3% 92.3%
======================================
Files 11 11
Lines 143 143
Branches 40 40
======================================
Hits 132 132
Misses 7 7
Partials 4 4 Continue to review full report at Codecov.
|
Thanks for this contribution! @luke-john has done a lot with Typescript over in paypal/glamorous, would you mind taking a look? I'm probably not the best to review this |
yes I think @luke-john is just the right person :), I used the paypal/glamorous typings as a basis to create thos for native |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are looking good to me.
It would be nice to have at least a simple test file which has a few of the common usage patterns covered.
Even if the file isn't part of any of the official tests, it should make it easier for additional maintainers/contributors to see what the intention is behind some of the typings.
ExternalProps & | ||
Partial<DefaultProps> & | ||
Omit<Props, 'theme'> & | ||
Props, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Props
was a bug in the glamorous typings
which has been fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this is missing ElementProps
(also recently fixed in glamorous)
This is awesome, really happy to see I wonder if we could share some of the typings across The easiest way would be to add glamorous as a dependency and these typings could import the common parts from there, but that's a pretty massive dependency just for the typings. Alternatively, and probably the better solution, would be to re-publishing the typings seperate to glamorous. I'm not likely to get time to look into getting this setup in the next week though, so I'd proceed with landing these typings as is 👍 . |
Hey Luke thank you for the feedback, would be really cool to have a common base for the typings. I will try to get some time to think about this, but the next weeks I am still pretty stuffed with work |
Hi, I'd like to test these typings but I'm having hard time figuring out how to add these to my project so that TS would pick them up for I tried creating Could someone point me to right direction? Thanks. |
Aiming to merge this up! @kaoDev any insight on the above if any changes are needed in this PR? |
Unfortunately the way typescript handles definitions under
|
hi @epeli,
I hope this is helpful and you can test the typings 😄 @luke-john was faster, that's another possibility |
Yeah I tried that too with no luck but your writeup seems good, thanks! I'll post here if I find something strange. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, sorry it took a little while to get in!
No worries. Thanks for this! Didn't find anything unusual during my testing btw. |
Now I did. There is a definition for |
ah, thanks for the report. I will try to find some time today to make a PR for this bad copy pasta |
How about usage of I'm trying make an animated image const Character = g(Animated.Image)({
height: 270,
resizeMode: "contain",
width: "100%",
});
Character.propsAreStyleOverrides = true; // type error
<Character
source={imageSource}
top={animatedValue} // type error
I think this is workaroundable with some clever type assertion but I didn't figure out that yet. But in the end I'd like to see some other API for this which would be better fit for typed languages (ts&flow). |
@epeli, assuming glamorous-native supports I've added a comment to the issue created by @ajwhite about what would be needed to bring that typing support natively to const propsAreCssOverrides = {propsAreCssOverrides: true as false}
const Character = g(Animated.Image, propsAreCssOverrides)({
height: 270,
resizeMode: "contain",
width: "100%",
}); |
Nope
The |
Hey all. I'm not using typescript, but it seems typescript definitions are useful for my Intellij/Webstorm IDE in many cases where it can't infer proper types. In this lib I constantly get failing imports on Glamorous-native, does anyone know how to add support for it in Intellij? I tried to download the typings but for this lib it does not appear in the download list (probably because they are not published?) Also tried to setup the bindings manually but I failed (not sure exactly how to do that) |
Hey,
I used glamorous-native in a Typescript project and wanted to contribute my declaration files so that other Typescript projects can benefit.
Greetings
Kalle