Skip to content

Commit ba3e652

Browse files
authored
🤖 Merge PR DefinitelyTyped#71644 [open-location-code] Switch to a named export by @jakebailey
1 parent 05315e4 commit ba3e652

File tree

2 files changed

+46
-50
lines changed

2 files changed

+46
-50
lines changed

‎types/open-location-code/index.d.ts‎

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
declare namespace OpenLocationCode {
1+
/**
2+
* Coordinates of a decoded Open Location Code.
3+
*
4+
* The coordinates include the latitude and longitude of the lower left and
5+
* upper right corners and the center of the bounding box for the area the
6+
* code represents.
7+
*
8+
* {@label CodeArea}
9+
*/
10+
export interface CodeArea {
211
/**
3-
* Coordinates of a decoded Open Location Code.
4-
*
5-
* The coordinates include the latitude and longitude of the lower left and
6-
* upper right corners and the center of the bounding box for the area the
7-
* code represents.
8-
*
9-
* {@label CodeArea}
10-
*/
11-
interface CodeArea {
12-
/**
13-
* The latitude of the SW corner.
14-
*/
15-
latitudeLo: number;
16-
17-
/**
18-
* The longitude of the SW corner in degrees.
19-
*/
20-
longitudeLo: number;
21-
22-
/**
23-
* The latitude of the NE corner in degrees.
24-
*/
25-
latitudeHi: number;
26-
27-
/**
28-
* The longitude of the NE corner in degrees.
29-
*/
30-
longitudeHi: number;
31-
32-
/**
33-
* The number of digits in the code.
34-
*/
35-
codeLength: number;
36-
37-
/**
38-
* The latitude of the center in degrees.
39-
*/
40-
latitudeCenter: number;
41-
42-
/**
43-
* The longitude of the center in degrees.
44-
*/
45-
longitudeCenter: number;
46-
}
12+
* The latitude of the SW corner.
13+
*/
14+
latitudeLo: number;
15+
16+
/**
17+
* The longitude of the SW corner in degrees.
18+
*/
19+
longitudeLo: number;
20+
21+
/**
22+
* The latitude of the NE corner in degrees.
23+
*/
24+
latitudeHi: number;
25+
26+
/**
27+
* The longitude of the NE corner in degrees.
28+
*/
29+
longitudeHi: number;
30+
31+
/**
32+
* The number of digits in the code.
33+
*/
34+
codeLength: number;
35+
36+
/**
37+
* The latitude of the center in degrees.
38+
*/
39+
latitudeCenter: number;
40+
41+
/**
42+
* The longitude of the center in degrees.
43+
*/
44+
longitudeCenter: number;
4745
}
4846

49-
declare class OpenLocationCode {
47+
export class OpenLocationCode {
5048
/**
5149
* Provides a normal precision code, approximately 14x14 meters.
5250
*/
@@ -118,7 +116,7 @@ declare class OpenLocationCode {
118116
* area of the code.
119117
* @throws {@link Exception} If the code is not valid.
120118
*/
121-
static decode(code: string): OpenLocationCode.CodeArea;
119+
static decode(code: string): CodeArea;
122120

123121
/**
124122
* Recover the nearest matching code to a specified location.
@@ -155,5 +153,3 @@ declare class OpenLocationCode {
155153
*/
156154
static shorten(code: string, latitude: number, longitude: number): string;
157155
}
158-
159-
export = OpenLocationCode;

‎types/open-location-code/open-location-code-tests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import OpenLocationCode = require("open-location-code");
1+
import { OpenLocationCode } from "open-location-code";
22

33
const a = "796RWF8Q+WF";
44
const area = OpenLocationCode.decode(a);

0 commit comments

Comments
 (0)