Skip to content

Instantly share code, notes, and snippets.

@kirillp
Created October 24, 2016 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirillp/c7b841b98980e710bdd98d5aea75db6c to your computer and use it in GitHub Desktop.
Save kirillp/c7b841b98980e710bdd98d5aea75db6c to your computer and use it in GitHub Desktop.
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface Session extends EventTarget {
@JsMethod
void setMode(String mode);
}
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface Renderer {
@JsMethod
void onResize();
}
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface Editor {
@JsMethod
void setValue(String value, int cursorPosition);
@JsMethod
String getValue();
@JsMethod
void setTheme(String theme);
@JsMethod
void focus();
@JsMethod
Session getSession();
@JsProperty
Renderer getRenderer();
}
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class AceGlobals {
@JsProperty(namespace = JsPackage.GLOBAL)
@JSBody(params = {}, script = "return ace;")
public static native Ace getAce();
}
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface Ace {
@JsMethod
Editor edit(Element element);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment