-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
declaration file for DefinitelyTyped #56
Comments
Good point! I would appreciate if someone help with it. |
alright I will try to come up with something |
@mauricekraus thank you! 👍 |
Hi, Just put this together which is working for me: declare module 'react-native-extended-stylesheet' {
function value(expr: any, prop?: string): any;
function create(obj: Object): any;
function build(rawGlobalVars: any): void;
} |
Hi, for now you can use this:
|
Here is a similar approach to 'react-native-stylesheet' which works well for me.
|
Due to having a lot of variables and media queries, I added some stuff
|
Nice idea, but if i wanted to add a style like this: Unless there's a way of allowing any string key type? |
You should be able to do it like so:
|
I originally tried that, but it doesn't work. I'm unsure why |
Ideally only keys starting with |
Writing full strict declaration file for Extended StyleSheets looks to be a tricky (impossible?) task,
Moreover all these keys are optionally merged into a single object. I've tried to adopt @stochris's idea to make an universal declaration. But with no luck. It seems you anyway need to enumerate all used Finally I've added a rather loose declaration file (similar to @juliusspencer's solution). If you have any idea how to improve the declaration - feel free to comment or send a pr. |
Thanks a lot for the help @vitalets |
Would it be possible to deliver a TypeScript type definitions file, for those people how use react-native with typescript
The text was updated successfully, but these errors were encountered: