turf icon indicating copy to clipboard operation
turf copied to clipboard

Several modules not exported in index.d.ts

Open meatjam opened this issue 3 years ago • 5 comments
trafficstars

I'm using @turf/turf with version 6.5.0. It seems that several modules are not exported in index.d.ts, such as : booleanConcave,booleanIntersects.

Although they are indeed exported in "@turf/turf/dist/es/index.js" and "@turf/turf/dist/js/index.js",thus they can be actually imported and used in production mode.Still,the IDE can not find them during development mode, which may result in confusion for developers.

Would you please add export statement "booleanConcave","booleanIntersects" in index.d.ts? Thanks a lot.

meatjam avatar Feb 14 '22 02:02 meatjam

Thanks for raising

booleanIntersects looks like it's currently in there https://github.com/Turfjs/turf/blob/cd31582faddc15552994c095411f5623378c6874/packages/turf/index.d.ts

booleanConcave seems to be missing, I've raised a PR for it.

JamesLMilner avatar Mar 02 '22 20:03 JamesLMilner

Thanks for raising

booleanIntersects looks like it's currently in there https://github.com/Turfjs/turf/blob/cd31582faddc15552994c095411f5623378c6874/packages/turf/index.d.ts

booleanConcave seems to be missing, I've raised a PR for it.

Thanks for reply. I've tried "npm i @turf/turf@latest" in new created project, the version in package.json is indeed 6.5.0. But my index.d.ts is quite different from index.d.ts in github repo, I don't know why. index.d.zip

meatjam avatar Mar 03 '22 02:03 meatjam

@meatjam what's on GitHub isn't what gets published to npm. You'll most likely seen the changes in 7.0.0

JamesLMilner avatar Mar 03 '22 09:03 JamesLMilner

ok, I'll stay tuned.

meatjam avatar Mar 03 '22 09:03 meatjam

I'm not sure why but I'm also not seeing booleanIntersects in my IDE with version 6.5.0 when using Yarn 3.2.3.

Quick workaround:

-import { booleanIntersects } from '@turf/turf';
+import booleanIntersects from '@turf/boolean-intersects';

davidcalhoun avatar Sep 09 '22 21:09 davidcalhoun

I'm not sure why but I'm also not seeing booleanIntersects in my IDE with version 6.5.0 when using Yarn 3.2.3.

Quick workaround:

-import { booleanIntersects } from '@turf/turf';
+import booleanIntersects from '@turf/boolean-intersects';

Tried this with no luck. @JamesLMilner You said you have a PR for this?

just-Bri avatar Sep 26 '22 15:09 just-Bri

I'm not sure why but I'm also not seeing booleanIntersects in my IDE with version 6.5.0 when using Yarn 3.2.3. Quick workaround:

-import { booleanIntersects } from '@turf/turf';
+import booleanIntersects from '@turf/boolean-intersects';

Tried this with no luck. @JamesLMilner You said you have a PR for this?

Have you tried installing it first? npm install @turf/boolean-intersects and then import it import booleanIntersects from '@turf/boolean-intersects'; It worked for me.

It seems like the version 6.5.0 doesn't include booleanIntersects and we have to install this module separately. Also including a line export { default as booleanIntersects } from '@turf/boolean-intersects'; in index.d.ts doesn't change anything.

Rimberse avatar Oct 31 '23 16:10 Rimberse