From f6e41cc9b6a27a19e9b745764b28b03a375b0226 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 7 May 2023 00:44:29 -0500 Subject: [PATCH] chore: move typings --- src/types/plugin.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/types/plugin.ts b/src/types/plugin.ts index 9699d2e..0351e72 100644 --- a/src/types/plugin.ts +++ b/src/types/plugin.ts @@ -12,8 +12,8 @@ */ import type { Err, Ok, Result } from 'ts-results-es'; -import type { PluginType } from '../core/structures/enums'; -import type { CommandModule, EventModule } from './module'; +import type { CommandType, EventType, PluginType } from '../core/structures'; +import type { CommandArgsMatrix, CommandModule, EventArgsMatrix, EventModule } from './module'; import type { InitArgs } from './core'; import type { Awaitable } from './handler'; import { Processed } from './core'; @@ -40,3 +40,13 @@ export interface ControlPlugin { export type AnyCommandPlugin = ControlPlugin | InitPlugin<[InitArgs>]>; export type AnyEventPlugin = ControlPlugin | InitPlugin<[InitArgs>]>; + +export type CommandArgs< + I extends CommandType = CommandType, + J extends PluginType = PluginType, +> = CommandArgsMatrix[I][J]; + +export type EventArgs< + I extends EventType = EventType, + J extends PluginType = PluginType, +> = EventArgsMatrix[I][J];