feat: Improved TypeScript experince

This commit is contained in:
xxDeveloper
2022-02-16 22:57:40 +03:00
parent 779011a124
commit dad3042a64
5 changed files with 12 additions and 7 deletions

View File

@@ -11,18 +11,17 @@ import type {
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<T = string> = T | (MessagePayload & MessageOptions);
export type Nullable<T> = T | null;
export type execute = Sern.Module<unknown>['execute'];
// 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 = {
message: Option<Message>;
interaction: Option<CommandInteraction>;