Last active
December 12, 2016 15:49
-
-
Save kirillp/c443966b28ca68cd21e51ff802fde97d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JsFunction | |
interface Interface { | |
Interface invoke(String arg); | |
} | |
@JsType(isNative = true, namespace = JsPackage.GLOBAL) | |
class Exports { | |
@JsProperty(namespace = JsPackage.GLOBAL) | |
public static native void setInterface(Interface value); | |
} | |
@SuppressWarnings("Duplicates") | |
public class ExportInterface implements EntryPoint { | |
@Override | |
public void onModuleLoad() { | |
JsGlobals.getWindow().getConsole().log("setting Interface"); | |
Interface value = new Interface() { | |
@Override | |
public Interface invoke(String arg) { | |
JsGlobals.getWindow().getConsole().log(arg); | |
return this; | |
} | |
}; | |
Exports.setInterface(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment