title: When to use types.ts vs types.d.ts
body: <p>There are many resources explaining a declaration file (d.ts) is useful for either:</p>
  <ul>
  <li>Declaring types for JS libraries used in your TS project, or</li>
  <li>Allowing your JS library to be consumed by other TS projects</li>
  </ul>
  <p>What confuses me is that many projects like <a href="https://github.com/mui-org/material-ui/tree/next/packages/material-ui" rel="noreferrer">material-ui</a> are using d.ts files to simply store types and have them consumed in their own code.</p>
  <p>At this point I start questioning, what's the point in having <code>types.ts</code> files where we have to export / import types and interfaces to consume them, when we could have <code>types.d.ts</code> files and simply consume its interfaces / types without the need for exporting / importing? What are the pros and cons of using one over the other?</p>