Wrong TypeScript type definitions
See original GitHub issueHi. I’ve just updated the package to the latest version and got this TS error:Value of type 'typeof Lru' is not callable. Did you mean to include 'new'
TS is tricked to think that the class is exported instead of the factory function. In https://github.com/avoidwork/tiny-lru/blob/master/src/lru.js#L137 we can see that the factory is exported, instead of the constructor as written here https://github.com/avoidwork/tiny-lru/blob/master/tiny-lru.d.ts#L2
Let me know if you need help with this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to overwrite incorrect TypeScript type definition installed ...
In order to do this: npm remove @types/dotenv . Create a folder types on your project. Copy the whole folder dotenv found in...
Read more >Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >Wrong Typescript type definitions for RemoteVideoTrack and ...
[X ] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in...
Read more >TypeScript errors and how to fix them
error TS1337: An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead. Broken...
Read more >Surviving the TypeScript Ecosystem — Part 4 - Medium
This is wrong of course, but TypeScript doesn't know the difference. However, if we are being responsible and our type definitions are accurate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing due to #33 merging & releasing.
@fox1t ping me on twitter (at-jasonmulligan) if i miss another PR; my work is quite hectic atm and oss stuff doesn’t get any attention.