You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
If you import a library mylib in your TypeScript code
import * as mylib from 'mylib';
the TypeScript compiler tsc will search for mylib.ts, mylib.tsx, mylib.d.ts in various locations including your local node_modules folder. When tsc can't find any of the above, but it is a JavaScript module in your node_modules, then first try
$ npm install @types/mylib --save-dev
If it succeeds, make sure the versions of the installed @types/mylib and mylib are compatible. If a @types/mylib cannot be found you could create your own mylib.d.ts but this is usually very expensive task if mylib is non-trivial. The easiest way to continue is to try a plain CommonJS/RequireJS import of mylib:
const mylib: any = require('mylib');
and therefore to import the plain JavaScript library without any type definitions.