title: Augment a class with new properties exported with export = MyClass
body: <p>I have written a plugin <a href="https://github.com/simonbengtsson/jsPDF-AutoTable" rel="nofollow noreferrer">jspdf-autotable</a> for <a href="https://github.com/MrRio/jsPDF" rel="nofollow noreferrer">jspdf</a>. Jspdf exports a class <code>jsPDF</code> which I want to augment with a new <code>autoTable</code> method once the user imports my plugin. Reading the module augmentation section in <a href="http://www.typescriptlang.org/docs/handbook/declaration-merging.html" rel="nofollow noreferrer">Declaration Merging</a> it seems the following should work.</p>
  
  <pre><code>// Existing index.d.ts for jspdf
  // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jspdf/index.d.ts
  declare module 'jspdf' {
    class jsPDF {
      constructor(orientation?: any);
  
      setPage(n:number):jsPDF;
      save(filename:string):jsPDF;
      // ...
    }
  
    namespace jsPDF {}
  
    export = jsPDF;
  }
  
  // Proposed index.d.ts for the plugin jspdf-autotable
  import * as jsPDF from 'jspdf';
  
  declare module 'jspdf' {
    export function staticMethod(); // Test
  
    interface jsPDF {
      autoTable(): jsPDF;
    }
  }
  
  // Usage
  import * as jsPDF from 'jspdf';
  import 'jspdf-autotable';
  
  jsPDF.staticMethod() // This works
  let doc = new jsPDF();
  doc.autoTable(); // This gives error: Property 'autoTable' does not exist on type
  doc.save('table.pdf');
  </code></pre>
  
  <p>However the autoTable method is not found. Note that the static method works for some reason though. Is there a way to make this work without changing the jspdf declarations? If not, how can I update the jspdf declarations for allowing plugins like this (it is <a href="https://github.com/MrRio/jsPDF/blob/3b6bb86f6490df6fddbc8155b6460c38c26c0ed0/examples/jspdf.PLUGINTEMPLATE.js" rel="nofollow noreferrer">officially supported</a>)?</p>