From 31da6178ccfa371e1b4e8d239b33f761ffa54a6d Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 17 Mar 2022 11:54:44 +0100 Subject: [PATCH] refactor(maplibre): improuve type imports --- app/javascript/components/shared/maplibre/MapLibre.tsx | 3 ++- .../components/shared/maplibre/styles/layers/cadastre.ts | 2 +- app/javascript/components/shared/maplibre/utils.ts | 8 ++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/javascript/components/shared/maplibre/MapLibre.tsx b/app/javascript/components/shared/maplibre/MapLibre.tsx index 1c29341c3..a7ddf4191 100644 --- a/app/javascript/components/shared/maplibre/MapLibre.tsx +++ b/app/javascript/components/shared/maplibre/MapLibre.tsx @@ -8,7 +8,8 @@ import React, { createContext, useCallback } from 'react'; -import maplibre, { Map, Style, NavigationControl } from 'maplibre-gl'; +import maplibre, { Map, NavigationControl } from 'maplibre-gl'; +import type { Style } from 'maplibre-gl'; import invariant from 'tiny-invariant'; diff --git a/app/javascript/components/shared/maplibre/styles/layers/cadastre.ts b/app/javascript/components/shared/maplibre/styles/layers/cadastre.ts index 759504f97..4ef68ed6b 100644 --- a/app/javascript/components/shared/maplibre/styles/layers/cadastre.ts +++ b/app/javascript/components/shared/maplibre/styles/layers/cadastre.ts @@ -1,4 +1,4 @@ -import { AnyLayer } from 'maplibre-gl'; +import type { AnyLayer } from 'maplibre-gl'; const layers: AnyLayer[] = [ { diff --git a/app/javascript/components/shared/maplibre/utils.ts b/app/javascript/components/shared/maplibre/utils.ts index 8ab08c181..f3974b463 100644 --- a/app/javascript/components/shared/maplibre/utils.ts +++ b/app/javascript/components/shared/maplibre/utils.ts @@ -1,10 +1,6 @@ -import { - LngLatBounds, - LngLat, - LngLatLike, - LngLatBoundsLike -} from 'maplibre-gl'; +import type { LngLat, LngLatLike, LngLatBoundsLike } from 'maplibre-gl'; import type { Geometry, FeatureCollection, Feature } from 'geojson'; +import { LngLatBounds } from 'maplibre-gl'; import invariant from 'tiny-invariant'; export function getBounds(geometry: Geometry): LngLatBoundsLike {