2gis / mapsapi

Карты 2ГИС — это точные данные обо всех объектах города, включая новостройки, с детализацией до заборов и внутриквартальных проездов.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No default export

MaxSvargal opened this issue · comments

I use npm package within TypeScript and there are no default exports.
Can you add a module prop to package.json?

module field point to a module that has ES2015 module syntax. We don't have this module syntax, how can it help you?

@Trufi How to use the npm package? There are no any exports.

We have main field, which points to a bundle with commonjs module syntax.

import DG from '2gis-maps'; should works with ES2015 module syntax.

But If you use TypeScript, you must add typings for any package. We have no own typings, and you have to do it yourself.

For example, you can create project.d.ts and add:

declare module "2gis-maps" {
  const _: any;
  export default _;
}