-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapbox-gl and Geojson types update #22544
Conversation
@alex3165 - It appears Travis did not correctly run on this PR! /cc @RyanCavanaugh to investigate and advise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GeometryObject
interface should not have an optional property coordinates
types/geojson/index.d.ts
Outdated
@@ -68,6 +68,7 @@ export interface GeoJsonObject { | |||
*/ | |||
export interface GeometryObject extends GeoJsonObject { | |||
type: GeoJsonGeometryTypes; | |||
coordinates?: Position | Position[] | Position[][] | Position[][][]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A GeometryCollection
is also a GeometryObject
, but is not allowed to have a coordinates
property. At a first glance it seems to be incorrect for me.
Why do you use it here? Maybe we will find another, better solution...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the geometry type (GeoJsonGeometryTypes
) is Point
or Polygon
it can have coordinates no? That's why I made it optional, in case it is a GeometryCollection
and shouldn't have a coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got the point. But i would not prefer to make it like this. I take a look at an older change especially on the old line 33. In my opinion the GeometryObject
should be a type
again, like this:
export type GeometryObject = Point | /* other geometries */ | GeometryCollection
// with Geometries like this:
export interface Point extends GeoJsonObject {
type: "Point";
coordinates: Position;
}
// and so on...
In short, I think there is no advantage to extends geometries from the GeometryObject
instead of GeoJsonObject
directly.
What do @Cobster and @JeffJacobson think about that?
@alex3165 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
Hey @atd-schubert Thanks for your comment, I reverted the changes related to geojson types and created my own type in the end in mapbox-gl instead. could you approve the changes? |
🔔 @atd-schubert - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate? |
@alex3165 Thank you for submitting this PR! 🔔 @dobrud @PatrickR - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
We've gotten sign-off from a reviewer 👏. A maintainer will soon review this PR and merge it if there are no issues. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for contributing to DefinitelyTyped! |
Please fill in this template.
npm run lint package-name
(ortsc
if notslint.json
is present).If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
.