googlemaps / googlemaps/js-three
Export types in package.json
- Dominant language
- TypeScript
- Stars
- 214
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
---
**Is your feature request related to a problem? Please describe.**
When installing `@googlemaps/three` and importing with typescript via `import { ThreeJSOverlayView } from '@googlemaps/three';`
I get an error `Could not find a declaration file for module '@googlemaps/three'. '.../google-maps-webgl/node_modules/@googlemaps/three/dist/index.esm.js' implicitly has an 'any' type.
There are types at '.../google-maps-webgl/node_modules/@googlemaps/three/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@googlemaps/three' library may need to update its package.json or typings.`
**Describe the solution you'd like**
Export the `dist/index.d.ts` as well.
package.json before:
```json
"main": "dist/index.umd.js",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.umd.js",
"umd": "./dist/index.umd.js",
"browser": "./dist/index.esm.js",
}
},
"unpkg": "dist/index.min.js",
```
package.json after:
```json
"main": "dist/index.umd.js",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.umd.js",
"umd": "./dist/index.umd.js",
"browser": "./dist/index.esm.js",
"types": "./dist/index.d.ts"
}
},
"unpkg": "dist/index.min.js",
```
**Describe alternatives you've considered**
Making that change manually by editing the dependency inside my `node_modules` folder.
Contributor guide
Assessment
This issue has not been assessed yet.