From 18e0d40fbdf4b40bee636043d6aab4753f39267e Mon Sep 17 00:00:00 2001 From: Eugene Kulabuhov Date: Thu, 9 Aug 2018 00:00:13 +0300 Subject: [PATCH] Changed to UMD module https://www.typescriptlang.org/docs/handbook/modules.html#umd-modules Please check related issue: https://github.com/Microsoft/TypeScript/issues/26309 With this change using mapbox-gl without import in a module will throw an error: `[ts] 'mapboxgl' refers to a UMD global, but the current file is a module. Consider adding an import instead.` --- types/mapbox-gl/index.d.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index d85af4fd5a..78ce94cb56 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -6,6 +6,9 @@ /// +export = mapboxgl; +export as namespace mapboxgl; + declare namespace mapboxgl { let accessToken: string; let version: string; @@ -1286,11 +1289,3 @@ declare namespace mapboxgl { 'hillshade-accent-color-transition'?: Transition; } } - -declare module 'mapbox-gl' { - export = mapboxgl; -} - -declare module 'mapbox-gl/dist/mapbox-gl' { - export = mapboxgl; -}