title: How to write a d.ts declaration file to import a default class and a named export in typescript?
body: <p>I have a javascript library that has the following module that I would like to import in typescript:</p>
  
  <pre><code>export {  
    namedFunction
  };
  
  export default DefaultClass;
  </code></pre>
  
  <p>I do import it like that in typescript and it works:</p>
  
  <pre><code>import DefaultClass, {
    namedFunction
  } from 'myModule';
  </code></pre>
  
  <p>All this works, but now I want to add a declaration file to not just use <code>any</code>. And I am completely stuck as it seems <code>export default class</code> just does not work. What I managed to get is this:</p>
  
  <pre><code>declare module 'myModule';
  declare module 'myModule' {
      class DefaultClass {
      }
  
      export = DefaultClass;
  
      namespace DefaultClass {
  
      }
  }
  </code></pre>
  
  <p>With that I can import my class and my namedFunction, but I cannot figure a way to add typings to the namedFunction. I don't even understand why do we need an empty namespace for this to work, without it typescript complains.</p>
  
  <p>Is there a way to add typings to all of my classes/functions?</p>
  
  <p>P.S. Note this is not a typo with double declaration. It does not allow me to specify namedFunction, but at least allows it to be imported as any, don't really know why...</p>