import type { RegisteredPluginMiddlewares, SeyfertRegistry } from '../client/plugins'; import type { FlatObjectKeys, PermissionStrings } from '../common'; import { ApplicationCommandType, ApplicationIntegrationType, type EntryPointCommandHandlerType, InteractionContextType, type LocaleString } from '../types'; import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat'; import type { AnyMiddlewareContext, DefaultLocale, ExtraProps, IgnoreCommand } from './applications/shared'; export type RegisteredMiddlewares = SeyfertRegistry extends { middlewares: infer M extends Record; } ? M : {}; export type ResolvedRegisteredMiddlewares = RegisteredMiddlewares & RegisteredPluginMiddlewares; type MiddlewareKey = keyof ResolvedRegisteredMiddlewares; export type InferMiddlewares = T[number]; export type CommandDeclareOptions = DecoratorDeclareOptions | (Omit & { type: ApplicationCommandType.User | ApplicationCommandType.Message; }) | (Omit & { type: ApplicationCommandType.PrimaryEntryPoint; handler: EntryPointCommandHandlerType; }); export interface DecoratorDeclareOptions { name: string; description: string; botPermissions?: PermissionStrings; defaultMemberPermissions?: PermissionStrings; guildId?: readonly string[]; nsfw?: boolean; integrationTypes?: (keyof typeof ApplicationIntegrationType)[] | ApplicationIntegrationType[]; contexts?: (keyof typeof InteractionContextType)[] | InteractionContextType[]; ignore?: IgnoreCommand; aliases?: readonly string[]; props?: ExtraProps; } export declare function Locales({ name: names, description: descriptions, }: { name?: [language: LocaleString, value: string][]; description?: [language: LocaleString, value: string][]; }): (target: T) => { new (...args: any[]): { name_localizations: { [k: string]: string; } | undefined; description_localizations: { [k: string]: string; } | undefined; }; } & T; export declare function LocalesT(name?: FlatObjectKeys, description?: FlatObjectKeys): (target: T) => { new (...args: any[]): { __t: { name: undefined; description: undefined; }; }; } & T; export type TranslatedGroupDefinition = { name?: FlatObjectKeys; description?: FlatObjectKeys; defaultDescription: string; aliases?: string[]; }; export type LocalizedGroupDefinition = { name?: [language: LocaleString, value: string][]; description?: [language: LocaleString, value: string][]; defaultDescription: string; aliases?: string[]; }; export type GroupDefinition = TranslatedGroupDefinition | LocalizedGroupDefinition; export type GroupDefinitions = Record | Record; export declare function defineGroups>(groups: T): T; export declare function defineGroups>(groups: T): T; export declare function GroupsT>(groups: T): (target: T_1) => { new (...args: any[]): { __tGroups: T; groupsAliases: Record; }; } & T_1; export declare function Groups>(groups: T): (target: T_1) => { new (...args: any[]): { groups: T; groupsAliases: Record; }; } & T_1; type GroupDecorator = (target: T) => { new (...args: any[]): { group: string; }; } & T; type OptionsDecorator = (target: T) => { new (...args: any[]): { options: SubCommand[] | CommandOption[]; }; } & T; type LowercaseOptionsRecord = T & { [K in keyof T as K extends string ? (K extends Lowercase ? never : K) : never]: never; }; type LowercaseDeclareName = { [K in keyof T]: K extends 'name' ? T extends { type: ApplicationCommandType.User | ApplicationCommandType.Message; } ? T[K] : string extends T[K] ? T[K] : T[K] extends Lowercase ? T[K] : Lowercase : T[K]; }; export declare function Group(groupName: string): GroupDecorator; export declare function Group(_groupsDef: T, groupName: keyof T & string): GroupDecorator; export declare function Options(options: (new () => SubCommand)[]): OptionsDecorator; export declare function Options(options: LowercaseOptionsRecord): OptionsDecorator; export declare function AutoLoad(): (target: T) => { new (...args: any[]): { __autoload: boolean; }; } & T; export declare function middlewares(...cbs: T): T; export declare function Middlewares(cbs: readonly MiddlewareKey[]): (target: T) => { new (...args: any[]): { middlewares: readonly never[]; }; } & T; export declare function Declare(input: LowercaseDeclareName): (target: C) => { new (...args: any[]): { name: string; nsfw: boolean | undefined; props: ExtraProps | undefined; contexts: InteractionContextType[]; integrationTypes: ApplicationIntegrationType[]; defaultMemberPermissions: bigint | undefined; botPermissions: bigint | undefined; description: string; type: ApplicationCommandType; guildId?: string[]; ignore?: IgnoreCommand; aliases?: string[]; handler?: EntryPointCommandHandlerType; }; } & C; export {};