huiyan-fe / react-bmapgl

基于百度地图JavaScript GL版API封装的React组件库
http://huiyan.baidu.com/github/react-bmapgl/
MIT License
115 stars 21 forks source link

`types` field in package.json should be `dist/index.d.ts` #55

Closed yifanwww closed 1 year ago

yifanwww commented 2 years ago

Currently the types field targets to types/bmapgl/index.d.ts where defines GL JSAPI types in BMapGL namespace. There is a problem when we import this package:

image

Because of the types field, TypeScript can only find the BMapGL namespace in this package, all the types from the src are not exposed.

I think the types field should be dist/index.d.ts (not the previous dist/types/index.d.ts). If users complain they cannot get the type declarations for BMapGL, they should install @types/bmapgl.

This doc in this repo talks about the relations between types/bmapgl and @types/bmapgl. Users can just get BMapGL type definitions from @types/bmapgl, not from this project.