From 87d6a6778c6d502df511b639375fa219ac8713c6 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 13 Aug 2022 08:54:50 +0200 Subject: Update plugin loading, update example plugin, add ci task for testing if builds work --- src/util/plugin/Plugin.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/util/plugin/Plugin.ts') diff --git a/src/util/plugin/Plugin.ts b/src/util/plugin/Plugin.ts index 96e05843..1c86a006 100644 --- a/src/util/plugin/Plugin.ts +++ b/src/util/plugin/Plugin.ts @@ -6,7 +6,14 @@ type PluginEvents = { loaded: () => void; }; -export class Plugin extends (EventEmitter as new () => TypedEventEmitter) { +//this doesnt work, check later: + //(EventEmitter as new () => TypedEventEmitter) { +export class Plugin extends EventEmitter { + private _untypedOn = this.on + private _untypedEmit = this.emit + public on = (event: K, listener: PluginEvents[K]): this => this._untypedOn(event, listener) + public emit = (event: K, ...args: Parameters): boolean => this._untypedEmit(event, ...args) + async init() { // insert default config into database? } -- cgit 1.5.1