You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add that this library is type-incompatible with itself because of union return types. Here's an example of how to take a list of polygons and convert them to a collection of lines:
featureCollection(
places.flatMap(
({ geometry, name }) =>
(polygonToLine(geometry, { properties: { name } }) as FeatureCollection)
.features
)
)
It requires a type assertion.
Presumably, that's because certain arguments to polygonToLine would cause switches between feature collections and feature output; otherwise this type should just get narrowed.
If it is because of a switch, it might make sense to make functions like this generic. A generic type could be used to restrict the allowable input options (specifically those output switches) and narrow the output type.
Goals:
@types/geojson
geojson
.Related tickets:
turf-helpers: use geojson.d.ts from DefinitelyTyped #1658 compatibility with @types/geojson
Position
type has correct definition commented out #1906NPM Packages don't have standard typings or builds #1289 export type declaration when published build (resolved?)
Turf typings don't play nicely with mapbox-gl typings #1297 types play nice with mapbox-gl-js (this can be verified once a v7 alpha/beta release is published)
TypeErrors - using wrong geojson types with top-level turf package #1504 (perhaps this can be verified once a v7 alpha/beta release is published)
The text was updated successfully, but these errors were encountered: