From 4a15edefa1150d4dfc596e5d5f309d19aebaf876 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 15 Aug 2023 19:15:19 +0300 Subject: [PATCH] more typings --- index.ts | 2 +- src/interfaces/Command.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 1aff347..bfc6cc8 100644 --- a/index.ts +++ b/index.ts @@ -7,4 +7,4 @@ export { SubcommandOption } from './src/classes/SubcommandOption.js'; export { IResolver } from './src/interfaces/Resolver.js'; export { OptionType, CommandOptionDefinition } from './src/interfaces/CommandOption.js'; -export { CommandDefinition, ICommand } from './src/interfaces/Command.js'; \ No newline at end of file +export { CommandDefinition, ICommand, CommandOpts } from './src/interfaces/Command.js'; \ No newline at end of file diff --git a/src/interfaces/Command.ts b/src/interfaces/Command.ts index 0e921f6..3d2431d 100644 --- a/src/interfaces/Command.ts +++ b/src/interfaces/Command.ts @@ -4,7 +4,11 @@ import SubcommandOption from '../classes/SubcommandOption.js'; import { ArgsResult } from '../Parser.js'; import { CommandOptionDefinition } from './CommandOption.js'; - +export type CommandOpts = { + args?: ArgsResult, + subcommand?: string | null, + subcommandGroup?: string | null +} interface ICommand { name: string, @@ -20,7 +24,7 @@ interface ICommand { subcommandGroup(name: string): SubcommandGroupOption | null - execute(message: unknown, opts?: {args?: ArgsResult, subcommand?: string, subcommandGroup?: string}): Promise + execute(message: unknown, opts?: CommandOpts): Promise }