mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Merge pull request #15426 from honzabrecka/google-map-react
Add types for google-map-react
This commit is contained in:
6
types/google-map-react/google-map-react-tests.tsx
Normal file
6
types/google-map-react/google-map-react-tests.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import GoogleMapReact from 'google-map-react';
|
||||
import * as React from 'react';
|
||||
|
||||
const center = { lat: 0, lng: 0 };
|
||||
|
||||
<GoogleMapReact center={center} zoom={3}/>
|
||||
83
types/google-map-react/index.d.ts
vendored
Normal file
83
types/google-map-react/index.d.ts
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
// Type definitions for google-map-react 0.22
|
||||
// Project: https://github.com/istarkov/google-map-react
|
||||
// Definitions by: Honza Brecka <https://github.com/honzabrecka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface BootstrapURLKeys {
|
||||
key: string;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
styles?: any[];
|
||||
scrollwheel?: boolean;
|
||||
panControl?: boolean;
|
||||
mapTypeControl?: boolean,
|
||||
minZoomOverride?: boolean;
|
||||
minZoom?: number;
|
||||
gestureHandling?: string;
|
||||
}
|
||||
|
||||
export interface Maps {
|
||||
Animation: any;
|
||||
ControlPosition: any;
|
||||
MapTypeControlStyle: any;
|
||||
MapTypeId: any;
|
||||
NavigationControlStyle: any;
|
||||
ScaleControlStyle: any;
|
||||
StrokePosition: any;
|
||||
SymbolPath: any;
|
||||
ZoomControlStyle: any;
|
||||
DirectionsStatus: any;
|
||||
DirectionsTravelMode: any;
|
||||
DirectionsUnitSystem: any;
|
||||
DistanceMatrixStatus: any;
|
||||
DistanceMatrixElementStatus: any;
|
||||
ElevationStatus: any;
|
||||
GeocoderLocationType: any;
|
||||
GeocoderStatus: any;
|
||||
KmlLayerStats: any;
|
||||
MaxZoomStatus: any;
|
||||
StreetViewStatus: any;
|
||||
TransitMode: any;
|
||||
TransitRoutePreference: any;
|
||||
TravelMode: any;
|
||||
UnitSystem: any;
|
||||
}
|
||||
|
||||
export interface Props {
|
||||
bootstrapURLKeys?: BootstrapURLKeys;
|
||||
defaultCenter?: [number, number] | { lat: number, lng: number };
|
||||
center?: [number, number] | { lat: number, lng: number };
|
||||
defaultZoom?: number;
|
||||
zoom?: number;
|
||||
hoverDistance?: number;
|
||||
options?: Options | ((maps: Maps) => Options);
|
||||
margin?: any[];
|
||||
debounced?: boolean;
|
||||
layerTypes?: string[];
|
||||
onClick?: ({x, y, lat, lng, event}: { x: number, y: number, lat: number, lng: number, event: any }) => any;
|
||||
onChange?: ({ center, zoom, bounds, marginBounds }: { center: [number, number], zoom: number, bounds: [number, number, number, number], marginBounds: [number, number, number, number] }) => any;
|
||||
resetBoundsOnResize?: boolean;
|
||||
onChildClick?: (hoverKey: any, childProps: any) => void;
|
||||
onChildMouseEnter?: (hoverKey: any, childProps: any) => void;
|
||||
onChildMouseLeave?: (hoverKey: any, childProps: any) => void;
|
||||
onZoomAnimationStart?: (args: any) => void;
|
||||
onZoomAnimationEnd?: (args: any) => void;
|
||||
onMapTypeIdChange?: (args: any) => void;
|
||||
distanceToMouse?: (pt: {x: number, y: number}, mousePos: {x: number, y: number}) => void;
|
||||
googleMapLoader?: (bootstrapURLKeys: any) => void;
|
||||
onGoogleApiLoaded?: ({map, maps}: { map: any, maps: any }) => void;
|
||||
yesIWantToUseGoogleMapApiInternals?: boolean;
|
||||
}
|
||||
|
||||
export default class GoogleMapReact extends React.Component<Props, void> {}
|
||||
|
||||
export interface ChildComponentProps {
|
||||
lat: number;
|
||||
lng: number;
|
||||
$hover?: boolean;
|
||||
}
|
||||
24
types/google-map-react/tsconfig.json
Normal file
24
types/google-map-react/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"google-map-react-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/google-map-react/tslint.json
Normal file
1
types/google-map-react/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user