From 7d936efb2f37db42c3e57ee9a915ed4d5ab8e25f Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 27 Aug 2022 05:18:48 +0200 Subject: Cleanup, reformat, fix some todos, git hook fixup! Cleanup, reformat, fix some todos, git hook --- src/util/plugin/Plugin.ts | 210 ++++++++++++++++++++++++---------------------- 1 file changed, 110 insertions(+), 100 deletions(-) (limited to 'src/util/plugin/Plugin.ts') diff --git a/src/util/plugin/Plugin.ts b/src/util/plugin/Plugin.ts index 6a6f03f4..9bccba9d 100644 --- a/src/util/plugin/Plugin.ts +++ b/src/util/plugin/Plugin.ts @@ -1,14 +1,27 @@ -import EventEmitter from "events"; -import { PluginLoadedEventArgs, PluginManifest, TypedEventEmitter } from "@fosscord/util"; -import { PluginConfig } from "./PluginConfig"; -import { PreRegisterEventArgs, PreRegisterEventResult, OnRegisterEventArgs } from '.'; -import { PreMessageEventArgs, PreMessageEventResult, OnMessageEventArgs } from '.'; -import { PreLoginEventArgs, PreLoginEventResult, OnLoginEventArgs } from '.'; -import { PreGuildCreateEventArgs, PreGuildCreateEventResult, OnGuildCreateEventArgs } from '.'; -import { PreChannelCreateEventArgs, PreChannelCreateEventResult, OnChannelCreateEventArgs } from '.'; -import { PreTypingEventArgs, PreTypingEventResult, OnTypingEventArgs } from '.'; -import { PreStatusChangeEventArgs, PreStatusChangeEventResult, OnStatusChangeEventArgs } from '.'; - +import { + OnChannelCreateEventArgs, + OnGuildCreateEventArgs, + OnLoginEventArgs, + OnMessageEventArgs, + OnRegisterEventArgs, + OnStatusChangeEventArgs, + OnTypingEventArgs, + PreChannelCreateEventArgs, + PreChannelCreateEventResult, + PreGuildCreateEventArgs, + PreGuildCreateEventResult, + PreLoginEventArgs, + PreLoginEventResult, + PreMessageEventArgs, + PreMessageEventResult, + PreRegisterEventArgs, + PreRegisterEventResult, + PreStatusChangeEventArgs, + PreStatusChangeEventResult, + PreTypingEventArgs, + PreTypingEventResult +} from "."; +import { PluginLoadedEventArgs, PluginManifest } from ".."; /*type PluginEvents = { error: (error: Error | unknown) => void; @@ -27,134 +40,131 @@ export class Plugin { pluginPath?: string; pluginManifest?: PluginManifest; /** - * + * * * @param {PluginLoadedEventArgs} args Info about plugin environment * @memberof Plugin */ - async onPluginLoaded?(args?: PluginLoadedEventArgs) { - - } + async onPluginLoaded?(args?: PluginLoadedEventArgs) {} //generated /** - * RegisterEvent: document me - * - * @param {OnRegisterEventArgs} args Info about what's going on - * @memberof Plugin - */ + * RegisterEvent: document me + * + * @param {OnRegisterEventArgs} args Info about what's going on + * @memberof Plugin + */ async onRegister?(args: OnRegisterEventArgs): Promise; /** - * RegisterEvent: Executed before changes are announced - * document me. - * - * @param {PreRegisterEventArgs} args Info about what's going on - * @return {PreRegisterEventResult} How event should be handled - * @memberof Plugin - */ + * RegisterEvent: Executed before changes are announced + * document me. + * + * @param {PreRegisterEventArgs} args Info about what's going on + * @return {PreRegisterEventResult} How event should be handled + * @memberof Plugin + */ async onPreRegister?(args: PreRegisterEventArgs): Promise; /** - * MessageEvent: document me - * - * @param {OnMessageEventArgs} args Info about what's going on - * @memberof Plugin - */ + * MessageEvent: document me + * + * @param {OnMessageEventArgs} args Info about what's going on + * @memberof Plugin + */ async onMessage?(args: OnMessageEventArgs): Promise; /** - * MessageEvent: Executed before changes are announced - * document me. - * - * @param {PreMessageEventArgs} args Info about what's going on - * @return {PreMessageEventResult} How event should be handled - * @memberof Plugin - */ + * MessageEvent: Executed before changes are announced + * document me. + * + * @param {PreMessageEventArgs} args Info about what's going on + * @return {PreMessageEventResult} How event should be handled + * @memberof Plugin + */ async onPreMessage?(args: PreMessageEventArgs): Promise; /** - * LoginEvent: document me - * - * @param {OnLoginEventArgs} args Info about what's going on - * @memberof Plugin - */ + * LoginEvent: document me + * + * @param {OnLoginEventArgs} args Info about what's going on + * @memberof Plugin + */ async onLogin?(args: OnLoginEventArgs): Promise; /** - * LoginEvent: Executed before changes are announced - * document me. - * - * @param {PreLoginEventArgs} args Info about what's going on - * @return {PreLoginEventResult} How event should be handled - * @memberof Plugin - */ + * LoginEvent: Executed before changes are announced + * document me. + * + * @param {PreLoginEventArgs} args Info about what's going on + * @return {PreLoginEventResult} How event should be handled + * @memberof Plugin + */ async onPreLogin?(args: PreLoginEventArgs): Promise; /** - * GuildCreateEvent: document me - * - * @param {OnGuildCreateEventArgs} args Info about what's going on - * @memberof Plugin - */ + * GuildCreateEvent: document me + * + * @param {OnGuildCreateEventArgs} args Info about what's going on + * @memberof Plugin + */ async onGuildCreate?(args: OnGuildCreateEventArgs): Promise; /** - * GuildCreateEvent: Executed before changes are announced - * document me. - * - * @param {PreGuildCreateEventArgs} args Info about what's going on - * @return {PreGuildCreateEventResult} How event should be handled - * @memberof Plugin - */ + * GuildCreateEvent: Executed before changes are announced + * document me. + * + * @param {PreGuildCreateEventArgs} args Info about what's going on + * @return {PreGuildCreateEventResult} How event should be handled + * @memberof Plugin + */ async onPreGuildCreate?(args: PreGuildCreateEventArgs): Promise; /** - * ChannelCreateEvent: document me - * - * @param {OnChannelCreateEventArgs} args Info about what's going on - * @memberof Plugin - */ + * ChannelCreateEvent: document me + * + * @param {OnChannelCreateEventArgs} args Info about what's going on + * @memberof Plugin + */ async onChannelCreate?(args: OnChannelCreateEventArgs): Promise; /** - * ChannelCreateEvent: Executed before changes are announced - * document me. - * - * @param {PreChannelCreateEventArgs} args Info about what's going on - * @return {PreChannelCreateEventResult} How event should be handled - * @memberof Plugin - */ + * ChannelCreateEvent: Executed before changes are announced + * document me. + * + * @param {PreChannelCreateEventArgs} args Info about what's going on + * @return {PreChannelCreateEventResult} How event should be handled + * @memberof Plugin + */ async onPreChannelCreate?(args: PreChannelCreateEventArgs): Promise; /** - * TypingEvent: document me - * - * @param {OnTypingEventArgs} args Info about what's going on - * @memberof Plugin - */ + * TypingEvent: document me + * + * @param {OnTypingEventArgs} args Info about what's going on + * @memberof Plugin + */ async onTyping?(args: OnTypingEventArgs): Promise; /** - * TypingEvent: Executed before changes are announced - * document me. - * - * @param {PreTypingEventArgs} args Info about what's going on - * @return {PreTypingEventResult} How event should be handled - * @memberof Plugin - */ + * TypingEvent: Executed before changes are announced + * document me. + * + * @param {PreTypingEventArgs} args Info about what's going on + * @return {PreTypingEventResult} How event should be handled + * @memberof Plugin + */ async onPreTyping?(args: PreTypingEventArgs): Promise; /** - * StatusChangeEvent: document me - * - * @param {OnStatusChangeEventArgs} args Info about what's going on - * @memberof Plugin - */ + * StatusChangeEvent: document me + * + * @param {OnStatusChangeEventArgs} args Info about what's going on + * @memberof Plugin + */ async onStatusChange?(args: OnStatusChangeEventArgs): Promise; /** - * StatusChangeEvent: Executed before changes are announced - * document me. - * - * @param {PreStatusChangeEventArgs} args Info about what's going on - * @return {PreStatusChangeEventResult} How event should be handled - * @memberof Plugin - */ + * StatusChangeEvent: Executed before changes are announced + * document me. + * + * @param {PreStatusChangeEventArgs} args Info about what's going on + * @return {PreStatusChangeEventResult} How event should be handled + * @memberof Plugin + */ async onPreStatusChange?(args: PreStatusChangeEventArgs): Promise; - } -- cgit 1.5.1