Definitelytyped: [@types/ramda]: Please update ts-toolbelt to latest version (or stop using it altogether)

Created on 10 Jan 2020  路  12Comments  路  Source: DefinitelyTyped/DefinitelyTyped

Version of ts-toolbelt used by @types/ramda declares global modules and names, it causes errors of duplication when I want to use ramda with other packages that also use ts-toolbelt or having two packages in my monorepo use ramda.


If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/ramda package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @TheHandsomeCoder, @donnut, @mdekrey, @mrdziuban, @sbking, @afharo, ...

If you do not mention the authors the issue will be ignored.

Most helpful comment

@Igorbek I can confirm that @types/react-query is also affected by this. I have an application that uses both react-query _and_ ramda. Typescript fails to compile, due to the global namespace pollution that @KSXGitHub describes.

All 12 comments

@Igorbek I can confirm that @types/react-query is also affected by this. I have an application that uses both react-query _and_ ramda. Typescript fails to compile, due to the global namespace pollution that @KSXGitHub describes.

Ah, that's sad. I can move from using it and use typescript-tuple instead.

Thanks @Igorbek !

Ah, that's sad. I can move from using it and use typescript-tuple instead.

You may not need to. typescript-tuple has fewer features, and I don't think the latest version of ts-toolbelt still uses global namespace.

I totally admire ts-toolbelt has more features but in terms of tuples, typescript-tuple has some superior features like working with finite/infinite tuples more precisely. Anyway, ts-toolbelt needs to be updated for the latest version in ramda.

typescript-tuple has some superior features like working with finite/infinite tuples more precisely

Well thanks. I'm flattered.

@KSXGitHub, is this still a problem?

@millsp IIRC, I worked around this problem by stop using ramda (I wrote my own library), so I don't know.

I can confirm that it's fixed, you can close the issue

@millsp I'm not sure. Even the latest version of ts-toolbelt still has declare module "...". I'm pretty sure this problem will occur again in the future.

I see. Sorry about that. Will fix soon

Not actually. The problem was caused by declare module "index" which I changed to declare module "ts-toolbelt". This is exactly how the upcoming type bundling feature is going to work https://github.com/microsoft/TypeScript/pull/39277. No problem.

Was this page helpful?
0 / 5 - 0 ratings