change handler types file extension

This commit is contained in:
jacoobes
2022-02-07 01:14:20 -06:00
parent 0781ab200a
commit b328edb7ce

27
src/types/handler.ts Normal file
View File

@@ -0,0 +1,27 @@
import type { Option } from 'ts-results'
import type { CommandInteraction, CommandInteractionOptionResolver, Message, MessagePayload, MessageOptions } from 'discord.js';
import type * as Sern from "../handler/sern"
export type Visibility = "private" | "public"
//Anything that can be sent in a `<TextChannel>#send` or `<CommandInteraction>#reply`
export type possibleOutput = string | MessagePayload & MessageOptions;
export type Nullable<T> = T | null;
export type delegate = Sern.Module<unknown>["delegate"]
/// Thanks @cursorsdottsx
export type ParseType<T> = {
[K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never;
}[keyof T];
// A Sern.Module["delegate"] will carry a Context Parameter
export type Context = {
text: Option<Message>,
slash: Option<CommandInteraction>
}
export interface Arg {
text: string;
slash: SlashOptions
}
// TypeAlias for interaction.options
export type SlashOptions = Omit<CommandInteractionOptionResolver, "getMessage" | "getFocused">;