Add test for type aliases

This commit is contained in:
Dan Vanderkam
2019-01-05 16:26:04 -05:00
parent 76eda5dc1b
commit 58e01e780d
+5 -3
View File
@@ -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],