Plugins
A plugin is TeamHUD’s unit of extension: a TypeScript class that extends BasePlugin (from the Mythic framework), runs in the main process with full trust, and is loaded at startup. A plugin can register a widget, an overlay UI, but a widget is just one of the things a plugin can provide; the plugin itself is the container.
Lifecycle
Section titled “Lifecycle”The framework drives every plugin through the same ordered lifecycle. You implement the hooks you need (each returns a Promise).
configure(options?). The instance is created; read and validate your options.initialize(). Deferred setup (e.g. fetch a renderer bundle’s remote).startup(). Runs after all plugins are configured. Do the real work here: register resources, wire IPC, register a widget’s renderer bundle.shutdown(). Tear down when the app closes or the plugin is unloaded.
Two event hooks let a plugin react to the wider system: onSystemEvent(event) (runtime lifecycle events like pre/post global startup) and onPluginEvent(name, data) (events emitted by other plugins).
What a plugin declares
Section titled “What a plugin declares”A plugin describes itself with info(), which returns metadata: its name and version, the resources it provides (a widget is a resource), dependencies on other plugins, and options. The framework uses this to load, order, and toggle plugins. See the Plugin API reference for the full shape.
A plugin that ships a widget has two halves
Section titled “A plugin that ships a widget has two halves”| Half | Extends | Does |
|---|---|---|
| Main-process plugin | BasePlugin |
Registers where the renderer bundle lives, in startup(). |
| Renderer component | OverlayHubWidget |
The actual Lit UI. |
The Build your first plugin tutorial builds exactly this, end to end. A plugin that isn’t a widget skips the renderer half and does its work in the lifecycle hooks.