UNPKG

vgridjs

Version:

Vgrid DGGS JS

27 lines (25 loc) 951 B
/** * Geohash implementation in TypeScript * Original Python implementation by Hiroaki Kawai <kawai@iij.ad.jp> */ interface BBox { s: number; w: number; n: number; e: number; } interface DecodeResult { latitude: number; longitude: number; latitudeDelta?: number; longitudeDelta?: number; } declare function encode(latitude: number, longitude: number, precision?: number): string; declare function decode(hashcode: string, delta?: boolean): DecodeResult; declare function decodeExactly(hashcode: string): DecodeResult; declare function bbox(hashcode: string): BBox; declare function neighbors(hashcode: string): string[]; declare function expand(hashcode: string): string[]; declare function geohashParent(geohashId: string): string; declare function geohashChildren(geohashId: string, resolution: number): string[]; export { bbox, decode, decodeExactly, encode, expand, geohashChildren, geohashParent, neighbors };