fix typings
This commit is contained in:
parent
d455f01eb8
commit
7a39a3b96e
@ -1,9 +1,8 @@
|
||||
import { OptionType } from "../interfaces/CommandOption.js";
|
||||
import { ICommand, CommandDefinition } from "../interfaces/Command.js";
|
||||
import { ICommand, CommandDefinition, CommandOpts } from "../interfaces/Command.js";
|
||||
import SubcommandOption from "./SubcommandOption.js";
|
||||
import SubcommandGroupOption from "./SubcommandGroupOption.js";
|
||||
import CommandOption from "./CommandOption.js";
|
||||
import { ArgsResult } from "../Parser.js";
|
||||
|
||||
abstract class Command implements ICommand {
|
||||
|
||||
@ -48,7 +47,7 @@ abstract class Command implements ICommand {
|
||||
|
||||
}
|
||||
|
||||
abstract execute(message: unknown, args?: ArgsResult): Promise<unknown>;
|
||||
abstract execute(message: unknown, args: CommandOpts): Promise<unknown>;
|
||||
|
||||
get subcommands (): SubcommandOption[] {
|
||||
return this._subcommands(this.options);
|
||||
|
@ -5,7 +5,7 @@ import { ArgsResult } from '../Parser.js';
|
||||
import { CommandOptionDefinition } from './CommandOption.js';
|
||||
|
||||
export type CommandOpts = {
|
||||
args?: ArgsResult,
|
||||
args: ArgsResult,
|
||||
subcommand?: string | null,
|
||||
subcommandGroup?: string | null
|
||||
}
|
||||
@ -24,7 +24,7 @@ interface ICommand {
|
||||
|
||||
subcommandGroup(name: string): SubcommandGroupOption | null
|
||||
|
||||
execute(message: unknown, opts?: CommandOpts): Promise<unknown>
|
||||
execute(message: unknown, opts: CommandOpts): Promise<unknown>
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user