How to ignore a line in TypeScript but copy it to JS?
<p>I am trying to write TypeScript code that uses an existing JS library. The problem is that this library provides a facility, <code>include()</code>, for loading JS classes at run time based on "path" passed to <code>include()</code>:</p>

<blockquote>
  <p>var LibraryClass = include('path-to-class');</p>
</blockquote>

<p>But TypeScript needs definitions of these classes at compile time... I can make my code compile by commenting the whole <code>include</code> line (together with <code>var LibraryClass</code>) in .ts and providing class definitions the usual TypeScript way, via  <code>/// &lt;reference path="someFile.ts"/&gt;</code> or by creating .d.ts ambient definition files for this library.</p>

<p>But I can't figure out how to ignore <code>include()</code> calls in .ts but keep them in the resulting .js...</p>

<p>May be it's possible to have different variable names in .ts and .js? If I could, for example, have </p>

<blockquote>
  <p>var LibraryClassTS = include('path-to-class');</p>
</blockquote>

<p>in TypeScript but, somehow, compile it into</p>

<blockquote>
  <p>var LibraryClass = include('path-to-class');</p>
</blockquote>

<p>if JavaScript, that would solve my problem: I would have an empty <code>LibraryClassTS</code> class in .ts (while <code>LibraryClass</code> interface definition is loaded from .d.ts) and the run-time <code>LibraryClass</code> loading in .js.</p>