title: How to correctly use PrismJS and its typings with typescript / angular 2
body: <p>I'm building a little app with <strong>angular-cli</strong> and I would like to use <strong>PrismJS</strong> but I can't get it work.</p>
  
  <p>So basically I've created a <strong>vendor</strong> folder where I put my Prism's scripts and styles and load them in the <strong>index.html</strong>.</p>
  
  <p>I also need to install type definitions in order to be able to compile my app :</p>
  
  <pre><code>npm i --save-dev @typings/prismjs
  </code></pre>
  
  <p>Then, I just have to call <code>Prism.whatever()</code> anywhere in my code but this doesn't work.</p>
  
  <p>Even my IDE doesn't recognize the namespace <code>Prism</code>. </p>
  
  <p>By checking the content of the definition (<code>index.d.ts</code>) I've seen that since version 1.6, it doesn't contain </p>
  
  <pre><code>declare var Prism : PrismJS.Prism;
  </code></pre>
  
  <p>anymore. There is just some <code>export namespace Prism</code>. So I was wondering if I have to import something since any <code>declare</code> is used.</p>
  
  <p>It seems weird to me to import something from a definition file.</p>
  
  <p>As I wanted to step over this, I've installed an older version of the definition (1.4.16) which contains </p>
  
  <pre><code>declare var Prism : PrismJS.Prism;
  </code></pre>
  
  <p>Now, my IDE (webstorm) is happy! It can recognize <code>Prism</code>. But when I try to compile, webpack still outputs an error: </p>
  
  <pre><code>Cannot find name 'Prism'
  </code></pre>
  
  <p>So my question is pretty basic: what have I forgotten?</p>
  
  <p><em>Sorry for this obvious question.</em></p>
  
  <p>Thanks!</p>