I have a working ES2015 project, which I would like to migrate to TypeScript.
In my solution I am using ES2015 imports to import 3rd-pary modules (installed via npm) like this:
import {ClassXY} from 'moduleXY'
After setting up TypeScript in my project, the TypeScript compiler reports the following error:
error TS2307: Cannot find module 'moduleXY'
How can I get the above ES2015 import statement working in TypeScript?
I am looking for a solution other than installing the corresponding .d.ts
declarations via typings
... let's assume the module moduleXY
is a library that does not distribute its own .d.ts
declarations and there are no declarations available on DefinitelyTyped (or the declarations are outdated).
Must I create a stub for the type definitions of module moduleXY
? How would I do that with minimal effort?