Typings for @turf/distance
See original GitHub issueHi! It seems that typings for distance
do not work out-of-the-box.
STR:
npm install --save @turf
import distance from '@turf/distance';
Compiler says:
Type error: Could not find a declaration file for module '@turf/distance'. 'src/node_modules/@turf/distance/index.js' implicitly has an 'any' type.
Try `npm install @types/turf__distance` if it exists or add a new declaration (.d.ts) file containing `declare module '@turf/distance';` TS7016
Though if I suppress it, no errors occur while runtime.
When I look into /distance
module, there is no .ts files there:
Tried the following steps to fix:
npm install @types/turf__distance
- 404 Not Found (as turf contains types on its own, not intypes
reponpm install @types/turf
- old version of typingsnpm install @turf/turf
- better, I can use typings as well asdistance
itself, but only in way when I import the entireturf
lib. So that bundle size increased by 300kb, doesn’t fit.dts-gen @turf/distance
- no.ts
files there to create the.d.ts
file
The question is: how can I use the single @turf/distance
module along with TypeScript typings?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:13 (2 by maintainers)
Top Results From Across the Web
@turf/distance - npm
Calculates the distance between two points in degrees, radians, miles, or kilometers. This uses the Haversine formula to account for global ...
Read more >Advanced geospatial analysis - Turf.js
Calculates the distance between two points in degrees, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. Arguments ......
Read more >The Wonder of Turf.js | Codementor
Easily find distance between two points. This takes into account the curvature of the earth, which is crucial in long-distance geographic ...
Read more >@turf/point-to-line-distance | Yarn - Package Manager
CDNs. unpkg: unpkg.com/@turf/point-to-line-distance/. jsDelivr · Popularity. GitHub stargazers: 0 · Activity. Commits last 3 months: 13 · Usage. Dependencies @turf ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any updates for ^6.0.0?
my workaround with
@turf/distance@6.0.1
.