title: How to import types from a third party library?
body: <p>I have a third party library which has types declared in <code>node_modules/thisLibrary/dist/interfaces.d.ts</code>. TS compiler resolves the types used in a function imported from this library, because tooltip displays them and also errors appear when I make incorrect assignments, but when I want to declare a variable using the library's type (which I obviously need to do), I get the error <code>Cannot find name 'TypeName'</code>:</p>
  <pre><code>let myVar: TypeName; // `Cannot find name 'TypeName'`
  </code></pre>
  <p>I have the following settings in my <code>tsconfig.json</code>:</p>
  <pre><code>&quot;moduleResolution&quot;: &quot;node&quot;,
     &quot;include&quot;: [
          &quot;src/**/*.ts&quot;,
          &quot;src/**/*.tsx&quot;,
          &quot;src/**/*.vue&quot;,
          &quot;tests/**/*.ts&quot;,
          &quot;tests/**/*.tsx&quot;,
          &quot;node_modules/thisLibrary/dist/interfaces.d.ts&quot;,
          &quot;../node_modules/thisLibrary/dist/interfaces.d.ts&quot;, // attempting various paths
      ],
   &quot;typeRoots&quot;: [
          &quot;node_modules/@types&quot;,
          &quot;node_modules/thisLibrary/dist&quot;,
      ],
  </code></pre>
  <p>I added the <code>include</code> and <code>typeRoots</code> following some answers, but nothing helps. Compiler does not see it and the library does not export the types (as in the library module), so I'm not able to import them:</p>
  <pre><code>import {type TypeName} from 'thisLibrary'; // results in &quot;Module 'thisLibrary' has no exported member 'TypeName'&quot;.
  </code></pre>
  <p>How can I solve this problem?</p>