mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
chore: remove dependence on discord.js Awaitable type
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user