forked from no23reason/react-geolocated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
58 lines (52 loc) · 1.71 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
import * as React from "react";
/**
* The configuration options.
*/
interface GeolocatedConfig {
/**
* The Geolocation API's positionOptions configuration object.
*/
positionOptions?: PositionOptions;
/**
* Time we give to the user to allow the use of Geolocation API before presuming they denied it.
*/
userDecisionTimeout?: number;
/**
* The implementer of the Geolocation API.
* @default navigator.geolocation
*/
geolocationProvider?: Geolocation;
}
/**
* Props injected in the wrapped component.
*/
interface GeolocatedProps {
/**
* The Geolocation API's coords object containing latitude, longitude, and accuracy and also optionally containing altitude, altitudeAccuracy, heading and speed.
*/
coords?: Coordinates;
/**
* Flag indicating that the browser supports the Geolocation API.
*/
isGeolocationAvailable?: boolean;
/**
* Flag indicating that the user has allowed the use of the Geolocation API. It optimistically presumes they did until they either explicitly deny it or userDecisionTimeout (if set) has elapsed and they haven't allowed it yet.
*/
isGeolocationEnabled?: boolean;
/**
* The Geolocation API's PositionError object resulting from an error occurring in the API call.
*/
positionError?: PositionError;
}
type ComponentType<TProps> = React.ComponentClass<TProps> | React.StatelessComponent<TProps>;
interface ComponentDecorator {
<TOriginalProps>(component: ComponentType<TOriginalProps & GeolocatedProps>): React.ComponentClass<TOriginalProps>;
}
/**
* The HOC function.
*/
export function geolocated(config?: GeolocatedConfig): ComponentDecorator;
/**
* React propTypes object.
*/
export const geoPropTypes: React.ValidationMap<any>;