diff --git a/src/types/handler.ts b/src/types/handler.ts index ed87ce9..fa1c0d7 100644 --- a/src/types/handler.ts +++ b/src/types/handler.ts @@ -1,14 +1,4 @@ -import type { - APIEmbed, - Awaitable, - ClientEvents, - CommandInteractionOptionResolver, - MessageEditOptions, - WebhookEditMessageOptions, -} from 'discord.js'; -import type { EventEmitter } from 'events'; -import type { SernEventsMapping } from '../handler/sernEmitter'; -import type { JSONEncodable } from '@discordjs/builders'; +import type { CommandInteractionOptionResolver } from 'discord.js'; export type Nullish = T | undefined | null; // Thanks to @kelsny @@ -18,25 +8,12 @@ export type ParseType = { export type Args = ParseType<{ text: string[]; slash: SlashOptions }>; -export type DiscordEvent = ParseType<{ - [K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable; -}>; - -export type SernEvent = ParseType<{ - [K in keyof SernEventsMapping]: (...args: SernEventsMapping[K]) => Awaitable; -}>; -export type EventEmitterRegister = [ - emitter: EventEmitter, - k: string, - cb: (...args: unknown[]) => Awaitable, -]; - export type SlashOptions = Omit; // Source: https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l export type Override = Omit & T2; -export type DefinitelyDefined = { +export type DefinitelyDefined = { [L in K]-?: T[L] extends Record ? DefinitelyDefined : Required[L]; @@ -48,12 +25,6 @@ type IsOptional = { [K in keyof T]-?: T[K] extends Required[K] ? false : true; }; -export type ConformedEditOptions = Override< - MessageEditOptions | WebhookEditMessageOptions, - { - embeds?: (JSONEncodable | APIEmbed)[]; - } ->; /** * Turns a function with a union of array of args into a single union * [ T , V , B ] | [ A ] => T | V | B | A