more typings

This commit is contained in:
Erik 2023-08-15 19:15:19 +03:00
parent 92f1f2ee1c
commit 4a15edefa1
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
2 changed files with 7 additions and 3 deletions

View File

@ -7,4 +7,4 @@ export { SubcommandOption } from './src/classes/SubcommandOption.js';
export { IResolver } from './src/interfaces/Resolver.js'; export { IResolver } from './src/interfaces/Resolver.js';
export { OptionType, CommandOptionDefinition } from './src/interfaces/CommandOption.js'; export { OptionType, CommandOptionDefinition } from './src/interfaces/CommandOption.js';
export { CommandDefinition, ICommand } from './src/interfaces/Command.js'; export { CommandDefinition, ICommand, CommandOpts } from './src/interfaces/Command.js';

View File

@ -4,7 +4,11 @@ import SubcommandOption from '../classes/SubcommandOption.js';
import { ArgsResult } from '../Parser.js'; import { ArgsResult } from '../Parser.js';
import { CommandOptionDefinition } from './CommandOption.js'; import { CommandOptionDefinition } from './CommandOption.js';
export type CommandOpts = {
args?: ArgsResult,
subcommand?: string | null,
subcommandGroup?: string | null
}
interface ICommand { interface ICommand {
name: string, name: string,
@ -20,7 +24,7 @@ interface ICommand {
subcommandGroup(name: string): SubcommandGroupOption | null subcommandGroup(name: string): SubcommandGroupOption | null
execute(message: unknown, opts?: {args?: ArgsResult, subcommand?: string, subcommandGroup?: string}): Promise<unknown> execute(message: unknown, opts?: CommandOpts): Promise<unknown>
} }