Skip to content

Commit

Permalink
update code/doc
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwerfling committed Nov 9, 2024
1 parent 2e783bc commit f957e84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
10 changes: 7 additions & 3 deletions core/src/inc/PluginSystem/APlugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {PluginDefinition} from './PluginDefinition.js';
import {PluginManager} from './PluginManager.js';
import {PluginServiceNames} from './PluginServiceNames.js';

/**
* Plugin
* Abstract Plugin class
*/
export abstract class APlugin {

Expand All @@ -21,7 +20,8 @@ export abstract class APlugin {

/**
* constructor
* @param info
* @param {PluginDefinition} info
* @param {PluginManager} pm
*/
public constructor(info: PluginDefinition, pm: PluginManager) {
this._info = info;
Expand All @@ -31,23 +31,27 @@ export abstract class APlugin {
/**
* getPluginManager
* @protected
* @returns {PluginManager}
*/
protected getPluginManager(): PluginManager {
return this._pluginManager;
}

/**
* plugin name
* @returns {string}
*/
public abstract getName(): string;

/**
* onEnable
* @returns {boolean}
*/
public abstract onEnable(): boolean;

/**
* onDisable
* @returns {boolean}
*/
public abstract onDisable(): boolean;

Expand Down
3 changes: 2 additions & 1 deletion core/src/inc/PluginSystem/APluginEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
export abstract class APluginEvent {

/**
* getName
* Return the name
* @returns {string}
*/
public abstract getName(): string;

Expand Down
5 changes: 3 additions & 2 deletions core/src/inc/PluginSystem/PluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ export class PluginManager {
}

/**
* getAllEvents
* @param aClass
* Return all Events
* @param {Function} aClass
* @returns {APluginEvent[]}
*/
// eslint-disable-next-line @typescript-eslint/ban-types
public getAllEvents<T extends APluginEvent>(aClass: Function): T[] {
Expand Down
2 changes: 1 addition & 1 deletion core/src/inc/PluginSystem/PluginServiceNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export enum PluginServiceNames {
iptable = 'iptable',
sshserver = 'sshserver',
vpn = 'vpn'
};
}

0 comments on commit f957e84

Please sign in to comment.