revert: Re-add plugins overload

This commit is contained in:
Jacob Nguyen
2022-05-17 22:30:20 -05:00
parent 464fc05c1c
commit b9b59197df
4 changed files with 6 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ import type { Module, Override } from '../..';
import type { BaseModule, ModuleDefs } from '../structures/module';
import type { PluginType } from '../structures/enums';
import type { ValueOf } from 'ts-pattern/dist/types/helpers';
import type { CommandType } from '../..';
export interface Controller {
@@ -40,7 +41,9 @@ export type EventPlugin<T extends keyof ModuleDefs> = Override<BasePlugin, {
execute: (event: Parameters<ModuleDefs[T]['execute']>, controller: Controller) => Awaitable<Result<void, void>>;
}>;
export function plugins(...plug: CommandPlugin[]) {
export function plugins(...plug: CommandPlugin[]) : CommandPlugin[];
export function plugins<T extends keyof ModuleDefs>(...plug: EventPlugin<T>[]) : EventPlugin<T>[];
export function plugins<T extends keyof ModuleDefs>(...plug: EventPlugin<T>[] | CommandPlugin[]) {
return plug;
}