-
Notifications
You must be signed in to change notification settings - Fork 818
/
index.d.ts
133 lines (101 loc) · 3.27 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import 'googlemaps'
import * as React from 'react'
interface IGoogleApiOptions {
apiKey: string,
libraries?: string[],
client?: string,
url?: string,
version?: string,
language?: string,
region?: string,
LoadingContainer?: any
}
type GoogleApiOptionsFunc = (props: any) => IGoogleApiOptions
type Omit<T1, T2> = Pick<T1, Exclude<keyof T1, keyof T2>>
export type GoogleAPI = typeof google
export function GoogleApiWrapper(opts: IGoogleApiOptions | GoogleApiOptionsFunc):
<TProps extends IProvidedProps>(ctor: React.ComponentType<TProps>) => React.ComponentType<Omit<TProps, IProvidedProps>>
export interface IProvidedProps {
google: GoogleAPI
loaded?: boolean
}
type mapEventHandler = (mapProps?: IMapProps, map?: google.maps.Map, event?: any) => any
type Style = Object
export interface IMapProps extends google.maps.MapOptions {
google: GoogleAPI
loaded?: boolean
style?: Style
containerStyle?: Style
bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral
centerAroundCurrentLocation?: boolean
initialCenter?: google.maps.LatLngLiteral
center?: google.maps.LatLngLiteral
zoom?: number
zoomControl?: boolean
mapTypeControl?: boolean
scaleControl?: boolean
streetViewControl?: boolean
panControl?: boolean
rotateControl?: boolean
fullscreenControl?: boolean
visible?: boolean
onReady?: mapEventHandler
onClick?: mapEventHandler
onDragend?: mapEventHandler
onRecenter?: mapEventHandler
onBoundsChanged?: mapEventHandler
onCenterChanged?: mapEventHandler
onDblclick?: mapEventHandler
onDragstart?: mapEventHandler
onHeadingChange?: mapEventHandler
onIdle?: mapEventHandler
onMaptypeidChanged?: mapEventHandler
onMousemove?: mapEventHandler
onMouseover?: mapEventHandler
onMouseout?: mapEventHandler
onProjectionChanged?: mapEventHandler
onResize?: mapEventHandler
onRightclick?: mapEventHandler
onTilesloaded?: mapEventHandler
onTiltChanged?: mapEventHandler
onZoomChanged?: mapEventHandler
}
type markerEventHandler = (props?: IMarkerProps, marker?: google.maps.Marker, event?: any) => any
export interface IMarkerProps extends Partial<google.maps.MarkerOptions> {
mapCenter?: google.maps.LatLng | google.maps.LatLngLiteral
position?: google.maps.LatLngLiteral
label?: string
title?: string
name?: string
onClick?: markerEventHandler
onDblclick?: markerEventHandler
onDragend?: markerEventHandler
onMousedown?: markerEventHandler
onMouseout?: markerEventHandler
onMouseover?: markerEventHandler
onDragend?: markerEventHandler
onMouseup?: markerEventHandler
onRecenter?: markerEventHandler
}
export class Map extends React.Component<IMapProps, any> {
}
export class Marker extends React.Component<IMarkerProps, any> {
}
export class Polygon extends React.Component<any, any> {
}
export class Polyline extends React.Component<any, any> {
}
export class Circle extends React.Component<any, any> {
}
export interface IInfoWindowProps extends Partial<google.maps.InfoWindowOptions> {
google?: typeof google
map?: google.maps.Map
marker?: google.maps.Marker
position?: google.maps.LatLng | google.maps.LatLngLiteral
visible?: boolean
children: React.ReactNode
onClose?(): void
onOpen?(): void
}
export class InfoWindow extends React.Component<IInfoWindowProps, any> {
}