1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Plugins: Add support for editor plugins (#11296)

This commit is contained in:
Laurent Cozic
2024-11-10 14:04:46 +00:00
committed by GitHub
parent 49e86d116f
commit f091c32992
29 changed files with 630 additions and 38 deletions

View File

@@ -180,6 +180,10 @@ export default class Plugin {
this.viewControllers_[v.handle] = v;
}
public hasViewController(handle: ViewHandle) {
return !!this.viewControllers_[handle];
}
public viewController(handle: ViewHandle): ViewController {
if (!this.viewControllers_[handle]) throw new Error(`View not found: ${handle}`);
return this.viewControllers_[handle];