Typescript: Understanding how the pieces fit - typings, @typings, tsc and DefinitelyTypes
<p>Am I getting this right?</p>

<p><strong>tsc</strong></p>

<hr>

<p>Its the typescript cli tool and the global version running on my machine.</p>

<p><strong>typings</strong></p>

<hr>

<p><a href="https://github.com/typings/typings" rel="nofollow">typings</a> is a few things. A cli tool to install <strong>.d.ts</strong> files into your project AND the folder that save to inside my project.</p>

<p><strong>For example:</strong></p>

<p>you can search for <strong>.d.ts</strong> scripts by running:</p>

<pre><code>typings search foo
</code></pre>

<p>and add a package:</p>

<pre><code>typings install --global --save dt~foo
</code></pre>

<p>then have the <code>typings/index.d.ts</code> reference all my <code>.d.ts</code> definition files</p>

<pre><code>/// &lt;reference path="globals/foo/index.d.ts" /&gt;
</code></pre>

<p>Then if I wanted to use <code>foo</code> anywhere in my project I could add </p>

<pre><code> declare var foo: any;
 import foo from "foo";
</code></pre>

<p><strong>Definitely Types</strong></p>

<hr>

<p><strong>Definitely Types</strong> files have a <strong>.d.ts</strong> extension that allow javascript methods to be called in Typescript</p>

<p><strong>@typings</strong></p>

<hr>

<p>Is a folder located at <code>node_modules/@typings</code> and is the same as the <code>typings</code> folder, but are installed by running <code>npm install @typings/foo</code> and not <code>typings install foo</code>.</p>

<hr>

<p>My questions are:</p>

<ol>
<li><p>why are there two different ways to install typings do this? Is the first method a depreciated method of including <strong>Definitely Types</strong> files to my project?  </p></li>
<li><p>Are <code>@typings</code> module still searchable by running?</p>

<p>typings search foo</p></li>
<li><p>How are I make my project aware of my <code>typings</code>, did defining them like <code>/// &lt;reference path="globals/foo/index.d.ts" /&gt;</code> get scrapped?</p></li>
<li><p>Do I always/when do I declare my <strong>.d.ts</strong> files in my project like <code>declare var foo: any;</code></p></li>
<li><p>Do you still need to use the <code>ambient</code> or <code>global</code> flags when installing?</p></li>
</ol>