mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Add test for type aliases
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import {
|
||||
BBox,
|
||||
Feature, FeatureCollection, Geometry, GeometryCollection, LineString,
|
||||
Feature, FeatureCollection, GeometryCollection, LineString,
|
||||
MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeoJsonGeometryTypes,
|
||||
GeometryObject, GeoJsonProperties
|
||||
GeoJsonTypes, GeometryObject
|
||||
} from "geojson";
|
||||
|
||||
let featureCollection: FeatureCollection = {
|
||||
@@ -59,6 +58,9 @@ featureCollection.features[0].type; // $ExpectType "Feature"
|
||||
featureCollection.features[0].geometry; // $ExpectType Geometry
|
||||
featureCollection.features[0].geometry.type; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"
|
||||
|
||||
declare let tg: GeoJsonGeometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"
|
||||
declare let t: GeoJsonTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection" | "Feature" | "FeatureCollection"
|
||||
|
||||
const featureWithPolygon: Feature<Polygon> = {
|
||||
type: "Feature",
|
||||
bbox: [-180.0, -90.0, 180.0, 90.0],
|
||||
|
||||
Reference in New Issue
Block a user