Click, keyboard & type TypeScript types are resolved as "any" because of wrong imports in typings
See original GitHub issue@testing-library/domversion: 7.30.0@testing-library/user-eventversion: 13.0.1typescriptversion: 4.2.3
Problem description:
The file typings/index.d.ts contains type imports from ../src/ folder, which does not exist in the distributed package, so all those types are resolved to any.
Codesandbox: https://codesandbox.io/s/romantic-shadow-uio28

typings/index.d.ts in the corresponding node_modules folder:

This concerns the following types:
- click, clickOptions
- keyboard, keyboardOptions, keyboardKey,
- type, typeOptions
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module ''react-materialize ...
This error occurs when you're working on a typescript project, default modules doesn't come with types that are needed with typescript.
Read more >Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >TypeScript Programming with Visual Studio Code
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It offers classes, modules, and interfaces to help you build robust ......
Read more >Auto import | PyCharm Documentation - JetBrains
In the Settings/Preferences dialog ( Ctrl+Alt+S ), click Editor | General | Auto Import. · In the Python section, configure automatic imports:.
Read more >TypeScript support in Svelte - Learn web development
Early spotted bugs: The compiler checks types at compile time and provides error reporting. Readability: Static typing gives the code more ...
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 Free
Top 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

See https://github.com/testing-library/user-event/pull/596#issuecomment-802792000
.d.jswon’t hurtRollup removed the references to
lib.dom.d.ts. I’m on it.Unfortunately, it is still not correct. Now the distributed
.d.tsfiles containanytypes, and also, there are.d.jsfiles generated, which I’m guessing shouldn’t be there.For example, the bundled
click.d.tsfile looks like this: