import type { Logger, NulleableCoalising, OmitInsert } from '../common'; import { BaseHandler } from '../common'; import { type APIApplicationCommandOption, type LocalizationMap } from '../types'; import type { EntryPointCommand } from '.'; import { Command, type CommandOption, SubCommand } from './applications/chat'; import { ContextMenuCommand } from './applications/menu'; import { type UsingClient } from './applications/shared'; export declare class CommandHandler extends BaseHandler { protected logger: Logger; protected client: UsingClient; values: (Command | ContextMenuCommand)[]; entryPoint: EntryPointCommand | null; filter: (path: string) => boolean; constructor(logger: Logger, client: UsingClient); reload(resolve: string | Command): Promise; reloadAll(stopIfFail?: boolean): Promise; protected shouldUploadLocales(locales?: LocalizationMap | null, cachedLocales?: LocalizationMap | null): boolean; protected shouldUploadChoices(option: APIApplicationCommandOption, cached: APIApplicationCommandOption): boolean; protected shouldUploadOption(option: APIApplicationCommandOption, cached: APIApplicationCommandOption): boolean; shouldUpload(file: string, guildId?: string): Promise; private prepareCommand; checkSubCommandsLimit(command: Command): void; private normalizeLoadOptions; set(commands: SeteableCommand[], optionsOrTransform?: CommandLoadTransformer | CommandLoadOptions): (Command | EntryPointCommand | ContextMenuCommand)[]; load(commandsDir: string, client: UsingClient, options?: CommandLoadOptions): Promise<(Command | ContextMenuCommand)[]>; parseLocales(command: InstanceType): Command | EntryPointCommand | ContextMenuCommand | SubCommand; protected getLocales(locale: string): ("id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "es-419" | "sv-SE" | "th" | "tr" | "uk" | "vi")[]; protected getLocaleKey(locale: string, key: string, context: string): string | undefined; parseGlobalLocales(command: InstanceType): void; parseCommandOptionLocales(option: CommandOption, commandName?: string): void; parseCommandLocales(command: Command): void; parseContextMenuLocales(command: ContextMenuCommand): ContextMenuCommand; parseSubCommandLocales(command: SubCommand): SubCommand; stablishContextCommandDefaults(commandInstance: InstanceType): ContextMenuCommand | false; stablishCommandDefaults(commandInstance: InstanceType): OmitInsert; }> | false; stablishSubCommandDefaults(commandInstance: Command, option: SubCommand): SubCommand; onFile(file: FileLoaded): HandleableCommand[] | undefined; onCommand(file: SeteableCommand, create?: CommandLoadCreator): HandleableCommandInstance | false; onSubCommand(file: HandleableSubCommand): SubCommand | false; } export type FileLoaded = { default?: NulleableCoalising; } & Record>; export type HandleableCommand = new () => Command | SubCommand | ContextMenuCommand | EntryPointCommand; export type SettableCommand = new () => Exclude, SubCommand>; export type HandleableCommandInstance = Command | SubCommand | ContextMenuCommand | EntryPointCommand; export type SeteableCommand = HandleableCommand | HandleableCommandInstance; export type HandleableSubCommand = new () => SubCommand; export type CommandLoadCreator = (constructor: T, next: () => InstanceType) => InstanceType; export type CommandLoadTransformer = (command: HandleableCommandInstance) => HandleableCommandInstance | false | void; export interface CommandLoadOptions { create?: CommandLoadCreator; transform?: CommandLoadTransformer; }