mikehardy / react-native-update-apk

Update apk from non-play store servers, and update ios from app store in React Native.
MIT License
195 stars 57 forks source link

Typescript support #38

Closed pdlm95 closed 3 years ago

pdlm95 commented 3 years ago

Hi! Could be possible to add support for typescript? Tried to use the library and @types weren't found

mikehardy commented 3 years ago

PRs happily merged!

I personally use this in a typescript project but just never cooked up typings for it (honestly the API is ...really ugly so I admit I did not want to increase the ugliness, but that's not really a good reason)

I just have this for my project in order to use it, which works and may get you moving but is of course a complete subversion of typing:

mike@isabela:~/work/Kullki/ksocialscore/packages/public-app (rebranding) % cat src/@types/rn-update-apk/index.d.ts 
declare module 'rn-update-apk';
pdlm95 commented 3 years ago

I'm sorry but I don't quite understand. Do I need to create the index.d.ts file with the declare module line inside?

mikehardy commented 3 years ago

Yes - exactly that

https://stackoverflow.com/questions/43529328/how-to-use-an-node-module-without-typings-from-typescript

closing this since it will get you moving forward - but as mentioned I will be happy to merge a types PR if you (or anyone else reading this) proposes one

ScreamZ commented 1 year ago

https://github.com/mikehardy/react-native-update-apk/pull/80