title: Trying to convert JQuery plugin to TypeScript
body: <p>I'm trying to convert this JQuery plugin to typescript:</p>
  
  <p><a href="http://malsup.com/jquery/form/#download" rel="nofollow noreferrer">http://malsup.com/jquery/form/#download</a></p>
  
  <p>But I'm not able to get Intellisense to recognize the function in typescript. I just need one function from the this plugin - "ajaxSubmit". I've declared it i a .d.ts file in my typescript project and added a reference to it from the main file. However, Webstorm does not seem to know that function and throws an error. Here's the .d.ts</p>
  
  <pre><code>interface JQuery
  {
      ajaxSubmit(error:any, success:any): JQuery;
  }
  </code></pre>
  
  <p>I've taken a look at this page and tried to follow the intruction in there.</p>
  
  <p><a href="https://stackoverflow.com/questions/12719529/using-jquery-plugin-in-typescript/12722003#12722003">Using jQuery plugin in TypeScript</a></p>
  
  <p>Here's the program that implements AjaxSubmit. Webstorm throws an error that says: $(this) : Argument does not match parameters.</p>
  
  <pre><code>var $form = $("#fileUploadForm");
      $form.submit(function (e) {
          // perform client side validations if any
  
          $(this).ajaxSubmit({
              error: function () {
                  // handle error
              },
  
              success: function (response) {
                  // handle success
              }
          });
  
          // Important: stop event propagation
          return false;
      });
  </code></pre>
  
  <p>By the way, I'm using NodeJS + ExpressJs in the back end, I dont think it concerns this question.</p>