Last active
August 29, 2015 14:01
-
-
Save schwarzeszeux/c52373d612d45eaf4e6b 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
{ | |
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" | |
}] | |
} | |
}] | |
} |
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
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 | |
} | |
} |
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
interface IExtension { | |
onLoad(techne: Editor) => void; | |
onUnload() => void; | |
} |
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
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[]; | |
} |
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
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