正确的“ any”类型是什么?

时间:2019-09-25 17:59:17

标签: reactjs typescript google-maps frontend

我在代码库中使用了以下内容:

https://github.com/google-map-react/google-map-react

但是他们还没有解释map和map所使用的类型,这给了我打字错误。将其更改为对象并没有太大帮助。

const handleApiLoaded = (map: any, maps: any) => {

什么是正确的地图类型?谢谢。

2 个答案:

答案 0 :(得分:0)

对于本身不提供一流类型的包,DefinitelyTyped通常会像此处一样提供它们。安装@types/google-map-react软件包,您将收到正确的类型,代码完成和类型检查。

答案 1 :(得分:0)

这对我有用。谢谢

      map: google.maps.Map;
      maps: {
        LatLngBounds: new () => google.maps.LatLngBounds;
      };```
相关问题