title: About "*.d.ts" in TypeScript
body: <p>I am curious about <code>.d.ts</code> declaration files because I am new to the TypeScript programming language. I was told by someone that <code>.d.ts</code> files are are similar to <code>.h</code> header files in the C &amp; C++ programming languages, however, the <code>.d.ts</code> files don't seem to work quite the same. Currently, I am failing to understand how to properly use the .d.ts files. It would appear that I cant add my <code>.js</code> or <code>.ts</code> files to the <code>.d.ts</code> files, so the only way my project will work is if it contains all three file types. That seems like a lot of files. To help me better understand how the .d.ts files are related to JavaScript &amp; TypeScript, I have some questions I would like to ask.</p>
  <hr />
  <ol>
  <li><p>What is the relationship between the three files? the relationship between them?</p>
  </li>
  <li><p>How can I use the <code>*.d.ts</code> file? Does it mean I can delete the <code>*.ts</code> file permanently?</p>
  </li>
  <li><p>If so, how can the <code>*.d.ts</code> file know which JS file is mapping to itself?</p>
  </li>
  </ol>
  <hr />
  <p>It would be very nice if someone can give me an example.</p>