-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGeolocationAPI.res
More file actions
81 lines (75 loc) · 2.55 KB
/
GeolocationAPI.res
File metadata and controls
81 lines (75 loc) · 2.55 KB
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
@@warning("-30")
/**
An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.
[See Geolocation on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation)
*/
@editor.completeFrom(Geolocation)
type geolocation = {}
/**
[See GeolocationCoordinates on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates)
*/
@editor.completeFrom(GeolocationCoordinates)
type geolocationCoordinates = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/accuracy)
*/
accuracy: float,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/latitude)
*/
latitude: float,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/longitude)
*/
longitude: float,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitude)
*/
altitude: Null.t<float>,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitudeAccuracy)
*/
altitudeAccuracy: Null.t<float>,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading)
*/
heading: Null.t<float>,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/speed)
*/
speed: Null.t<float>,
}
/**
[See GeolocationPosition on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition)
*/
@editor.completeFrom(GeolocationPosition)
type geolocationPosition = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/coords)
*/
coords: geolocationCoordinates,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/timestamp)
*/
timestamp: int,
}
/**
[See GeolocationPositionError on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError)
*/
type geolocationPositionError = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/code)
*/
code: int,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/message)
*/
message: string,
}
type positionOptions = {
mutable enableHighAccuracy?: bool,
mutable timeout?: int,
mutable maximumAge?: int,
}
type positionCallback = geolocationPosition => unit
type positionErrorCallback = geolocationPositionError => unit