Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/latlon-geohash

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/latlon-geohash - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

163

latlon-geohash/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for latlon-geohash 1.1
// Type definitions for latlon-geohash 2.0
// Project: https://github.com/chrisveness/latlon-geohash, http://www.movable-type.co.uk/scripts/geohash.html

@@ -7,89 +7,92 @@ // Definitions by: Robert Imig <https://github.com/rimig>

export enum Direction {
North = "N",
South = "S",
East = "E",
West = "W"
}
declare namespace Geohash {
enum Direction {
North = "N",
South = "S",
East = "E",
West = "W"
}
export interface Neighbours {
n: string;
ne: string;
e: string;
se: string;
s: string;
sw: string;
w: string;
nw: string;
}
interface Neighbours {
n: string;
ne: string;
e: string;
se: string;
s: string;
sw: string;
w: string;
nw: string;
}
export interface Bounds {
sw: Point;
ne: Point;
}
interface Bounds {
sw: Point;
ne: Point;
}
export interface Point {
lat: number;
lon: number;
}
interface Point {
lat: number;
lon: number;
}
/**
* Encodes latitude/longitude to geohash, either to specified precision or to automatically
* evaluated precision.
*
* @param lat - Latitude in degrees.
* @param lon - Longitude in degrees.
* @param [precision] - Number of characters in resulting geohash.
* @returns Geohash of supplied latitude/longitude.
* @throws Invalid geohash.
*
* @example
* var geohash = Geohash.encode(52.205, 0.119, 7); // geohash: 'u120fxw'
*/
/**
* Encodes latitude/longitude to geohash, either to specified precision or to automatically
* evaluated precision.
*
* @param lat - Latitude in degrees.
* @param lon - Longitude in degrees.
* @param [precision] - Number of characters in resulting geohash.
* @returns Geohash of supplied latitude/longitude.
* @throws Invalid geohash.
*
* @example
* var geohash = Geohash.encode(52.205, 0.119, 7); // geohash: 'u120fxw'
*/
function encode(
latitude: number,
longitude: number,
precision?: number
): string;
export function encode(
latitude: number,
longitude: number,
precision?: number
): string;
/**
* Decode geohash to latitude/longitude (location is approximate centre of geohash cell,
* to reasonable precision).
*
* @param geohash - Geohash string to be converted to latitude/longitude.
* @returns (Center of) geohashed location.
* @throws Invalid geohash.
*
* @example
* var latlon = Geohash.decode('u120fxw'); // latlon: { lat: 52.205, lon: 0.1188 }
*/
function decode(geohash: string): Point;
/**
* Decode geohash to latitude/longitude (location is approximate centre of geohash cell,
* to reasonable precision).
*
* @param geohash - Geohash string to be converted to latitude/longitude.
* @returns (Center of) geohashed location.
* @throws Invalid geohash.
*
* @example
* var latlon = Geohash.decode('u120fxw'); // latlon: { lat: 52.205, lon: 0.1188 }
*/
export function decode(geohash: string): Point;
/**
* Returns SW/NE latitude/longitude bounds of specified geohash.
*
* @param geohash - Cell that bounds are required of.
* @returns The Bounds
* @throws Invalid geohash.
*/
function bounds(geohash: string): Bounds;
/**
* Returns SW/NE latitude/longitude bounds of specified geohash.
*
* @param geohash - Cell that bounds are required of.
* @returns The Bounds
* @throws Invalid geohash.
*/
export function bounds(geohash: string): Bounds;
/**
* Determines adjacent cell in given direction.
*
* @param geohash - Cell to which adjacent cell is required.
* @param direction - Direction from geohash (N/S/E/W).
* @returns Geocode of adjacent cell.
* @throws Invalid geohash.
*/
function adjacent(geohash: string, direction: Direction | string): string;
/**
* Determines adjacent cell in given direction.
*
* @param geohash - Cell to which adjacent cell is required.
* @param direction - Direction from geohash (N/S/E/W).
* @returns Geocode of adjacent cell.
* @throws Invalid geohash.
*/
export function adjacent(geohash: string, direction: Direction | string): string;
/**
* Returns all 8 adjacent cells to specified geohash.
*
* @param geohash - Geohash neighbours are required of.
* @returns The neighbours
* @throws Invalid geohash.
*/
function neighbours(geohash: string): Neighbours;
}
/**
* Returns all 8 adjacent cells to specified geohash.
*
* @param geohash - Geohash neighbours are required of.
* @returns The neighbours
* @throws Invalid geohash.
*/
export function neighbours(geohash: string): Neighbours;
export default Geohash;
{
"name": "@types/latlon-geohash",
"version": "1.1.1",
"version": "2.0.0",
"description": "TypeScript definitions for latlon-geohash",

@@ -14,11 +14,12 @@ "license": "MIT",

"main": "",
"types": "index",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/latlon-geohash"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "eb6282d118ce3ecd132ab8ef730951e1ebe04ab1b95fd44efddbba5a0c8bd03e",
"typeScriptVersion": "2.4"
"typesPublisherContentHash": "9d6e34b94b5542a8b5e1bd497a9ed3cb9531cdaf11991da3327916cfd6678e01",
"typeScriptVersion": "2.8"
}

@@ -5,9 +5,9 @@ # Installation

# Summary
This package contains type definitions for latlon-geohash ( https://github.com/chrisveness/latlon-geohash ).
This package contains type definitions for latlon-geohash (https://github.com/chrisveness/latlon-geohash).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/latlon-geohash
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/latlon-geohash.
Additional Details
* Last updated: Wed, 13 Feb 2019 18:42:18 GMT
### Additional Details
* Last updated: Tue, 19 Nov 2019 20:38:55 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Robert Imig <https://github.com/rimig>.
These definitions were written by Robert Imig (https://github.com/rimig).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc