mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
feat(plugins): add PluginAPI base class with no-op lifecycle
Amit Haridas
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
class PluginAPI {
|
||||
/**
|
||||
* Called when the plugin is discovered and loaded.
|
||||
* Receives a scoped context object with APIs.
|
||||
* @param {object} context - Plugin context (sidebar, commands, settings, etc.)
|
||||
*/
|
||||
init(context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/** Called when the plugin is activated (e.g., sidebar panel clicked). */
|
||||
activate() {}
|
||||
|
||||
/** Called when the plugin is deactivated. */
|
||||
deactivate() {}
|
||||
|
||||
/** Returns the parsed manifest.json for this plugin. */
|
||||
getManifest() {
|
||||
return this._manifest || null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { PluginAPI };
|
||||
Reference in New Issue
Block a user