Typescript definitions
See original GitHub issueProblem
At the moment you can install Typescript 2.0 definitions via npm install @types/turf
.
However, not all of the definitions are defined and it can be overwhelming trying to manage a 1280+ LOC type definition.
Solution
I’m suggesting we host the Typescript type definitions within the Turf library instead of DefinitelyTyped.
By including a simple & minimalistic index.d.ts
and test/types.ts
within each package, the type definitions will be bundled with each namespace package.
By default index.d.ts
will be automatically detected, however including "types": "index.d.ts"
in the package.json
is a good practice.
/// <reference types="geojson" />
/***
* http://turfjs.org/docs/#point
*/
export type Point = Array<number>
export function point(coordinates: Point, properties?: Object): GeoJSON.Feature<GeoJSON.Point>;
To-Do
-
turf-along
-
turf-area
-
turf-bbox
-
turf-bbox-polygon
-
turf-bearing
-
turf-bezier
-
turf-buffer
-
turf-center
-
turf-center-of-mass
-
turf-centroid
-
turf-circle
-
turf-collect
-
turf-combine
-
turf-concave
-
turf-convex
-
turf-destination
-
turf-difference
-
turf-distance
-
turf-envelope
-
turf-explode
-
turf-flip
-
turf-helpers
-
turf-hex-grid
-
turf-idw
-
turf-inside
-
turf-intersect
-
turf-invariant
-
turf-isolines
-
turf-kinks
-
turf-line-distance
-
turf-line-slice
-
turf-line-slice-along
-
turf-meta
-
turf-midpoint
-
turf-nearest
-
turf-planepoint
-
turf-point-grid
-
turf-point-on-line
-
turf-point-on-surface
-
turf-random
-
turf-sample
-
turf-simplify
-
turf-square
-
turf-square-grid
-
turf-tag
-
turf-tesselate
-
turf-tin
-
turf-triangle-grid
-
turf-union
-
turf-within
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Documentation - Type Declarations - TypeScript
Built-in Type Definitions. TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes.
Read more >Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >Documentation - Introduction - TypeScript
The Declaration Files section is designed to teach you how to write a high-quality TypeScript Declaration File. We need to assume basic familiarity...
Read more >The repository for high quality TypeScript type definitions.
The repository for high quality TypeScript type definitions. - GitHub - DefinitelyTyped/DefinitelyTyped: The repository for high quality TypeScript type ...
Read more >TypeScript Definitions | Developer's Guide - GrapeCity
Hence, all the DataViewsJS packages on npm include TypeScript definitions. These TypeScript declaration (d.ts) files provide the type checking and ...
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 Free
Top 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
Any news on this? Just installed @turf/centroid 6.0.1 and types are missing…
🚀🚀 Woot! Completed all the Typescript definitions