tentone / geo-three

Tile based geographic world map visualization library for threejs
https://tentone.github.io/geo-three/docs/
MIT License
699 stars 112 forks source link

Types not working again? #39

Closed mysterybear closed 2 years ago

mysterybear commented 2 years ago

Hi

I see there was #18 and #19

I've just done like

yarn create react-app --template typescript try-geo-three
yarn add geo-three

And then try to import * as foo from "geo-three" and I'm getting:

error TS7016: Could not find a declaration file for module 'geo-three'. '/home/tom/dev/now/try-geo-three/node_modules/geo-three/build/geo-three.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/geo-three` if it exists or add a new declaration (.d.ts) file containing `declare module 'geo-three';`

4 import * as foo from "geo-three"
                       ~~~~~~~~~~~
Found 1 error in src/App.tsx:4

This is with 0.1.0

tentone commented 2 years ago

Hello

I will have to recheck this topic i have been using the library with typescript without any issue.

image

Can you please provide your transpiler settings?

anhle1476 commented 2 years ago

Hello,

I'm having the same issue with 0.1.0. It's just a minimal parcel project (default settings) with web-ifc-viewer and geo-three.

My tsconfig.json:

{
    "compilerOptions": {
        "target": "ES2016",
        "module": "commonjs",
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "strict": true,
        "skipLibCheck": true
    }
}

I noticed that if I change the package.json of geo-three from "main": "build/geo-three.js" into "main": "build/Main.d.ts" then that error will disappear.

and the library's tsconfig.json is shouting at me No inputs were found in config file 'd:/BIM-Project/jsbimviewer/node_modules/geo-three/tsconfig.json'. Specified 'include' paths were '["source/**/*"]' and 'exclude' paths were '["node_modules/**/*","docs/**/*","build/**/*"]'.ts

Thank you.

tentone commented 2 years ago

@anhle1476 Hello

Thanks a lot for the suggestion i have changed the package.json file and updated the package on npm to version 0.1.1

Please test with this new version.

Cheers

anhle1476 commented 2 years ago

@tentone thank you. It works for me 😁

tentone commented 2 years ago

Great! Thanks a lot!