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

Chore: Apply changes from mobile plugins to lib/ and app-desktop/ (#10079)

This commit is contained in:
Henry Heino
2024-03-09 03:03:57 -08:00
committed by GitHub
parent 91004f5714
commit 25cd5affca
37 changed files with 418 additions and 205 deletions

View File

@@ -39,6 +39,7 @@ export default class Plugin {
private contentScriptMessageListeners_: Record<string, Function> = {};
private dataDir_: string;
private dataDirCreated_ = false;
private hasErrors_ = false;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public constructor(baseDir: string, manifest: PluginManifest, scriptText: string, dispatch: Function, dataDir: string) {
@@ -97,6 +98,14 @@ export default class Plugin {
return Object.keys(this.viewControllers_).length;
}
public get hasErrors(): boolean {
return this.hasErrors_;
}
public set hasErrors(hasErrors: boolean) {
this.hasErrors_ = hasErrors;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public on(eventName: string, callback: Function) {
return this.eventEmitter_.on(eventName, callback);
@@ -190,4 +199,11 @@ export default class Plugin {
return this.contentScriptMessageListeners_[id](message);
}
public onUnload() {
this.dispatch_({
type: 'PLUGIN_UNLOAD',
pluginId: this.id,
});
}
}