TypeScript can I mix import of regular js in a .ts file?
<p>I'm using webpack and write in es6.
I'm in the process of integrating typescript to the project.
so my need is to import "old" es6 modules to the new .ts file.
I keep getting the following error:</p>

<p>let's say I have a</p>

<pre><code>const consts = {
  login: '/api/login',
  user: '/api/user',
  register: '/api/register'
};

export default consts;
</code></pre>

<p>and I import this consts to a a.ts file:</p>

<pre><code>import * as api from '../consts/api.js';

class A implements {
  constructor() {
    console.log(api)
  }
}

export default AuthorizationServiceDIfa;
</code></pre>

<p>and I'm getting the following error:</p>

<pre><code>TS2307: Cannot find module '../consts/api.js'.
</code></pre>