mirror of
https://github.com/sern-handler/handler
synced 2026-06-16 12:52:15 +00:00
feat: finishing autocomplete!!
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
import type {
|
||||
Awaitable,
|
||||
ClientEvents,
|
||||
CommandInteractionOptionResolver,
|
||||
MessageOptions,
|
||||
MessagePayload,
|
||||
} from 'discord.js';
|
||||
import type { Awaitable, ClientEvents, CommandInteractionOptionResolver } from 'discord.js';
|
||||
import type { EventEmitter } from 'events';
|
||||
// Anything that can be sent in a `<TextChannel>#send` or `<CommandInteraction>#reply`
|
||||
export type possibleOutput<T = string> = T | (MessagePayload & MessageOptions);
|
||||
export type Nullish<T> = T | undefined | null;
|
||||
// Thanks @cursorsdottsx
|
||||
export type ParseType<T> = {
|
||||
@@ -16,8 +9,14 @@ export type ParseType<T> = {
|
||||
|
||||
export type Args = ParseType<{ text: string[]; slash: SlashOptions }>;
|
||||
|
||||
export type DiscordEvent = ParseType<{ [K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable<void> }>;
|
||||
export type EventEmitterRegister = [emitter: EventEmitter, k: string, cb: (...args: unknown[]) => Awaitable<void>];
|
||||
export type DiscordEvent = ParseType<{
|
||||
[K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable<void>;
|
||||
}>;
|
||||
export type EventEmitterRegister = [
|
||||
emitter: EventEmitter,
|
||||
k: string,
|
||||
cb: (...args: unknown[]) => Awaitable<void>,
|
||||
];
|
||||
|
||||
export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' | 'getFocused'>;
|
||||
|
||||
@@ -25,3 +24,10 @@ export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' |
|
||||
export type Override<T1, T2> = Omit<T1, keyof T2> & T2;
|
||||
|
||||
export type DefinitelyDefined<T, K> = T & Override<T, K>;
|
||||
export type Expand<T> = T extends object ? { [K in keyof T]: Expand<T[K]> } : T;
|
||||
|
||||
type Reconstruct<T> = T extends Omit<infer O, infer _> ? O & Reconstruct<O> : T;
|
||||
|
||||
type IsOptional<T> = {
|
||||
[K in keyof T]-?: T[K] extends Required<T>[K] ? false : true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user