Skip to content

Commit

Permalink
Merge pull request #55 from zachasme/feature-typescript-typegen
Browse files Browse the repository at this point in the history
Feature typescript typegen
  • Loading branch information
Nick Rabinowitz authored Jul 24, 2019
2 parents 52c890b + 9a20295 commit 8faca08
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
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]
### Added
- Added `h3GetFaces` binding (#54)
- Generate TypeScript definition file from jsdoc comments. (#55)
### Changed
- Updated the core library to v3.5.0 (#52, #54)

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const coordinates = h3.h3SetToMultiPolygon(hexagons, true);
* [.getRes0Indexes()](#module_h3.getRes0Indexes) ⇒ <code>Array.&lt;H3Index&gt;</code>
* [.degsToRads(deg)](#module_h3.degsToRads) ⇒ <code>Number</code>
* [.radsToDegs(rad)](#module_h3.radsToDegs) ⇒ <code>Number</code>
* [.H3Index](#module_h3.H3Index) : <code>string</code>


* * *
Expand Down Expand Up @@ -711,6 +712,14 @@ Convert radians to degrees
| rad | <code>Number</code> | Value in radians |


* * *

<a name="module_h3.H3Index"></a>

### h3.H3Index : <code>string</code>
64-bit hexidecimal string representation of an H3 index


* * *


Expand Down
6 changes: 6 additions & 0 deletions lib/h3core.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
import C from '../out/libh3';
import BINDINGS from './bindings';

/**
* 64-bit hexidecimal string representation of an H3 index
* @static
* @typedef {string} H3Index
*/

const H3 = {};

// Create the bound functions themselves
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@
"unpkg": "dist/h3-js.umd.js",
"module": "dist/h3-js.es.js",
"es2015": "dist/h3-js.es.js",
"types": "dist/types.d.ts",
"source": "lib/h3core.js",
"scripts": {
"build-update-h3": "bash scripts/update-h3.sh",
"build-emscripten": "yarn build-update-h3 && yarn docker-emscripten",
"build-docs": "jsdoc2md --global-index-format grouped --partial doc-files/scope.hbs --helper ./doc-files/insert-version.js --separators --template doc-files/README.tmpl.md lib/h3core.js > README.md",
"build-tsd": "jsdoc -t node_modules/tsd-jsdoc/dist -d console lib/h3core.js | sed 's/\"h3\"/\"h3-js\"/g' > dist/types.d.ts",
"bundle-umd": "microbundle --name h3 --format=umd",
"bundle-cjs": "microbundle --format=cjs --no-compress",
"bundle-es": "microbundle --format=es --no-compress",
"bundle-cjs-browser": "microbundle -o dist/browser --format=cjs --no-compress --alias ../out/libh3=$(printf '%q' \"$PWD\")/dist/libh3-browser",
"bundle-es-browser": "microbundle -o dist/browser --format=es --no-compress --alias ../out/libh3=$(printf '%q' \"$PWD\")/dist/libh3-browser",
"dist": "yarn dist-clean && yarn docker-emscripten-browser && yarn bundle-umd && yarn bundle-cjs && yarn bundle-cjs-browser && yarn bundle-es && yarn bundle-es-browser",
"dist": "yarn dist-clean && yarn docker-emscripten-browser && yarn bundle-umd && yarn bundle-cjs && yarn bundle-cjs-browser && yarn bundle-es && yarn bundle-es-browser && yarn build-tsd",
"dist-clean": "rm -rf dist",
"rollup-test": "rollup test/index.js --file dist/test.js --sourcemap --format=cjs --external=tape,fs,path",
"rollup-bindings": "rollup build/print-bindings.js --file dist/print-bindings.js --format cjs",
Expand Down Expand Up @@ -75,7 +77,8 @@
"nyc": "^14.1.1",
"prettier": "^1.12.1",
"rollup": "^1.7.0",
"tape": "^4.8.0"
"tape": "^4.8.0",
"tsd-jsdoc": "^2.3.1"
},
"engines": {
"node": ">=4",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6699,6 +6699,13 @@ trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"

tsd-jsdoc@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tsd-jsdoc/-/tsd-jsdoc-2.3.1.tgz#71e8507326de3ac730a5227206a0e49325d24708"
integrity sha512-zrgOVp4TXRYpBBiPa/fXOInlgijKlj4eCMvs1W/s2ssrZs+hYqLKGwpjDZ5trZK2E3XJoh1+JTUbvqhAK30oZg==
dependencies:
typescript "^3.2.1"

[email protected], tslib@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
Expand Down Expand Up @@ -6729,6 +6736,11 @@ typescript@>=2.8.3:
version "3.3.4000"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.4000.tgz#76b0f89cfdbf97827e1112d64f283f1151d6adf0"

typescript@^3.2.1:
version "3.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==

typical@^2.4.2, typical@^2.6.0, typical@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d"
Expand Down

0 comments on commit 8faca08

Please sign in to comment.