lucasferreira / react-native-webview-android

Simple React Native Android module to use Android's WebView inside your app
355 stars 158 forks source link

Add TS typings to the lib #107

Open luisnaranjo733 opened 6 years ago

lucasferreira commented 6 years ago

Hi @luisnaranjo733

I do not work with TypeScript, could you help us with that issue and create a PR?

luisnaranjo733 commented 6 years ago

I don't want to commit to that because I'm not sure if I'm going to need to use a custom webview like this yet.

If anyone else wants to take a stab at it - there is a useful guide here.

lucasferreira commented 6 years ago

Hi @luisnaranjo733,

I do not want to convert all the package to TypeScript, it's not my main work language and I would be possible to do updates in a future.

Do you know if your suggestion "TS typings" could be some optional setup, that's works with or without TypeScript?

luisnaranjo733 commented 6 years ago

Sorry, I should have clarified.

Adding typings to a project means adding a typescript definitions (similar to header files in Obj-C). JS users can continue using their plan JS, and TS users can install the typings and get type safety when using this project.

For example, react-native is written in JS but its typings are maintained by the community so that TS users can get typings :)

For this project, it will likely be as simple as adding an index.d.ts file that declares the exported types of the module