Create typings for nested namespaces in typescript
<p>I'm trying to create typings definitions for already existed library, and having issues describe its structure properly. The problem is nested namespaces. In JavaScript full name of my method looks like this:</p>

<pre><code>NameSpace1.NameSpace2.NameSpace3.MethodName()
</code></pre>

<p>But I'm not able to create proper <code>d.ts</code> definition file... I've tried different combinations, with <code>export interface</code>, <code>export module</code> for nested namespaces... But nothing works. The only construction that does not fire any errors is following: </p>

<pre><code>declare namespace NameSpace1 {
}
</code></pre>

<p>But this is not enough... Do you know how to properly describe such a nested namespaces in TypeScript definitions?</p>