Comments (10)
I have no experience with TypeScript at all.
Could you point me to some resource which explains the function of index.d.ts? (I wouldn't want to offer something – and end up supporting something – I don't understand!).
from geodesy.
I would recommend reading Microsoft's docs, https://www.typescriptlang.org
In a nut shell, typescript allows types in JavaScript, it makes it a lot easier to troubleshoot a library if you can catch errors before you compile or run in the browser.
from geodesy.
Yes, I'm familiar with the overall idea of TypeScript, but I don't know the function of index.d.ts
.
Within that site, I can find several times index.d.ts is mentioned (eg Module Resolution, sample module.d.ts), but not an explanation of what it does or what it is for.
Can you direct my to something more specific?
from geodesy.
I've had a look at the index.d.ts
in the fork you've taken. It looks rather analogous to a Java interface?
You might be interested that I am working on a revised version of the library (using ES-modules), which splits the core ellipsoidal functions (used inter alia by mapping functions) from the datum conversions, and adds modern epoch-based TRS conversions to complement the (now mostly historical) datum conversions. It also separates the vector-based geodetic code into spherical and ellipsoidal parts.
Of course, this all adds more complexity to the interdependencies, so I don't plan to release this using ES5 syntax, and plan to wait until there is at least one native ES-modules implementation available (I'm tracking Chrome, Firefox, Edge, and Node developments closely!).
All of which to say I'm hoping this version of the library will be history before too very long. I think the ES-modules spec has been fairly closely tracked by TypeScript developments? So I would be much more interested in whatever is required to build an interface between that new version and TypeScript than to mess around with the current version...
from geodesy.
Well treat this index.d.ts
as a patch to your current package, it allows your ES5 library to be compatible with Typescript.
Typically I pushed my Typescript definition to DefinitelyTyped which publishes thousands of high quality Typescript definitions, the only draw back is now you have to install two libraries (ex: npm install geodesy
& npm install @types/geodesy
).
Since you are active on your project, I figured it's better to have the Typescript definition embedded in your library that way you can control the changes when new features become available.
You might be interested that I am working on a revised version of the library (using ES-modules), which splits the core ellipsoidal functions (used inter alia by mapping functions) from the datum conversions, and adds modern epoch-based TRS conversions to complement the (now mostly historical) datum conversions. It also separates the vector-based geodetic code into spherical and ellipsoidal parts.
Awesome stuff! Looking forward to the revised version, I would recommend you build on top of the latest ES6/ES7 and use tools like Babel or Typescript to compile down to your preferred version.
For your extra added complexity, you should follow the code philosophy of TurfJS, they are using Lerna to package each dependency as an independent testable module, this makes it a lot easier to build a large scale mutli package library and have it fully tested.
from geodesy.
So... to have the type definitions... what is the current approach?
from geodesy.
@DenisCarriere Do you have a version that supports version 2.2.0 of this library please? I think this is what's causing issues for me updating the library in my React-Native code.
from geodesy.
@DenisCarriere if you have an index.t.ds
which matches the current v2.2.0 interface, I would gladly accept a PR.
from geodesy.
Hi @chrisveness
I just created a new PR for this. Please take a look.
from geodesy.
Type definitions for geodesy v2 are now available from www.npmjs.com/package/@types/geodesy.
Thx, Jonghun Yu.
from geodesy.
Related Issues (20)
- Difference on geoscience australia example HOT 2
- How to use the library in Angular 2+ apps?
- True rhumbline distance
- Paypal Donate 404 at https://www.movable-type.co.uk/scripts/latlong-os-gridref.html HOT 2
- MGRS parsing issue HOT 1
- OSgrid Parsing Error HOT 2
- LatLonSpherical.intersection algorithm is different from edwilliams aviation formula. HOT 1
- double crossTrackDistanceTo( StartX, StartY, StartZ, EndX, EndY, EndZ, PointX, PointY, PointZ ); needed HOT 2
- Something wrong with CrossTrackDistanceTo ? It assumes a line instead of line segment ? HOT 3
- MinimumDistanceToLineSegment( Start, Stop, Point ); HOT 1
- ClosestPointDistanceToClosestPointOnSegment fails for some pairs on globe... see video and code.. any ideas ? HOT 1
- Point-Line Distance 3-Dimensional HOT 4
- how can i verify the destination point is right? HOT 1
- intersection between a circle and a great line segment
- World Geographic Reference System (GEOREF) conversion? HOT 1
- OS Grid Conversion in Jersey and Channel Islands HOT 1
- MGRS above 84N and below 80S HOT 1
- Reason for the do...while loop in toLatLon(), utm.js
- Intersection of two paths given start points, bearings and elevations
- Swift conversion - os_tm_eas_nor_to_lat_lon giving the deprecated OSGB36 lat/lon HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geodesy.