mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
Update GeoJSON definition with generics
This commit is contained in:
@@ -54,7 +54,7 @@ var featureCollection: GeoJSON.FeatureCollection = {
|
||||
}
|
||||
}
|
||||
|
||||
var feature: GeoJSON.Feature = {
|
||||
var feature: GeoJSON.Feature<GeoJSON.Polygon> = {
|
||||
type: "Feature",
|
||||
bbox: [-180.0, -90.0, 180.0, 90.0],
|
||||
geometry: {
|
||||
|
||||
Vendored
+4
-4
@@ -90,9 +90,9 @@ declare namespace GeoJSON {
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#feature-objects
|
||||
*/
|
||||
export interface Feature extends GeoJsonObject
|
||||
export interface Feature<T extends GeometryObject> extends GeoJsonObject
|
||||
{
|
||||
geometry: GeometryObject;
|
||||
geometry: T;
|
||||
properties: any;
|
||||
id?: string;
|
||||
}
|
||||
@@ -100,9 +100,9 @@ declare namespace GeoJSON {
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#feature-collection-objects
|
||||
*/
|
||||
export interface FeatureCollection extends GeoJsonObject
|
||||
export interface FeatureCollection<T extends GeometryObject> extends GeoJsonObject
|
||||
{
|
||||
features: Feature[];
|
||||
features: Feature<T>[];
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
Reference in New Issue
Block a user