mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[google-maps-react] Fix InfoWindow Types (#41799)
* [google-maps-react] Fix InfoWindow Types * Bump TypeScript
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { GoogleAPI, Map, Marker, MapProps, GoogleApiWrapper } from 'google-maps-react';
|
||||
import { GoogleAPI, Map, Marker, MapProps, GoogleApiWrapper, InfoWindow } from 'google-maps-react';
|
||||
import * as React from 'react';
|
||||
|
||||
interface Location {
|
||||
@@ -56,7 +56,11 @@ class MapContainer extends React.Component<Props> {
|
||||
position={ hit._geoloc }
|
||||
title={ hit.title }
|
||||
key={ hit.id }
|
||||
/>;
|
||||
>
|
||||
<InfoWindow>
|
||||
<p>Test</p>
|
||||
</InfoWindow>
|
||||
</Marker>;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
12
types/google-maps-react/index.d.ts
vendored
12
types/google-maps-react/index.d.ts
vendored
@@ -2,8 +2,9 @@
|
||||
// Project: https://github.com/fullstackreact/google-maps-react#readme
|
||||
// Definitions by: Gordon Burgett <https://github.com/gburgett>
|
||||
// Justin Powell <https://github.com/jpowell>
|
||||
// Paito Anderson <https://github.com/PaitoAnderson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
import 'googlemaps';
|
||||
import * as React from 'react';
|
||||
@@ -103,12 +104,15 @@ export class HeatMap extends React.Component<any, any> {
|
||||
}
|
||||
|
||||
export interface InfoWindowProps extends Partial<google.maps.InfoWindowOptions> {
|
||||
google: typeof google;
|
||||
map: google.maps.Map;
|
||||
marker: google.maps.Marker;
|
||||
google?: typeof google;
|
||||
map?: google.maps.Map;
|
||||
marker?: google.maps.Marker;
|
||||
|
||||
mapCenter?: google.maps.LatLng | google.maps.LatLngLiteral;
|
||||
visible?: boolean;
|
||||
|
||||
onOpen?: () => void;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
export class InfoWindow<P extends InfoWindowProps = InfoWindowProps, S = any> extends React.Component<P, S> {
|
||||
|
||||
Reference in New Issue
Block a user