Maps: Fix typescript index.d.ts

Created on 18 Jun 2019  路  6Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
Many definitions are missing in index.d.ts.

Screenshots
If applicable, add screenshots to help explain your problem.
Capture d鈥檈虂cran 2019-06-18 a虁 17 08 43
Capture d鈥檈虂cran 2019-06-18 a虁 17 09 30

Most helpful comment

There are many more inconsistencies, especially regarding MapView and Camera. I am working on a PR that should fix many of them

All 6 comments

Have the same issue, and haven't the time to create a proper pull request, but I quickly slapped together the types for Camera at least. You can temporary add a file in your @types directory (e.g. ./@types/@react-native-mapbox-gl/index.d.ts), with the contents of the gist. Perhaps later I'll get back to creating the actual pull request, but it seems as though Camera is still under under heavy development.

See gist here:
https://gist.github.com/Hless/8c50c8b1b72d41e466a46e283c1dc3d6

Update:
I do realise that the instance methods of the Camera component are missing, just mapped the props for the time being

I have also found an inconsistency between documentation and index.d.ts regarding VectorSourceProps.
Screenshot 2019-06-26 at 13 44 56
Screenshot 2019-06-26 at 13 45 01

Also StyleSheet typings. The _create_ method should return an object not void.

There are many more inconsistencies, especially regarding MapView and Camera. I am working on a PR that should fix many of them

Some of these issues are fixed and merged by https://github.com/react-native-mapbox-gl/maps/pull/230. Some props and classes are still missing though. UserLocationProps is for instance missing the onPress prop as you have in your example.

I guess the original issue that geoUtils is not declared in index.d.ts is still not fixed. Am I right?

Was this page helpful?
0 / 5 - 0 ratings