Skip to content

Instantly share code, notes, and snippets.

@schwarzeszeux
Last active August 29, 2015 14:01
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 schwarzeszeux/c52373d612d45eaf4e6b to your computer and use it in GitHub Desktop.
Save schwarzeszeux/c52373d612d45eaf4e6b to your computer and use it in GitHub Desktop.
{
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