Create a gist now

Instantly share code, notes, and snippets.

{
name: "JavaExporter",
author: "ZeuX",
version: "0.1",
script: "http://jsadas/javaexporter.js",
libraries: [],
menu: [{
text: "Import",
items: [{
icon: "http://asdasd",
text: "Minecraft (Java)",
callback: "importCallback"
}]
},
{
label: "Export",
items: [{
icon: "http://asdasd",
text: "Minecraft (Java)",
callback: "exportCallback"
}]
}
}]
}
class ExtensionManager {
public loadExtension(url: string) {
// load extension definition found at url
// parse json, add to list of loaded extensions
// create menu items
// load script
// after script is loaded, call onLoad
// notify user
}
}
interface IExtension {
onLoad(techne: Editor) => void;
onUnload() => void;
}
interface IMenuEntry {
text: string;
icon: string;
action: string;
}
interface IMenuDefinition {
text: string;
items: IMenuEntry[]
}
interface IExtensionDefinition {
name: string;
author: string;
version: string;
script: string;
libraries: string[];
menu: IMenuDefinition[];
}
class JavaExporter implements IExtension {
public onLoad(private techne: Editor) {
}
public onUnload() {
}
public importCallback() {
this.techne...
}
public exportCallback() {
this.techne...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment