@mapbox/geojson-types

Flow type declarations for GeoJSON.

Usage no npm install needed!

<script type="module">
  import mapboxGeojsonTypes from 'https://cdn.skypack.dev/@mapbox/geojson-types';
</script>

README

geojson-types

Flow type declarations for GeoJSON.

Install

npm install @mapbox/geojson-types

Use

// @flow

import type {
    GeoJSONFeatureCollection,
    GeoJSONFeature,

    // specific geometries
    GeoJSONPoint,
    GeoJSONLineString,
    GeoJSONPolygon,
    GeoJSONMultiPoint,
    GeoJSONMultiLineString,
    GeoJSONMultiPolygon,

    // any geometry
    GeoJSONGeometry,

    // any feature collection, feature, or geometry
    GeoJSON,
} from '@mapbox/geojson-types';

function doSomething(data: GeoJSON) {
    // ...
}