import type { LngLat } from './lng-lat'; interface GenericPolygonGeometry { type: 'Polygon'; /** * Polygon's rings. * * @remarks * Inner rings may extend beyond outer ring. * GeoJSON doesn't allow this, but there's a lot of data like this in this JS API. */ coordinates: TCoordinates[][]; } interface GenericMultiPolygonGeometry { type: 'MultiPolygon'; /** Array of polygons. See {@link GenericPolygonGeometry}. */ coordinates: TCoordinates[][][]; } interface GenericLineStringGeometry { type: 'LineString'; coordinates: TCoordinates[]; } interface GenericMultiLineStringGeometry { type: 'MultiLineString'; coordinates: TCoordinates[][]; } interface GenericPointGeometry { type: 'Point'; coordinates: TCoordinates; } type GenericGeometry = GenericPolygonGeometry | GenericMultiPolygonGeometry | GenericLineStringGeometry | GenericMultiLineStringGeometry | GenericPointGeometry; interface GenericFeature { type: 'Feature'; id: string; geometry: GenericGeometry; properties?: Record; } interface GenericPointFeature extends GenericFeature { geometry: GenericPointGeometry; } interface GenericYandexFeatureCollection { type: 'FeatureCollection'; /** * Could be collection of features or collection of feature collections. * This is not defined by GEO JSON spec, but there is such cases in our data. */ features: (GenericFeature | GenericYandexFeatureCollection)[]; properties?: Record; } interface GenericFeatureCollection extends GenericYandexFeatureCollection { id: string; features: GenericFeature[]; } type LineStringGeometry = GenericLineStringGeometry; type MultiLineStringGeometry = GenericMultiLineStringGeometry; type MultiPolygonGeometry = GenericMultiPolygonGeometry; type PointGeometry = GenericPointGeometry; type PolygonGeometry = GenericPolygonGeometry; export { GenericPolygonGeometry, GenericMultiPolygonGeometry, GenericLineStringGeometry, GenericMultiLineStringGeometry, GenericPointGeometry, GenericGeometry, GenericFeature, GenericPointFeature, GenericFeatureCollection, GenericYandexFeatureCollection, LineStringGeometry, MultiLineStringGeometry, MultiPolygonGeometry, PointGeometry, PolygonGeometry };