Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hints from H3Index to H3IndexInput #171

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. This librar
## [Unreleased]
### Fixed
- Patch libh3 bundles to check for `typeof document != "undefined"` before accessing `document`. This allows h3-js to be used in a Web Worker and React Native
- Fix H3Index type hints for `cellToBoundary`, `cellArea`, `edgeLength`

## [4.0.1] - 2022-09-19
### Changed
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function may return up to 10 vertices.

| Param | Type | Description |
| --- | --- | --- |
| h3Index | <code>H3Index</code> | H3 index |
| h3Index | <code>H3IndexInput</code> | H3 index |
| [formatAsGeoJson] | <code>boolean</code> | Whether to provide GeoJSON output: [lng, lat], closed loops |


Expand Down Expand Up @@ -847,7 +847,7 @@ Exact area of a given cell

| Param | Type | Description |
| --- | --- | --- |
| h3Index | <code>H3Index</code> | H3 index of the hexagon to measure |
| h3Index | <code>H3IndexInput</code> | H3 index of the hexagon to measure |
| unit | <code>string</code> | Distance unit (either UNITS.m2, UNITS.km2, or UNITS.rads2) |


Expand All @@ -866,7 +866,7 @@ Calculate length of a given unidirectional edge

| Param | Type | Description |
| --- | --- | --- |
| edge | <code>H3Index</code> | H3 index of the edge to measure |
| edge | <code>H3IndexInput</code> | H3 index of the edge to measure |
| unit | <code>string</code> | Distance unit (either UNITS.m, UNITS.km, or UNITS.rads) |


Expand Down
6 changes: 3 additions & 3 deletions lib/h3core.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ export function cellToLatLng(h3Index) {
* points. For pentagons and hexagons on the edge of an icosahedron face, this
* function may return up to 10 vertices.
* @static
* @param {H3Index} h3Index H3 index
* @param {H3IndexInput} h3Index H3 index
* @param {boolean} [formatAsGeoJson] Whether to provide GeoJSON output: [lng, lat], closed loops
* @return {CoordPair[]} Array of [lat, lng] pairs
* @throws {H3Error} If input is invalid
Expand Down Expand Up @@ -1395,7 +1395,7 @@ export function greatCircleDistance(latLng1, latLng2, unit) {
/**
* Exact area of a given cell
* @static
* @param {H3Index} h3Index H3 index of the hexagon to measure
* @param {H3IndexInput} h3Index H3 index of the hexagon to measure
* @param {string} unit Distance unit (either UNITS.m2, UNITS.km2, or UNITS.rads2)
* @return {number} Cell area
* @throws {H3Error} If the input is invalid
Expand Down Expand Up @@ -1426,7 +1426,7 @@ export function cellArea(h3Index, unit) {
/**
* Calculate length of a given unidirectional edge
* @static
* @param {H3Index} edge H3 index of the edge to measure
* @param {H3IndexInput} edge H3 index of the edge to measure
* @param {string} unit Distance unit (either UNITS.m, UNITS.km, or UNITS.rads)
* @return {number} Cell area
* @throws {H3Error} If the input is invalid
Expand Down