title: Wrap simple JavaScript plugin using JsInterop
body: <p>i'm currently upgrading my <strong>Gwt 2.7</strong> project to <strong>2.8-beta1</strong> and i'm trying to refactor the Javascript plugin wrapper from <strong>JSNI</strong> to <strong>JsInterop</strong>.</p>
  
  <p>Here the JSNI wrapper :</p>
  
  <pre><code>public class MyPlugin extends JavaScriptObject {
  
      protected MyPlugin(){
      }
  
      public static native MyPlugin init(MyPluginConfig config) /*-{
          return new $wnd.MyPlugin(config);
      }-*/;
  
      public final native void addItem(MyPluginItem item) /*-{
          this.addItem(item);
      }-*/;
  
      public final native void setEnable(int itemIndex, boolean enable) /*-{
          this.setEnable(itemIndex, enable);
      }-*/;
  }
  </code></pre>
  
  <p>What i've tried : </p>
  
  <pre><code>@JsType(namespace = JsPackage.GLOBAL, isNative = true)
  public class MyPlugin {
      public static native MyPlugin init(MyPluginConfig config);
      public native void addItem(MyPluginItem item);
      public native void setEnable(int itemIndex, boolean enable);
  }
  </code></pre>
  
  <p>The problem, i have no idea how to wrap the constructor. 
  In the <a href="https://groups.google.com/forum/#!msg/google-web-toolkit-contributors/L6uh96NcZtE/XUwhnsAg7TIJ" rel="nofollow">JsInterop doc</a> </p>
  
  <blockquote>
    <p>A native @JsType class can only have
        Public native methods,
        Public and uninitialized fields,
        <strong>Empty constructor</strong>,
        Final non-native methods that doesn’t override any other methods,</p>
  </blockquote>
  
  <p>So, this is my question : How to wrap a JavaScript plugin where in the JS the constructor looks like <code>var myPlugin = MyPlugin({option1 : value1, option2 : value2,...});</code> in JsInterop ?</p>
  
  <p>Thanks for help :)</p>