fix typings

This commit is contained in:
Erik 2023-08-17 14:42:50 +03:00
parent d455f01eb8
commit 7a39a3b96e
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
2 changed files with 4 additions and 5 deletions

View File

@ -1,9 +1,8 @@
import { OptionType } from "../interfaces/CommandOption.js"; 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 SubcommandOption from "./SubcommandOption.js";
import SubcommandGroupOption from "./SubcommandGroupOption.js"; import SubcommandGroupOption from "./SubcommandGroupOption.js";
import CommandOption from "./CommandOption.js"; import CommandOption from "./CommandOption.js";
import { ArgsResult } from "../Parser.js";
abstract class Command implements ICommand { 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[] { get subcommands (): SubcommandOption[] {
return this._subcommands(this.options); return this._subcommands(this.options);

View File

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