title: Typescript to Javascript for cordova-plugins
body: <p>I'm trying to call a cordova plugin from my devExtreme project. One of the methods provided by the plugin is unfortunately in <code>TypeScript</code> and I've tried many different angles of replicating the call in JavaScript, your help will be much appreciated in translating the following code:
  Plugin-Code:</p>
  
  <pre><code>function findNetworkPrinters(success: (printers: Printer[]) =&gt; void, failure: (reason: string) =&gt; void): void
  </code></pre>
  
  <p>What I've tried:</p>
  
  <pre><code>cordova.plugins.brotherPrinter.findNetworkPrinters(function (Printer) {
       alert(printer);
  }, onSuccess, onFail);
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>cordova.plugins.brotherPrinter.findNetworkPrinters(function (Printer) {
       alert(printer);
  }, function()error{
       alert(error);
  });
  </code></pre>
  
  <p>A brief explanation about the plugin usage:</p>
  
  <blockquote>
    <p>findNetworkPrinters</p>
    
    <p>Upon success, findNetworkPrinters will provide a list of printers that
    were discovered on the network (likely using WiFi). It is not
    considered an error for no printers to be found, and in this case the
    list will just be empty.</p>
  </blockquote>