how to link a definition typescript file type file in an other definition typefile for deno?

Viewed 98

Here is my arborescence :

--libs/
----@types/
------mapbox-gl/
--------index.d.ts
------geojson/
--------index.d.ts
--mapbox-gl.js
map.ts

here is map.ts :

/**
 * map.ts
 */

// @ts-ignore
// @ts-nocheck
 
//test
// @deno-types="./libs/@types/geojson/index.d.ts"
// @deno-types="./libs/@types/mapbox-gl/index.d.ts"
import mapboxgl from "./libs/mapbox-gl.js";
mapboxgl.accessToken =  "toto";

var map = new mapboxgl.Map({
  container: 'map', // container id
  style: 'mapbox://styles/mapbox/streets-v11', // style URL
  center: [-74.5, 40], // starting position [lng, lat]
  zoom: 9 // starting zoom
  });

and here is my problem in libs/@types/mapbox-gl/index.d.ts :

// @deno-types="../geojson/index.d.ts"
/// <reference types="../geojson/index.d.ts" />

here is the github for better explanation: https://github.com/bussiere/testdeno

How to link correctly the definition of geojson for mapbox-gl ?

Regards

1 Answers

I'm not really sure what your problem if, but if it's just that the reference isn't found, then change it to this:

/// <reference types="../geojson" />

This worked when I tried it.

Related