-
-
Notifications
You must be signed in to change notification settings - Fork 340
/
types.ts
52 lines (41 loc) · 1.49 KB
/
types.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
export type GeolibLongitudeInputValue = number | string;
export type GeolibLatitudeInputValue = number | string;
export type GeolibAltitudeInputValue = number;
export type GeolibGeoJSONPoint = [
GeolibLongitudeInputValue,
GeolibLatitudeInputValue,
GeolibAltitudeInputValue?
];
export type LongitudeKeys = 'lng' | 'lon' | 'longitude' | 0;
export type LatitudeKeys = 'lat' | 'latitude' | 1;
export type AltitudeKeys = 'alt' | 'altitude' | 'elevation' | 'elev' | 2;
export type GeolibInputLongitude =
| { lng: GeolibLongitudeInputValue }
| { lon: GeolibLongitudeInputValue }
| { longitude: GeolibLongitudeInputValue };
export type GeolibInputLatitude =
| { lat: GeolibLatitudeInputValue }
| { latitude: GeolibLatitudeInputValue };
export type GeolibInputAltitude =
| { alt?: GeolibAltitudeInputValue }
| { altitude?: GeolibAltitudeInputValue }
| { elevation?: GeolibAltitudeInputValue }
| { elev?: GeolibAltitudeInputValue };
export type UserInputCoordinates = GeolibInputLongitude &
GeolibInputLatitude &
GeolibInputAltitude;
export type GeolibInputCoordinates = UserInputCoordinates | GeolibGeoJSONPoint;
export type GeolibDistanceFn = (
point: GeolibInputCoordinates,
dest: GeolibInputCoordinates
) => number;
export type Timestamp = number;
export type GeolibInputCoordinatesWithTime = GeolibInputCoordinates & {
time: Timestamp;
};
export type GeolibBounds = {
maxLat: number;
minLat: number;
maxLng: number;
minLng: number;
};