import type { CommandInteractionOptionResolver } from 'discord.js'; import type { CommandModule, Module } from '../handler/structures/module'; export type Nullish = T | undefined | null; // Thanks to @kelsny export type ParseType = { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never; }[keyof T]; export type Args = ParseType<{ text: string[]; slash: SlashOptions }>; 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 = { [L in K]-?: T[L] extends Record ? DefinitelyDefined : Required[L]; } & T; type Reconstruct = T extends Omit ? O & Reconstruct : T; type IsOptional = { [K in keyof T]-?: T[K] extends Required[K] ? false : true; }; /** * Turns a function with a union of array of args into a single union * [ T , V , B ] | [ A ] => T | V | B | A */ export type SpreadParams unknown> = ( args: Parameters[number], ) => unknown; /** * After modules are transformed, name and description are given default values if none * are provided to Module. This type represents that transformation */ export type DefinedModule = DefinitelyDefined; export type DefinedCommandModule = DefinitelyDefined;