From 3cb52086cb0dcb3d25ddf57a3bb5f01593fc4707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Susa=C3=B1a?= Date: Fri, 6 Sep 2024 21:50:03 -0400 Subject: [PATCH] feat(types): type AnyContext --- src/cache/index.ts | 3 +++ src/commands/applications/options.ts | 21 +++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cache/index.ts b/src/cache/index.ts index b0ec2a4..ee589a1 100644 --- a/src/cache/index.ts +++ b/src/cache/index.ts @@ -33,6 +33,9 @@ import { import type { InternalOptions, UsingClient } from '../commands'; import { Overwrites } from './resources/overwrites'; import { Messages } from './resources/messages'; +export { BaseResource } from './resources/default/base'; +export { GuildRelatedResource } from './resources/default/guild-related'; +export { GuildBasedResource } from './resources/default/guild-based'; export type InferAsyncCache = InternalOptions extends { asyncCache: infer P } ? P : false; export type ReturnCache = If, T>; diff --git a/src/commands/applications/options.ts b/src/commands/applications/options.ts index 987a17a..6ba9311 100644 --- a/src/commands/applications/options.ts +++ b/src/commands/applications/options.ts @@ -1,6 +1,7 @@ import { ApplicationCommandOptionType, type APIApplicationCommandOptionChoice, type ChannelType } from '../../types'; import type { AutocompleteCallback, + EntryPointContext, MenuCommandContext, OnAutocompleteErrorCallback, ReturnOptionsTypes, @@ -82,17 +83,13 @@ export function createAttachmentOption | UserCommandInteraction> - | ComponentContext - | ModalContext = - | CommandContext - | MenuCommandContext | UserCommandInteraction> - | ComponentContext - | ModalContext, ->(data: MiddlewareContext) { +export type AnyContext = + | CommandContext + | MenuCommandContext | UserCommandInteraction> + | ComponentContext + | ModalContext + | EntryPointContext; + +export function createMiddleware(data: MiddlewareContext) { return data; }