title: How to export types in a TypeScript npm module
body: <p>In TypeScript, say I want to have the user use my module's &quot;internal&quot; types so they can properly type their own variables when using my module - do I just export literally everything from my index.ts file to accomplish this?</p>
  <pre><code>// index.ts
  
  export * from './file1' // uses types/interfaces defined in file1types
  export * from './file2' // uses types/interfaces defined in file2types
  export * from './types/file1types'
  export * from './types/file2types'
  </code></pre>
  <p>Do <code>.d.ts</code> files help me accomplish this, or are they only for non-TS projects? Does <code>tsconfig.json</code>'s option <code>declaration: true</code> help me accomplish this by generating a <code>.d.ts</code> for every TS file? Is this an alternative to exporting everything from a single index.ts file?</p>
  <p>And if <code>declaration: true</code> does help me accomplish this, how would the user use all those generated <code>.d.ts</code> files within the <code>build</code> folder?</p>
  <p>I would greatly appreciate some clarification as to how one typically exports types in TS projects. Thanks in advance.</p>