frontpage/lib/commands/types.tsx

22 lines
451 B
TypeScript
Raw Normal View History

2022-01-14 14:27:19 +01:00
import type { CommandInterface } from ".";
2021-12-17 18:55:00 +01:00
export interface Flag {
2021-12-16 00:21:14 +01:00
short: string;
long: string;
desc: string;
}
interface SubCommand {
name: string;
desc: string;
}
export interface Command {
name: string;
hidden?: boolean;
desc: string;
2021-12-17 20:02:42 +01:00
flags?: Record<string,Flag>;
subcommands?: Record<string,SubCommand>;
2022-01-14 14:27:19 +01:00
execute: (flags: string[], args: string[], raw: string, cmdIf: CommandInterface) => string[];
2021-12-16 00:21:14 +01:00
}