chore: remove dependence on discord.js Awaitable type

This commit is contained in:
Jacob Nguyen
2023-04-16 14:17:56 -05:00
parent 37ddef170f
commit 1fa7eef336
3 changed files with 5 additions and 4 deletions

View File

@@ -8,6 +8,9 @@ import type { ErrorHandling, Logging, ModuleManager } from '../core/contracts';
import type { ModuleStore } from '../core/structures/moduleStore';
import type SernEmitter from '../core/sernEmitter';
import type { Container } from 'iti';
export type Awaitable<T> = PromiseLike<T> | T;
// Thanks to @kelsny
export type ParseType<T> = {
[K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never;

View File

@@ -9,7 +9,6 @@ import type {
ApplicationCommandSubCommandData,
ApplicationCommandSubGroupData,
AutocompleteInteraction,
Awaitable,
BaseApplicationCommandOptionsData,
ButtonInteraction,
MessageContextMenuCommandInteraction,
@@ -22,7 +21,7 @@ import type {
UserSelectMenuInteraction,
} from 'discord.js';
import { CommandType } from '../core/structures/enums';
import type { Args, SlashOptions } from './handler';
import type { Args, Awaitable, SlashOptions } from './handler';
import type Context from '../handler/structures/context';
import type { InitPlugin, ControlPlugin } from './plugin';
import { EventType } from '../core/structures/enums';

View File

@@ -11,12 +11,11 @@
* Plugins are reminiscent of middleware in express.
*/
import type { Awaitable } from 'discord.js';
import type { Err, Ok, Result } from 'ts-results-es';
import type { PluginType } from '../core/structures/enums';
import type { CommandModule, EventModule } from './module';
import type { InitArgs } from '../core/plugins';
import type { Processed } from './handler';
import type { Awaitable, Processed } from './handler';
export type PluginResult = Awaitable<VoidResult>;
export type VoidResult = Result<void, void>;