@types/utm - Make northern optional in toLatLon method (#37527)

* Make northern optional in toLatLon

* #37527 - Add overload to toLatLon

* #37527 - Add eofline to index.d.ts

* Update index.d.ts

* Update index.d.ts with newline

* #37527 - Remove double newline
This commit is contained in:
Jonas Triki
2019-08-22 08:49:20 -07:00
committed by Sheetal Nandi
parent 3ee2d884a4
commit 29f705fd9b
2 changed files with 32 additions and 20 deletions
+28 -15
View File
@@ -1,27 +1,40 @@
// Type definitions for utm 1.1
// Project: https://github.com/timothygu/utm#readme
// Definitions by: Hyeonsoo David Lee <https://github.com/civilizeddev>
// Jonas Triki <https://github.com/JonasTriki>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function fromLatLon(
latitude: number,
longitude: number,
forceZoneNum?: number,
latitude: number,
longitude: number,
forceZoneNum?: number,
): {
easting: number
northing: number
zoneNum: number
zoneLetter: string
easting: number;
northing: number;
zoneNum: number;
zoneLetter: string;
};
export function toLatLon(
easting: number,
northing: number,
zoneNum: number,
zoneLetter: string,
northern: boolean,
strict?: boolean,
easting: number,
northing: number,
zoneNum: number,
zoneLetter: string,
northern?: undefined,
strict?: boolean,
): {
latitude: number
longitude: number
latitude: number;
longitude: number;
};
export function toLatLon(
easting: number,
northing: number,
zoneNum: number,
zoneLetter: undefined,
northern: boolean,
strict?: boolean,
): {
latitude: number;
longitude: number;
};
+4 -5
View File
@@ -8,11 +8,10 @@ const latLon1 = {
const utmCoord1 = fromLatLon(latLon1.lat, latLon1.lon);
const latLon2 = toLatLon(
utmCoord1.easting,
utmCoord1.northing,
utmCoord1.zoneNum,
utmCoord1.zoneLetter,
true,
utmCoord1.easting,
utmCoord1.northing,
utmCoord1.zoneNum,
utmCoord1.zoneLetter,
);
const utmCoord2 = fromLatLon(latLon2.latitude, latLon2.longitude);