-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from uber/upgrade-deps-types
* Adds TS type definitions * Cleans up tests for h3-js@3.7.1 * Upgrades dev dependencies in yarn.lock
- Loading branch information
Showing
7 changed files
with
955 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
declare module 'geojson2h3' { | ||
import {Feature, FeatureCollection, GeoJsonProperties} from 'geojson'; | ||
|
||
/** | ||
* Convert a GeoJSON feature to a set of hexagons. Only hexagons whose centers | ||
* fall within the feature will be included. Note that conversion from GeoJSON | ||
* is lossy; the resulting hexagon set only approximately describes the original | ||
* shape, at a level of precision determined by the hexagon resolution. | ||
*/ | ||
export function featureToH3Set(feature: Feature, resolution: number): string[]; | ||
|
||
/** | ||
* Convert a single H3 hexagon to a GeoJSON `Polygon` feature | ||
*/ | ||
export function h3ToFeature(h3Index: string, properties: GeoJsonProperties): Feature; | ||
|
||
/** | ||
* Convert a set of hexagons to a GeoJSON `Feature` with the set outline(s). The | ||
* feature's geometry type will be either `Polygon` or `MultiPolygon` depending on | ||
* the number of outlines required for the set. | ||
*/ | ||
export function h3SetToFeature(hexagons: string[], properties: GeoJsonProperties): Feature; | ||
|
||
/** | ||
* Convert a set of hexagons to a GeoJSON `MultiPolygon` feature with the | ||
* outlines of each individual hexagon. | ||
*/ | ||
export function h3SetToMultiPolygonFeature( | ||
hexagons: string[], | ||
properties: GeoJsonProperties | ||
): Feature; | ||
|
||
/** | ||
* Convert a set of hexagons to a GeoJSON `FeatureCollection` with each hexagon | ||
* in a separate `Polygon` feature with optional properties. | ||
*/ | ||
export function h3SetToFeatureCollection( | ||
hexagons: string[], | ||
getProperties: (h3Index: string) => GeoJsonProperties | ||
): FeatureCollection; | ||
} |
Oops, something went wrong.