-
Notifications
You must be signed in to change notification settings - Fork 45
/
index.d.ts
32 lines (30 loc) · 1.23 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
declare module "mgrs" {
/**
* Convert lat/lon to MGRS.
*
* @param {[number, number]} ll Array with longitude and latitude on a
* WGS84 ellipsoid.
* @param {number} [accuracy=5] Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
* 100 m, 2 for 1 km, 1 for 10 km or 0 for 100 km). Optional, default is 5.
* @return {string} the MGRS string for the given location and accuracy.
*/
export function forward(ll: [number,number], accuracy?: number): string;
/**
* Convert MGRS to lat/lon bounding box.
*
* @param {string} mgrs MGRS string.
* @return {[number,number,number,number]} An array with left (longitude),
* bottom (latitude), right
* (longitude) and top (latitude) values in WGS84, representing the
* bounding box for the provided MGRS reference.
*/
export function inverse(mgrs: string): [number,number,number,number];
/**
* Convert MGRS to lat/lon point.
*
* @param {string} mgrs MGRS string.
* @return {[number,number]} An array with longitude and latitude values in
* WGS84, representing the center point of the provided MGRS reference.
*/
export function toPoint(mgrs: string): [number,number];
}